Interface EventNode

    • Method Summary

      All Methods Instance Methods Abstract 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 source of the event.
      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 interface java.lang.Iterable

        forEach, iterator, spliterator
    • Method Detail

      • getLine

        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.
        Returns:
        this returns the line number if it is available
      • getName

        java.lang.String getName()
        This provides the name of the event. Typically this will be the name of an XML element if the event represents an element. If however the event represents a text token or an element close token then this method may return null for the name.
        Returns:
        this returns the name of this event or null
      • getValue

        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.
        Returns:
        this returns the value represented by this event
      • getReference

        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

        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

        java.lang.Object getSource()
        This is used to return the source of the event. Depending on which provider was selected to parse the XML document an object for the internal parsers representation of the event will be returned. This is useful for debugging purposes.
        Returns:
        this will return the source object for this event
      • isEnd

        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.
        Returns:
        this returns true if the event is an element close
      • isStart

        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.
        Returns:
        this returns true if the event represents an element
      • isText

        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.
        Returns:
        this returns true if this represents text