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>
ThePropertyModule
is a decorator for aModule
that enables property methods.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PropertyModule(com.google.inject.Module module)
Constructs aPropertyModule
that decorates aModule
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PropertyModule
clone()
int
compareTo(PropertyModule other)
void
configure(com.google.inject.Binder binder)
boolean
equals(Object obj)
Node
getConfiguration(Document document)
Returns the configuration of thePropertyModule
as XMLNode
.com.google.inject.Module
getModule()
Returns the decoratedModule
.List<Property>
getProperties()
Returns the properties.Property
getProperty(String name)
Returns theProperty
with the specifiedname
.int
hashCode()
void
setConfiguration(Node node)
Configures aPropertyModule
with an XMLNode
.static Object
toEnumElement(String name, Class<? extends Enum> type)
Converts a String to an element of a given enumeration.String
toString()
-
-
-
Constructor Detail
-
PropertyModule
public PropertyModule(com.google.inject.Module module)
Constructs aPropertyModule
that 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:
configure
in interfacecom.google.inject.Module
-
getModule
public com.google.inject.Module getModule()
Returns the decoratedModule
.- Returns:
- the module
-
getProperty
public Property getProperty(String name)
Returns theProperty
with the specifiedname
.- Parameters:
name
- the name of the property- Returns:
- the property with the specified
name
-
setConfiguration
public void setConfiguration(Node node)
Configures aPropertyModule
with 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 thePropertyModule
as 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:
compareTo
in interfaceComparable<PropertyModule>
-
-