Class EventElement

  • 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
    Direct Known Subclasses:
    DocumentReader.Start, PullReader.Start, StreamReader.Start

    abstract class EventElement
    extends java.util.ArrayList<Attribute>
    implements EventNode
    The EventElement object is used to represent an event that has been extracted from the XML document. Events provide a framework neutral way to represent a token from the source XML. It provides the name and value of the event, if applicable, and also provides namespace information. Some nodes will have associated Attribute objects, typically these will be the XML element events. Also, if available, the event will provide the line number the event was encountered in the XML.
    • Field Summary

      • Fields inherited from class java.util.AbstractList

        modCount
    • Constructor Summary

      Constructors 
      Constructor Description
      EventElement()  
    • 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 getValue()
      This returns the value of the event.
      boolean isEnd()
      This is true when the node represents an element close.
      boolean isStart()
      This is true when the node represents a new element.
      boolean isText()
      This is true when the node represents a text token.
      • 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
    • Constructor Detail

      • EventElement

        EventElement()
    • 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
        Returns:
        this returns the line number if it is available
      • getValue

        public java.lang.String getValue()
        This returns the value of the event. Typically this will be the text value that the token contains. If the event does not contain a value then this returns null. Only text events are required to produce a value via this methods.
        Specified by:
        getValue in interface EventNode
        Returns:
        this returns the value represented by this event
      • isEnd

        public boolean isEnd()
        This is true when the node represents an element close. Such events are required by the core reader to determine if a node is still in context. This helps to determine if there are any more children to be read from a specific node.
        Specified by:
        isEnd in interface EventNode
        Returns:
        this returns true if the event is an element close
      • isStart

        public boolean isStart()
        This is true when the node represents a new element. This is the core event type as it contains the element name and any associated attributes. The core reader uses this to compose the input nodes that are produced.
        Specified by:
        isStart in interface EventNode
        Returns:
        this returns true if the event represents an element
      • isText

        public boolean isText()
        This is true when the node represents a text token. Text tokens are required to provide a value only. So namespace details and the node name will typically return null.
        Specified by:
        isText in interface EventNode
        Returns:
        this returns true if this represents text