Class PullReader.Start

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<Attribute>, java.util.Collection<Attribute>, java.util.List<Attribute>, java.util.RandomAccess, EventNode
    Enclosing class:
    PullReader

    private static class PullReader.Start
    extends EventElement
    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

      Fields 
      Modifier and Type Field Description
      private int line
      This is the line number where this element was read.
      private java.lang.String name
      This is the name that is used by this attribute.
      private java.lang.String prefix
      This is the XML namespace prefix used by the attribute.
      private java.lang.String reference
      This is the XML namespace reference used by the attribute.
      private org.xmlpull.v1.XmlPullParser source
      This is the XML pull parser source that is used for this.
      • Fields inherited from class java.util.AbstractList

        modCount
    • Constructor Summary

      Constructors 
      Constructor Description
      Start​(org.xmlpull.v1.XmlPullParser source)
      Constructor for the Start object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getLine()
      This is used to provide the line number the XML event was encountered at within the XML document.
      java.lang.String getName()
      This provides the name of the event.
      java.lang.String getPrefix()
      This is used to acquire the namespace prefix associated with this node.
      java.lang.String getReference()
      This is used to acquire the namespace reference that this node is in.
      java.lang.Object getSource()
      This is used to return the node for the element.
      • Methods inherited from class java.util.ArrayList

        add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
      • Methods inherited from class java.util.AbstractCollection

        containsAll, toString
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        parallelStream, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.List

        containsAll
    • Field Detail

      • source

        private final org.xmlpull.v1.XmlPullParser source
        This is the XML pull parser source that is used for this.
      • reference

        private final java.lang.String reference
        This is the XML namespace reference used by the attribute.
      • prefix

        private final java.lang.String prefix
        This is the XML namespace prefix used by the attribute.
      • name

        private final java.lang.String name
        This is the name that is used by this attribute.
      • line

        private final int line
        This is the line number where this element was read.
    • Constructor Detail

      • Start

        public Start​(org.xmlpull.v1.XmlPullParser source)
        Constructor for the Start object. 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 Detail

      • 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:
        getLine in interface EventNode
        Overrides:
        getLine in class EventElement
        Returns:
        this returns the line number if it is available
      • getName

        public java.lang.String 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

        public java.lang.String 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

        public java.lang.String 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

        public java.lang.Object 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