Package org.opt4j.config
Class PropertyModule
- java.lang.Object
-
- org.opt4j.config.PropertyModule
-
- All Implemented Interfaces:
com.google.inject.Module,Serializable,Comparable<PropertyModule>
public final class PropertyModule extends Object implements com.google.inject.Module, Serializable, Comparable<PropertyModule>
ThePropertyModuleis a decorator for aModulethat enables property methods.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PropertyModule(com.google.inject.Module module)Constructs aPropertyModulethat decorates aModule.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PropertyModuleclone()intcompareTo(PropertyModule other)voidconfigure(com.google.inject.Binder binder)booleanequals(Object obj)NodegetConfiguration(Document document)Returns the configuration of thePropertyModuleas XMLNode.com.google.inject.ModulegetModule()Returns the decoratedModule.List<Property>getProperties()Returns the properties.PropertygetProperty(String name)Returns thePropertywith the specifiedname.inthashCode()voidsetConfiguration(Node node)Configures aPropertyModulewith an XMLNode.static ObjecttoEnumElement(String name, Class<? extends Enum> type)Converts a String to an element of a given enumeration.StringtoString()
-
-
-
Constructor Detail
-
PropertyModule
public PropertyModule(com.google.inject.Module module)
Constructs aPropertyModulethat decorates aModule.- Parameters:
module- the decorated module
-
-
Method Detail
-
toEnumElement
public static Object toEnumElement(String name, Class<? extends Enum> type)
Converts a String to an element of a given enumeration.- Parameters:
name- the name of the elementtype- the enumeration type- Returns:
- the element of the enumeration
-
configure
public void configure(com.google.inject.Binder binder)
- Specified by:
configurein interfacecom.google.inject.Module
-
getModule
public com.google.inject.Module getModule()
Returns the decoratedModule.- Returns:
- the module
-
getProperty
public Property getProperty(String name)
Returns thePropertywith the specifiedname.- Parameters:
name- the name of the property- Returns:
- the property with the specified
name
-
setConfiguration
public void setConfiguration(Node node)
Configures aPropertyModulewith an XMLNode.- Parameters:
node- the configuration as XML node- See Also:
getConfiguration(org.w3c.dom.Document)
-
getConfiguration
public Node getConfiguration(Document document)
Returns the configuration of thePropertyModuleas XMLNode.- Parameters:
document- the XML document- Returns:
- the configuration as XML node
- See Also:
setConfiguration(org.w3c.dom.Node)
-
clone
public PropertyModule clone()
-
compareTo
public int compareTo(PropertyModule other)
- Specified by:
compareToin interfaceComparable<PropertyModule>
-
-