Class XmlParser.Node
- Enclosing class:
XmlParser
XML Node. Represents an XML element with optional attributes and ordered content.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate XmlParser.Attribute[]private boolean(package private) XmlParser.Nodeprivate Stringprivate StringFields inherited from class AbstractList
modCount -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclear()get(int i) Get the ith child node or content.Get the first child node with the tag.getAttribute(String name) Get an element attribute.getAttribute(String name, String dft) Get an element attribute.Get an array of element attributes.getPath()Get a tag as a string.getTag()Iterator over named child nodes.intsize()Get the number of children nodes.toString()toString(boolean tag) Convert to a string.toString(boolean tag, boolean trim) Convert to a string.private voidtoString(StringBuilder buf, boolean tag) Methods inherited from class AbstractList
add, addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subListMethods inherited from class AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArrayMethods inherited from interface Collection
parallelStream, removeIf, streamMethods inherited from interface List
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
Field Details
-
_parent
XmlParser.Node _parent -
_list
-
_tag
-
_attrs
-
_lastString
private boolean _lastString -
_path
-
-
Constructor Details
-
Node
Node(XmlParser.Node parent, String tag, Attributes attrs)
-
-
Method Details
-
getParent
-
getTag
-
getPath
-
getAttributes
Get an array of element attributes.- Returns:
- the attributes
-
getAttribute
-
getAttribute
-
size
public int size()Get the number of children nodes.- Specified by:
sizein interfaceCollection<Object>- Specified by:
sizein interfaceList<Object>- Specified by:
sizein classAbstractCollection<Object>
-
get
-
get
Get the first child node with the tag.- Parameters:
tag- the name of the tag- Returns:
- Node or null.
-
add
-
clear
public void clear()- Specified by:
clearin interfaceCollection<Object>- Specified by:
clearin interfaceList<Object>- Overrides:
clearin classAbstractList<Object>
-
getString
-
toString
- Overrides:
toStringin classAbstractCollection<Object>
-
toString
Convert to a string.- Parameters:
tag- If false, only _content is shown.- Returns:
- the string value
-
toString
Convert to a string.- Parameters:
tag- If false, only _content is shown.trim- true to trim the content- Returns:
- the trimmed content
-
toString
-
iterator
Iterator over named child nodes.- Parameters:
tag- The tag of the nodes.- Returns:
- Iterator over all child nodes with the specified tag.
-