|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.iges.anagram.Setting
An encapsulation of XML tag data from the server's configuration file. Each Setting object provides access to the attributes and subtags of a single XML tag.
Field Summary | |
protected org.w3c.dom.Element |
xml
|
Constructor Summary | |
Setting(org.w3c.dom.Element xml)
Creates a Setting object from the given XML tag. |
|
Setting(java.lang.String name,
org.w3c.dom.Document document)
Creates a Setting object from the top-level tag of the given XML document. |
Method Summary | |
java.lang.String |
getAttribute(java.lang.String name)
Returns the value of the named attribute of this tag. |
java.lang.String |
getAttribute(java.lang.String name,
java.lang.String defaultValue)
Returns the value of the named attribute of this tag. |
java.lang.String |
getName()
Returns the name of this XML tag |
long |
getNumAttribute(java.lang.String name,
long defaultValue)
Returns the numerical value of the named attribute of this tag. |
java.util.List |
getSubSettings()
Returns a list of Setting objects representing all sub-tags of this XML tag. |
java.util.List |
getSubSettings(java.lang.String name)
Returns a list of Setting objects representing all sub-tags of this XML tag with the given name. |
Setting |
getUniqueSubSetting(java.lang.String name)
Returns the sub-tag of this XML tag with the given name. |
org.w3c.dom.Element |
getXML()
Returns the DOM interface to the XML tag associated with this Setting. |
java.lang.String |
toString()
|
protected org.w3c.dom.Element |
uniqueElement(java.lang.String name,
org.w3c.dom.Document document,
org.w3c.dom.NodeList tagList)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected org.w3c.dom.Element xml
Constructor Detail |
public Setting(org.w3c.dom.Element xml)
public Setting(java.lang.String name, org.w3c.dom.Document document) throws AnagramException
name
- The name of the top-level tagMethod Detail |
public java.lang.String getName()
public java.util.List getSubSettings(java.lang.String name)
public java.util.List getSubSettings()
public Setting getUniqueSubSetting(java.lang.String name) throws AnagramException
AnagramException
- If more than one sub-tag exists with that name.public org.w3c.dom.Element getXML()
public long getNumAttribute(java.lang.String name, long defaultValue)
defaultValue
- Returned if the tag has no such attribute,
or the attribute's value is non-numeric.public java.lang.String getAttribute(java.lang.String name)
public java.lang.String getAttribute(java.lang.String name, java.lang.String defaultValue)
defaultValue
- Returned if the tag has no such attribute.public java.lang.String toString()
toString
in class java.lang.Object
protected org.w3c.dom.Element uniqueElement(java.lang.String name, org.w3c.dom.Document document, org.w3c.dom.NodeList tagList) throws AnagramException
AnagramException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |