com.agimatec.commons.config
Class CompositeNode

java.lang.Object
  extended by com.agimatec.commons.config.Node
      extended by 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

Field Summary
 
Fields inherited from class com.agimatec.commons.config.Node
name
 
Constructor Summary
CompositeNode()
           
 
Method Summary
 boolean getBoolean(String name)
           
 double getDouble(String name)
           
 String getFilePath(String name)
           
 int getInt(String name)
           
 int getInt(String name, int defaultValue)
           
 List getList(String path)
           
 long getLong(String name)
           
 Map getMap(String path)
           
 Object getNode(String path)
           
 String getString(String name)
           
 String getURLPath(String name)
           
 
Methods inherited from class com.agimatec.commons.config.Node
evaluatePath, getName, getObjectValue, setName, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CompositeNode

public CompositeNode()
Method Detail

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-2011. All Rights Reserved.