|
Jacson | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.spieleck.config.ConfigNodeImpl
Basic Data container in a Config environment.
Not that most enhanced classes will be subnodes of this or otherwise have to do a reimplementation of many methods
Nested Class Summary | |
protected class |
ConfigNodeImpl.ConfigIterator
|
Field Summary | |
protected java.util.List |
children
And cound your children! |
protected java.lang.String |
name
Node name |
protected ConfigNode |
parent
Remember your parent(s), boy |
static char |
PATHSEP
Separator for path strings used in the Config-System |
protected ConfigParamMap |
pm
A Parameter-Mapping class |
protected int |
sourceLine
Source line for this node |
protected java.lang.String |
value
Node value |
Constructor Summary | |
ConfigNodeImpl(java.lang.String name,
java.lang.String value,
ConfigParamMap pm)
Create a ConfigNodeImplementation. |
|
ConfigNodeImpl(java.lang.String name,
java.lang.String value,
ConfigParamMap pm,
int line)
Create a ConfigNodeImplementation. |
Method Summary | |
ConfigNodeImpl |
addChild(ConfigNodeImpl child)
add a child to this node and |
ConfigNodeImpl |
addChild(java.lang.String name,
java.lang.String value)
create a new child add it to this node and |
ConfigNodeImpl |
addChild(java.lang.String name,
java.lang.String value,
int line)
create a new child add it to this node and |
java.util.Iterator |
children()
Enumerate my children. |
java.util.Iterator |
childrenNamed(java.lang.String key)
Enumerate children of me, having a certain name. |
void |
copyChildren(ConfigNode next)
|
int |
countChildren()
Count the number of children we have. |
int |
countChildrenNamed(java.lang.String key)
Count the number of children we have. |
boolean |
getBoolean()
Get (expanded) value as a boolean. |
boolean |
getBoolean(java.lang.String path,
boolean deflt)
Get (expanded) value of subnode as boolean, using default if necessary. |
ConfigFileNode |
getBranchNode()
Getting the node responsible for reading the file. |
double |
getDouble()
Get (expanded) value as a double. |
double |
getDouble(java.lang.String path,
double deflt)
Get (expanded) value of subnode as double, using default when necessary. |
boolean |
getInhBoolean(java.lang.String path,
boolean deflt)
Get (expanded) value of subnode as boolean searching parent nodes before using default. |
double |
getInhDouble(java.lang.String path,
double deflt)
Get (expanded) value of subnode as double searching parent nodes before using default. |
int |
getInhInt(java.lang.String path,
int deflt)
Get (expanded) value of subnode as int searching parent nodes before using default. |
java.lang.String |
getInhString(java.lang.String path,
java.lang.String deflt)
Get (expanded) value of subnode as String searching parent nodes before using default. |
int |
getInt()
Get (expanded) value as an integer. |
int |
getInt(java.lang.String path,
int deflt)
Get (expanded) value of subnode as integer, using default when necessary. |
java.lang.String |
getName()
Get the name of the node. |
ConfigNode |
getParent()
Get the node above. |
java.lang.String |
getPath()
Get the complete path of the node. |
java.lang.String |
getSourceDescription()
Get something describing the source location of this node. |
java.lang.String |
getSourceFileName()
|
int |
getSourceLine()
|
java.lang.String |
getString()
Get (expanded) value as String. |
java.lang.String |
getString(java.lang.String path,
java.lang.String deflt)
Get (expanded) value of subnode as String, using default when necessary. |
java.lang.String |
getUnexpanded()
Get (expanded) value as String. |
protected java.lang.String |
getValue()
|
ConfigNode |
node(java.lang.String path)
Find the very first child, grandchild, ... that matches a path! |
ConfigNode |
nodeInh(java.lang.String path)
Find the very first child of this node or a parent fullfilling the path. |
void |
printXML(java.io.PrintWriter os)
Print a XML represenation of this node. |
protected void |
setParent(ConfigNode p)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final char PATHSEP
protected ConfigNode parent
protected java.util.List children
protected java.lang.String name
protected java.lang.String value
protected ConfigParamMap pm
protected int sourceLine
Constructor Detail |
public ConfigNodeImpl(java.lang.String name, java.lang.String value, ConfigParamMap pm)
name
- Name of the nodevalue
- Value of the nodepm
- Parameter map used to expand parameter values.public ConfigNodeImpl(java.lang.String name, java.lang.String value, ConfigParamMap pm, int line)
name
- Name of the nodevalue
- Value of the nodepm
- Parameter map used to expand parameter values.line
- The source line where the node was generatedMethod Detail |
public int getSourceLine()
public java.lang.String getSourceFileName()
public java.lang.String getSourceDescription()
ConfigNode
getSourceDescription
in interface ConfigNode
public ConfigFileNode getBranchNode()
getBranchNode
in interface ConfigNode
public java.lang.String getName()
ConfigNode
getName
in interface ConfigNode
public java.lang.String getPath()
ConfigNode
getPath
in interface ConfigNode
public java.lang.String getUnexpanded()
ConfigNode
getUnexpanded
in interface ConfigNode
protected java.lang.String getValue()
public ConfigNode getParent()
ConfigNode
getParent
in interface ConfigNode
protected void setParent(ConfigNode p)
public boolean getBoolean()
ConfigNode
getBoolean
in interface ConfigNode
public boolean getBoolean(java.lang.String path, boolean deflt)
ConfigNode
getBoolean
in interface ConfigNode
public boolean getInhBoolean(java.lang.String path, boolean deflt)
ConfigNode
getInhBoolean
in interface ConfigNode
public int getInt()
ConfigNode
getInt
in interface ConfigNode
public int getInt(java.lang.String path, int deflt)
ConfigNode
getInt
in interface ConfigNode
public int getInhInt(java.lang.String path, int deflt)
ConfigNode
getInhInt
in interface ConfigNode
public double getDouble()
ConfigNode
getDouble
in interface ConfigNode
public double getDouble(java.lang.String path, double deflt)
ConfigNode
getDouble
in interface ConfigNode
public double getInhDouble(java.lang.String path, double deflt)
ConfigNode
getInhDouble
in interface ConfigNode
public java.lang.String getString()
ConfigNode
getString
in interface ConfigNode
public java.lang.String getString(java.lang.String path, java.lang.String deflt)
ConfigNode
getString
in interface ConfigNode
public java.lang.String getInhString(java.lang.String path, java.lang.String deflt)
ConfigNode
getInhString
in interface ConfigNode
public ConfigNode node(java.lang.String path)
node
in interface ConfigNode
public ConfigNode nodeInh(java.lang.String path)
nodeInh
in interface ConfigNode
public int countChildren()
ConfigNode
countChildren
in interface ConfigNode
public java.util.Iterator children()
ConfigNode
children
in interface ConfigNode
public java.util.Iterator childrenNamed(java.lang.String key)
ConfigNode
childrenNamed
in interface ConfigNode
public int countChildrenNamed(java.lang.String key)
ConfigNode
countChildrenNamed
in interface ConfigNode
public void copyChildren(ConfigNode next)
public ConfigNodeImpl addChild(java.lang.String name, java.lang.String value, int line)
public ConfigNodeImpl addChild(java.lang.String name, java.lang.String value)
public ConfigNodeImpl addChild(ConfigNodeImpl child)
public void printXML(java.io.PrintWriter os) throws java.io.IOException
printXML
in interface ConfigNode
java.io.IOException
public java.lang.String toString()
|
Spieleck | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |