com.agimatec.commons.config
Class CompositeNode
java.lang.Object
com.agimatec.commons.config.Node
com.agimatec.commons.config.CompositeNode
- All Implemented Interfaces:
- java.io.Serializable
- Direct Known Subclasses:
- ListNode, MapNode
public abstract class CompositeNode
- extends Node
Abstract superclass of config nodes that can contain more nodes
and atomar nodes, with direct access methods for the atomar values.
- Author:
- Roman Stumm, Sven Ludwig
- See Also:
- Serialized Form
| Fields inherited from class com.agimatec.commons.config.Node |
name |
|
Method Summary |
boolean |
getBoolean(java.lang.String name)
|
double |
getDouble(java.lang.String name)
|
java.lang.String |
getFilePath(java.lang.String name)
|
int |
getInt(java.lang.String name)
|
int |
getInt(java.lang.String name,
int defaultValue)
|
java.util.List |
getList(java.lang.String path)
|
long |
getLong(java.lang.String name)
|
java.util.Map |
getMap(java.lang.String path)
|
java.lang.Object |
getNode(java.lang.String path)
|
java.lang.String |
getString(java.lang.String name)
|
java.lang.String |
getURLPath(java.lang.String name)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
CompositeNode
public CompositeNode()
getNode
public java.lang.Object getNode(java.lang.String path)
getInt
public int getInt(java.lang.String name)
- Parameters:
name - - a single name or concatenated config-name-path.
- Returns:
- the int value of the underlying IntNode or Integer. if the int does not exist, return 0
getInt
public int getInt(java.lang.String name,
int defaultValue)
- Parameters:
name - - a single name or concatenated config-name-path.defaultValue - - value that should be returned in case no node is found with given name
- Returns:
- the int value of the underlying IntNode or Integer. if the int does not exist, return defaultValue
getLong
public long getLong(java.lang.String name)
- Parameters:
name - - a single name or concatenated config-name-path.
- Returns:
- the long value of the LongNode or Long. if the long does not exists, return 0L
getDouble
public double getDouble(java.lang.String name)
- Parameters:
name - - a single name or concatenated config-name-path.
- Returns:
- the double value of the DoubleNode or Double. if the double does not exist, return 0.0
getString
public java.lang.String getString(java.lang.String name)
- Parameters:
name - - a single name or concatenated config-name-path.
- Returns:
- String value of the underlying String or TextNode or null. if the string does not exist, return null.
getBoolean
public boolean getBoolean(java.lang.String name)
- Parameters:
name - - a single name or concatenated config-name-path.
- Returns:
- the boolean value of the underlying BooleanNode or Boolean. if the boolean does not exist, return false.
getURLPath
public java.lang.String getURLPath(java.lang.String name)
- Parameters:
name - - a single name or concatenated config-name-path.
- Returns:
- the getPath() of the FileNode under the given name. if the file-node does not exist, return null.
getFilePath
public java.lang.String getFilePath(java.lang.String name)
getList
public java.util.List getList(java.lang.String path)
- Parameters:
path - - the path to the list or listnode
- Returns:
- return the list or null if the list does not exist
getMap
public java.util.Map getMap(java.lang.String path)
- Parameters:
path - - path leading to a Map or MapNode
- Returns:
- the Map or null if the Map does not exist.
Copyright © 2008-2012. All Rights Reserved.