org.compass.core.util.config
Interface ConfigurationHelper

All Known Implementing Classes:
AbstractConfigurationHelper, PlainConfigurationHelper

public interface ConfigurationHelper


Method Summary
 String getAttribute(String paramName)
          Return the value of specified attribute.
 String getAttribute(String name, String defaultValue)
          Returns the value of the attribute specified by its name as a String, or the default value if no attribute by that name exists or is empty.
 boolean getAttributeAsBoolean(String paramName)
          Return the boolean value of the specified parameter contained in this node.
 boolean getAttributeAsBoolean(String name, boolean defaultValue)
          Returns the value of the attribute specified by its name as a boolean, or the default value if no attribute by that name exists or is empty.
 float getAttributeAsFloat(String paramName)
          Return the float value of the specified parameter contained in this node.
 float getAttributeAsFloat(String name, float defaultValue)
          Returns the value of the attribute specified by its name as a float, or the default value if no attribute by that name exists or is empty.
 int getAttributeAsInteger(String paramName)
          Return the int value of the specified attribute contained in this node.
 int getAttributeAsInteger(String name, int defaultValue)
          Returns the value of the attribute specified by its name as a int, or the default value if no attribute by that name exists or is empty.
 long getAttributeAsLong(String name)
          Returns the value of the attribute specified by its name as a long.
 long getAttributeAsLong(String name, long defaultValue)
          Returns the value of the attribute specified by its name as a long, or the default value if no attribute by that name exists or is empty.
 String[] getAttributeNames()
          Return an array of all attribute names.
 String getAttributeOrValue(String paramName)
          First tries to get the attribute based on hte parameter, and there is none, will return the value.
 ConfigurationHelper getChild(String child)
          Return a new Configuration instance encapsulating the specified child node.
 ConfigurationHelper getChild(String child, boolean createNew)
          Return a Configuration instance encapsulating the specified child node.
 ConfigurationHelper[] getChildren()
          Return an Array of Configuration elements containing all node children.
 ConfigurationHelper[] getChildren(String... names)
           
 ConfigurationHelper[] getChildren(String name)
          Return an Array of Configuration elements containing all node children with the specified name.
 String getLocation()
          Return a string describing location of Configuration.
 String getName()
          Return the name of the node.
 String getValue()
          Return the String value of the node.
 String getValue(String defaultValue)
          Returns the value of the configuration element as a String.
 boolean getValueAsBoolean()
          Return the boolean value of the node.
 boolean getValueAsBoolean(boolean defaultValue)
          Returns the value of the configuration element as a boolean.
 float getValueAsFloat()
          Return the float value of the node.
 float getValueAsFloat(float defaultValue)
          Returns the value of the configuration element as a float.
 int getValueAsInteger()
          Return the int value of the node.
 int getValueAsInteger(int defaultValue)
          Returns the value of the configuration element as an int.
 long getValueAsLong()
          Return the long value of the node.
 long getValueAsLong(long defaultValue)
          Returns the value of the configuration element as a long.
 void makeReadOnly()
           
 

Method Detail

getName

String getName()
Return the name of the node.


getLocation

String getLocation()
Return a string describing location of Configuration. Location can be different for different mediums (ie "file:line" for normal XML files or "table:primary-key" for DB based configurations);


getChild

ConfigurationHelper getChild(String child)
Return a new Configuration instance encapsulating the specified child node.


getChild

ConfigurationHelper getChild(String child,
                             boolean createNew)
Return a Configuration instance encapsulating the specified child node.


getChildren

ConfigurationHelper[] getChildren()
Return an Array of Configuration elements containing all node children. The array order will reflect the order in the source config file.


getChildren

ConfigurationHelper[] getChildren(String name)
Return an Array of Configuration elements containing all node children with the specified name. The array order will reflect the order in the source config file.


getChildren

ConfigurationHelper[] getChildren(String... names)

getAttributeNames

String[] getAttributeNames()
Return an array of all attribute names.


getAttribute

String getAttribute(String paramName)
                    throws ConfigurationException
Return the value of specified attribute.

Throws:
ConfigurationException

getAttributeAsInteger

int getAttributeAsInteger(String paramName)
                          throws ConfigurationException
Return the int value of the specified attribute contained in this node.

Throws:
ConfigurationException

getAttributeAsLong

long getAttributeAsLong(String name)
                        throws ConfigurationException
Returns the value of the attribute specified by its name as a long.

Throws:
ConfigurationException

getAttributeAsFloat

float getAttributeAsFloat(String paramName)
                          throws ConfigurationException
Return the float value of the specified parameter contained in this node.

Throws:
ConfigurationException

getAttributeAsBoolean

boolean getAttributeAsBoolean(String paramName)
                              throws ConfigurationException
Return the boolean value of the specified parameter contained in this node.

Throws:
ConfigurationException

getAttributeOrValue

String getAttributeOrValue(String paramName)
First tries to get the attribute based on hte parameter, and there is none, will return the value.


getValue

String getValue()
                throws ConfigurationException
Return the String value of the node.

Throws:
ConfigurationException

getValueAsInteger

int getValueAsInteger()
                      throws ConfigurationException
Return the int value of the node.

Throws:
ConfigurationException

getValueAsFloat

float getValueAsFloat()
                      throws ConfigurationException
Return the float value of the node.

Throws:
ConfigurationException

getValueAsBoolean

boolean getValueAsBoolean()
                          throws ConfigurationException
Return the boolean value of the node.

Throws:
ConfigurationException

getValueAsLong

long getValueAsLong()
                    throws ConfigurationException
Return the long value of the node.

Throws:
ConfigurationException

getValue

String getValue(String defaultValue)
Returns the value of the configuration element as a String. If the configuration value is not set, the default value will be used.


getValueAsInteger

int getValueAsInteger(int defaultValue)
Returns the value of the configuration element as an int. If the configuration value is not set, the default value will be used.


getValueAsLong

long getValueAsLong(long defaultValue)
Returns the value of the configuration element as a long. If the configuration value is not set, the default value will be used.


getValueAsFloat

float getValueAsFloat(float defaultValue)
Returns the value of the configuration element as a float. If the configuration value is not set, the default value will be used.


getValueAsBoolean

boolean getValueAsBoolean(boolean defaultValue)
Returns the value of the configuration element as a boolean. If the configuration value is not set, the default value will be used.


getAttribute

String getAttribute(String name,
                    String defaultValue)
Returns the value of the attribute specified by its name as a String, or the default value if no attribute by that name exists or is empty.


getAttributeAsInteger

int getAttributeAsInteger(String name,
                          int defaultValue)
Returns the value of the attribute specified by its name as a int, or the default value if no attribute by that name exists or is empty.


getAttributeAsLong

long getAttributeAsLong(String name,
                        long defaultValue)
Returns the value of the attribute specified by its name as a long, or the default value if no attribute by that name exists or is empty.


getAttributeAsFloat

float getAttributeAsFloat(String name,
                          float defaultValue)
Returns the value of the attribute specified by its name as a float, or the default value if no attribute by that name exists or is empty.


getAttributeAsBoolean

boolean getAttributeAsBoolean(String name,
                              boolean defaultValue)
Returns the value of the attribute specified by its name as a boolean, or the default value if no attribute by that name exists or is empty.


makeReadOnly

void makeReadOnly()


Copyright (c) 2004-2009 The Compass Project.