com.agimatec.commons.config
Class CompositeNode
java.lang.Object
com.agimatec.commons.config.Node
com.agimatec.commons.config.CompositeNode
- All Implemented Interfaces:
- 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 |
CompositeNode
public CompositeNode()
getNode
public Object getNode(String path)
getInt
public int getInt(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(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(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(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 String getString(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(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 String getURLPath(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 String getFilePath(String name)
getList
public List getList(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 Map getMap(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.