org.opt4j.core.config
Class PropertyModule

java.lang.Object
  extended by 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>

The PropertyModule is a decorator for a Module that enables property methods.

See Also:
Serialized Form

Field Summary
protected static int c
           
 int id
           
protected  com.google.inject.Module module
           
protected  java.util.List<Property> properties
           
 
Constructor Summary
PropertyModule(com.google.inject.Module module)
          Constructs a PropertyModule that decorates a Module.
 
Method Summary
 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 the PropertyModule as XML Node.
 com.google.inject.Module getModule()
          Returns the decorated Module.
 java.util.List<Property> getProperties()
          Returns the properties.
 Property getProperty(java.lang.String name)
          Returns the Property with the specified name.
 int hashCode()
           
 void setConfiguration(org.w3c.dom.Node node)
          Configures a PropertyModule with an XML Node.
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()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

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 a PropertyModule that decorates a Module.

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 element
type - the enumeration type
Returns:
the element of the enumeration

configure

public void configure(com.google.inject.Binder binder)
Specified by:
configure in interface com.google.inject.Module

getModule

public com.google.inject.Module getModule()
Returns the decorated Module.

Returns:
the module

getProperty

public Property getProperty(java.lang.String name)
Returns the Property with the specified name.

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 class java.lang.Object

setConfiguration

public void setConfiguration(org.w3c.dom.Node node)
Configures a PropertyModule with an XML Node.

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 the PropertyModule as XML Node.

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 class java.lang.Object

compareTo

public int compareTo(PropertyModule other)
Specified by:
compareTo in interface java.lang.Comparable<PropertyModule>

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object