|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.codemonster.surinam.parser.XNode
public class XNode
This is a wrapper of convenience to make it easier and more intuitive to work with any node objects that are returned. It is also possible to get the w3c Node that this object wraps. However, this object also has some additional accessors for immediate children, that do not require working with the inner nodes.
Constructor Summary | |
---|---|
XNode(Node node)
|
Method Summary | |
---|---|
float |
getChildFloatValue(String tagname)
Designed for use in terminating lists where the leaves/fields are children of list elements. |
int |
getChildIntValue(String tagname)
Designed for use in terminating lists where the leaves/fields are children of list elements. |
long |
getChildLongValue(String tagname)
Designed for use in terminating lists where the leaves/fields are children of list elements. |
List<XNode> |
getChildren()
|
String |
getChildStringValue(String tagname)
Designed for use in terminating lists where the leaves/fields are children of list elements. |
String |
getName()
|
List<XNode> |
getNamedChildren(String tagname)
|
Node |
getNode()
|
String |
getValue()
|
void |
setNode(Node node)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XNode(Node node)
Method Detail |
---|
public String getName()
public String getValue()
public String getChildStringValue(String tagname) throws ElementDoesNotExistException, MultipleTargetElementsException
tagname
- name of the child tag we are looking for.
ElementDoesNotExistException
- Thrown if the element does not exist.
MultipleTargetElementsException
- There should be one and only one child with this name.public int getChildIntValue(String tagname) throws MultipleTargetElementsException, ElementDoesNotExistException
tagname
- name of the child tag we are looking for.
ElementDoesNotExistException
- Thrown if the element does not exist.
MultipleTargetElementsException
- There should be one and only one child with this name.public long getChildLongValue(String tagname) throws MultipleTargetElementsException, ElementDoesNotExistException
tagname
- name of the child tag we are looking for.
ElementDoesNotExistException
- Thrown if the element does not exist.
MultipleTargetElementsException
- There should be one and only one child with this name.public float getChildFloatValue(String tagname) throws MultipleTargetElementsException, ElementDoesNotExistException
tagname
- name of the child tag we are looking for.
ElementDoesNotExistException
- Thrown if the element does not exist.
MultipleTargetElementsException
- There should be one and only one child with this name.public List<XNode> getChildren()
public List<XNode> getNamedChildren(String tagname)
tagname
- The name of the tag we are searching for.
public Node getNode()
public void setNode(Node node)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |