Class Options
java.lang.Object
org.apache.torque.generator.option.Options
A Store for all options.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddGlobalOptions(Collection<Option> options) Adds several options with global scope.booleancontainsKey(QualifiedName key) Checks if an option with the given key exists in any scope.getAllInHierarchy(Namespace namespace) Returns all mappings which live in the given namespace.Returns a map containing all options in the global scope.getInHierarchy(Namespace namespace) Returns all mappings which live in the given name space.Returns the value of the option which is closest in Hierarchy.keySet()Returns all options in a set.voidsetGlobalOption(Option option) Sets an option with global scope.toString()values()Returns all options in a Collection.
-
Constructor Details
-
Options
public Options()
-
-
Method Details
-
setGlobalOption
Sets an option with global scope.- Parameters:
option- the option to set, not null.- Throws:
NullPointerException- if option is null.
-
addGlobalOptions
Adds several options with global scope.- Parameters:
options- the option to add, not null, may not contain null.- Throws:
NullPointerException- if options is null or contains null.
-
getInHierarchy
Returns the value of the option which is closest in Hierarchy. If more than one matching options (options with the matching name and in the name space or parent name space of the key) are found, the one which name space is closer to the given key's name space is chosen.- Parameters:
key- the key for the option which value should be retrieved.- Returns:
- the value of the option (can be null), or null if no matching option exists.
-
getInHierarchy
Returns all mappings which live in the given name space. If one mapping hides another mapping, i.e. if one mapping is a more specialized version of another, the hidden mapping is NOT returned.- Parameters:
namespace- the name space from which the returned options should be visible.- Returns:
- an Options object containing the matching options
-
getAllInHierarchy
Returns all mappings which live in the given namespace. If one mapping hides another mapping, i.e. if one mapping is a more specialized version of another, both mappings are present in the returned map.- Parameters:
namespace- the name space from which the returned options should be visible.- Returns:
- an Options object containing the matching options
-
values
Returns all options in a Collection.- Returns:
- a Collection containing all options, not null. The collection is unmodifiable.
-
keySet
Returns all options in a set.- Returns:
- a Collection containing the qualified names of all options, not null.
-
getGlobalScope
Returns a map containing all options in the global scope. The key of the map is the key of the option, the value is the option itself.- Returns:
- a map containing the options in global scope, not null.
-
containsKey
Checks if an option with the given key exists in any scope.- Parameters:
key- the key to check.- Returns:
- true if the key exists, false otherwise.
-
toString
-