Package org.eclipse.jetty.xml
Class XmlParser.Node
- Enclosing class:
- XmlParser
XML Node. Represents an XML element with optional attributes and ordered content.
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
clear()
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.int
size()
Get the number of children nodes.toString()
toString
(boolean tag) Convert to a string.toString
(boolean tag, boolean trim) Convert to a string.Methods inherited from class java.util.AbstractList
add, addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
Method Details
-
getParent
-
getTag
-
getPath
-
getAttributes
Get an array of element attributes.- Returns:
- the attributes
-
getAttribute
Get an element attribute.- Parameters:
name
- the name of the attribute- Returns:
- attribute or null.
-
getAttribute
Get an element attribute.- Parameters:
name
- the name of the elementdft
- the default value- Returns:
- attribute or null.
-
size
public int size()Get the number of children nodes.- Specified by:
size
in interfaceCollection<Object>
- Specified by:
size
in interfaceList<Object>
- Specified by:
size
in classAbstractCollection<Object>
-
get
Get the ith child node or content. -
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:
clear
in interfaceCollection<Object>
- Specified by:
clear
in interfaceList<Object>
- Overrides:
clear
in classAbstractList<Object>
-
getString
Get a tag as a string.- Parameters:
tag
- The tag to gettags
- IF true, tags are included in the value.trim
- If true, trim the value.- Returns:
- results of get(tag).toString(tags).
-
toString
- Overrides:
toString
in 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
-
iterator
Iterator over named child nodes.- Parameters:
tag
- The tag of the nodes.- Returns:
- Iterator over all child nodes with the specified tag.
-