Package org.opt4j.core.config
Class PropertyModule
- java.lang.Object
-
- org.opt4j.core.config.PropertyModule
-
- All Implemented Interfaces:
com.google.inject.Module
,java.io.Serializable
,java.lang.Comparable<PropertyModule>
public final class PropertyModule extends java.lang.Object implements com.google.inject.Module, java.io.Serializable, java.lang.Comparable<PropertyModule>
ThePropertyModule
is a decorator for aModule
that enables property methods.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static int
c
int
id
protected com.google.inject.Module
module
protected java.util.List<Property>
properties
-
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(java.lang.Object obj)
org.w3c.dom.Node
getConfiguration(org.w3c.dom.Document document)
Returns the configuration of thePropertyModule
as XMLNode
.com.google.inject.Module
getModule()
Returns the decoratedModule
.java.util.List<Property>
getProperties()
Returns the properties.Property
getProperty(java.lang.String name)
Returns theProperty
with the specifiedname
.int
hashCode()
void
setConfiguration(org.w3c.dom.Node node)
Configures aPropertyModule
with an XMLNode
.static java.lang.Object
toEnumElement(java.lang.String name, java.lang.Class<? extends java.lang.Enum> type)
Converts a String to an element of a given enumeration.java.lang.String
toString()
-
-
-
Field Detail
-
module
protected final com.google.inject.Module module
-
properties
protected final java.util.List<Property> properties
-
c
protected static int c
-
id
public final int id
-
-
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 java.lang.Object toEnumElement(java.lang.String name, java.lang.Class<? extends java.lang.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(java.lang.String name)
Returns theProperty
with the specifiedname
.- Parameters:
name
- the name of the property- Returns:
- the property with the specified
name
-
getProperties
public java.util.List<Property> getProperties()
Returns the properties.- Returns:
- the properties
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
setConfiguration
public void setConfiguration(org.w3c.dom.Node node)
Configures aPropertyModule
with an XMLNode
.- Parameters:
node
- the configuration as XML node- See Also:
getConfiguration(org.w3c.dom.Document)
-
getConfiguration
public org.w3c.dom.Node getConfiguration(org.w3c.dom.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()
- Overrides:
clone
in classjava.lang.Object
-
compareTo
public int compareTo(PropertyModule other)
- Specified by:
compareTo
in interfacejava.lang.Comparable<PropertyModule>
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-