|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.soa.esb.helpers.ConfigTree
public class ConfigTree
Objects of this class are to be used for run time configuration of ESB components
This should gradually replace the ConfigTree class
Constructor Summary | |
---|---|
protected |
ConfigTree(ConfigTree other)
protected constructor |
|
ConfigTree(java.lang.String name)
Constructor of a root node (an uppermost ConfigTree) |
|
ConfigTree(java.lang.String name,
ConfigTree dad)
Constructor of a ConfigTree as a child of another (second arg) |
Method Summary | |
---|---|
void |
addTextChild(java.lang.String value)
add a child element that consists only of the text in arg0 |
int |
attributeCount()
|
java.util.List<KeyValuePair> |
attributesAsList()
obtain the list of all attribute as a List |
int |
childCount()
|
java.util.List<KeyValuePair> |
childPropertyList()
obtain the list of all child "property" elements as a List |
java.lang.Object |
clone()
|
ConfigTree |
cloneObj()
instantiate a new ConfigTree with the same topology and contents of 'this' Contained ConfigTree child elements will also be cloned Transient objects are NOT copied nor cloned |
protected void |
copyFrom(ConfigTree other)
Deep copy of other tree |
static ConfigTree |
fromElement(org.w3c.dom.Element elem)
|
static ConfigTree |
fromInputStream(java.io.InputStream input)
obtain an instance of this class, from a 'normalized' xml format contained in an input stream the 'normalized' xml format is the output of the toXml() instance method |
static ConfigTree |
fromXml(java.lang.String xml)
obtain an instance of this class, from a 'normalized' xml format, with the default encoding the 'normalized' xml format is the output of the toXml() instance method |
static ConfigTree |
fromXml(java.lang.String xml,
java.lang.String encoding)
obtain an instance of this class, from a 'normalized' xml format, with the encoding defined in arg1 the 'normalized' xml format is the output of the toXml() instance method |
ConfigTree[] |
getAllChildren()
retrieve list of child elements of 'this' that are instances of ConfigTree |
java.lang.String |
getAttribute(java.lang.String name)
Retrieve the value assigned to an attribute key. |
java.lang.String |
getAttribute(java.lang.String name,
java.lang.String defaultValue)
Retrieve the value assigned to an attribute key, returning the supplied default if the attribute is not defined. |
java.util.Set<java.lang.String> |
getAttributeNames()
obtain the list of all attribute names |
ConfigTree[] |
getChildren(java.lang.String name)
list of child elements of 'this' that are instances of ConfigTree, with name = arg0 |
ConfigTree |
getFirstChild(java.lang.String name)
first child of class ConfigTree with name=arg0 |
java.lang.String |
getFirstTextChild(java.lang.String name)
first child containing only text, with name=arg0 |
java.lang.String |
getName()
|
ConfigTree |
getParent()
whose child is 'this' (null if root) |
java.lang.String |
getRequiredAttribute(java.lang.String name)
Get the value of a requred property, throwing a ConfigurationException
if the property is not defined. |
java.lang.String[] |
getTextChildren(java.lang.String name)
Obtain all String values with the same name |
java.lang.String |
getWholeText()
concatenated values of all child String values that have been added to 'this' "" (zero length String) if no String child nodes |
boolean |
isPureText()
|
void |
removeAllChildren()
purge the list of children |
void |
removeChildrenByName(java.lang.String name)
remove children by name |
java.lang.String |
setAttribute(java.lang.String name,
java.lang.String value)
assign a value to a named attribute |
void |
setName(java.lang.String name)
assign a name to 'this' |
java.lang.String |
toString()
Equivalent to a call to toXml() |
java.lang.String |
toString(java.lang.String encoding)
Equivalent to a call to toXml(encoding) |
java.lang.String |
toXml()
|
java.lang.String |
toXml(java.lang.String encoding)
Serialize this object - Transient objects are |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ConfigTree(java.lang.String name)
name
- String - the element name of 'this'public ConfigTree(java.lang.String name, ConfigTree dad)
name
- String - element name of 'this'dad
- ConfigTree - whom 'this' will be hanging fromprotected ConfigTree(ConfigTree other)
other
- - Where to get values for deep copyMethod Detail |
---|
public java.lang.String getName()
public void setName(java.lang.String name)
name
- String - The name for this objectpublic ConfigTree getParent()
public java.lang.String setAttribute(java.lang.String name, java.lang.String value)
name
- String - the name (key) for the new attributevalue
- String - the value assigned to the key (if null - old value will be deleted)
public int attributeCount()
public java.lang.String getAttribute(java.lang.String name)
name
- String - the search key.
public java.lang.String getAttribute(java.lang.String name, java.lang.String defaultValue)
name
- String - the search key.defaultValue
- String - the default value to return if attribute is not set.
public java.lang.String getRequiredAttribute(java.lang.String name) throws ConfigurationException
ConfigurationException
if the property is not defined.
name
- String - the search key.
ConfigurationException
- The propery is not defined.public java.util.Set<java.lang.String> getAttributeNames()
public java.util.List<KeyValuePair> attributesAsList()
public java.util.List<KeyValuePair> childPropertyList()
public java.lang.String getWholeText()
public java.lang.String getFirstTextChild(java.lang.String name)
name
- String - the name to filter
public java.lang.String[] getTextChildren(java.lang.String name)
name
- String - filter for child String nodes
public void addTextChild(java.lang.String value)
value
- String - the text to assign to the added child nodepublic ConfigTree[] getAllChildren()
public ConfigTree[] getChildren(java.lang.String name)
name
- String - the name of child nodes to filter
public ConfigTree getFirstChild(java.lang.String name)
name
- String - the name to filter
public void removeAllChildren()
public void removeChildrenByName(java.lang.String name)
name
- String - only children by that name will be removedpublic int childCount()
public java.lang.Object clone()
clone
in class java.lang.Object
public ConfigTree cloneObj()
protected void copyFrom(ConfigTree other)
other
- - from where to copy valuespublic static ConfigTree fromXml(java.lang.String xml) throws org.xml.sax.SAXException
xml
- String - what to parse
org.xml.sax.SAXException
- - if xml format is invalidpublic static ConfigTree fromXml(java.lang.String xml, java.lang.String encoding) throws java.io.UnsupportedEncodingException, org.xml.sax.SAXException
xml
- String - what to parseencoding
- String - The encoding of arg 0
org.xml.sax.SAXException
- - if xml format is invalid
java.io.UnsupportedEncodingException
public static ConfigTree fromInputStream(java.io.InputStream input) throws org.xml.sax.SAXException, java.io.IOException
input
- InputStream - where to parse from
org.xml.sax.SAXException
- - if xml format is invalid
java.io.IOException
- - if an input/output error occurspublic static ConfigTree fromElement(org.w3c.dom.Element elem)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(java.lang.String encoding)
encoding
- String -
public java.lang.String toXml()
public java.lang.String toXml(java.lang.String encoding)
encoding
- String - String
public boolean isPureText()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |