Class PullReader.Start
java.lang.Object
java.util.AbstractCollection<Attribute>
java.util.AbstractList<Attribute>
java.util.ArrayList<Attribute>
org.simpleframework.xml.stream.EventElement
org.simpleframework.xml.stream.PullReader.Start
- All Implemented Interfaces:
Serializable, Cloneable, Iterable<Attribute>, Collection<Attribute>, List<Attribute>, RandomAccess, SequencedCollection<Attribute>, EventNode
- Enclosing class:
PullReader
The
Start object is used to represent the start of
an XML element. This will hold the attributes associated with
the element and will provide the name, the namespace reference
and the namespace prefix. For debugging purposes the source XML
element is provided for this start event.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intThis is the line number where this element was read.private final StringThis is the name that is used by this attribute.private final StringThis is the XML namespace prefix used by the attribute.private final StringThis is the XML namespace reference used by the attribute.private final org.xmlpull.v1.XmlPullParserThis is the XML pull parser source that is used for this.Fields inherited from class AbstractList
modCount -
Constructor Summary
ConstructorsConstructorDescriptionStart(org.xmlpull.v1.XmlPullParser source) Constructor for theStartobject. -
Method Summary
Modifier and TypeMethodDescriptionintgetLine()This is used to provide the line number the XML event was encountered at within the XML document.getName()This provides the name of the event.This is used to acquire the namespace prefix associated with this node.This is used to acquire the namespace reference that this node is in.This is used to return the node for the element.Methods inherited from class EventElement
getValue, isEnd, isStart, isTextMethods inherited from class ArrayList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, ensureCapacity, equals, forEach, get, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeIf, removeLast, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeMethods inherited from class AbstractCollection
containsAll, toStringMethods inherited from interface Collection
parallelStream, stream, toArrayMethods inherited from interface List
containsAll, reversed
-
Field Details
-
source
private final org.xmlpull.v1.XmlPullParser sourceThis is the XML pull parser source that is used for this. -
reference
This is the XML namespace reference used by the attribute. -
prefix
This is the XML namespace prefix used by the attribute. -
name
This is the name that is used by this attribute. -
line
private final int lineThis is the line number where this element was read.
-
-
Constructor Details
-
Start
public Start(org.xmlpull.v1.XmlPullParser source) Constructor for theStartobject. This will wrap the provided node and expose the required details such as the name, namespace prefix and namespace reference. The provided element node can be acquired for debugging purposes.- Parameters:
source- this is the parser being wrapped by this
-
-
Method Details
-
getLine
public int getLine()This is used to provide the line number the XML event was encountered at within the XML document. If there is no line number available for the node then this will return a -1.- Specified by:
getLinein interfaceEventNode- Overrides:
getLinein classEventElement- Returns:
- this returns the line number if it is available
-
getName
This provides the name of the event. This will be the name of an XML element the event represents. If there is a prefix associated with the element, this extracts that prefix.- Returns:
- this returns the name without the namespace prefix
-
getReference
This is used to acquire the namespace reference that this node is in. A namespace is normally associated with an XML element or attribute, so text events and element close events are not required to contain any namespace references.- Returns:
- this will provide the associated namespace reference
-
getPrefix
This is used to acquire the namespace prefix associated with this node. A prefix is used to qualify an XML element or attribute within a namespace. So, if this represents a text event then a namespace prefix is not required.- Returns:
- this returns the namespace prefix for this event
-
getSource
This is used to return the node for the element. Because this represents an XML event the XML parser is returned. Returning the node helps with certain debugging issues.- Returns:
- this will return the source object for this
-