Class PullReader.Entry

  • All Implemented Interfaces:
    Attribute
    Enclosing class:
    PullReader

    private static class PullReader.Entry
    extends EventAttribute
    The Entry object is used to represent an attribute within a start element. This holds the name and value of the attribute as well as the namespace prefix and reference. These details can be used to represent the attribute so that should the core reader require these details they can be acquired.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      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.
      private java.lang.String value
      This is the value that is used by this attribute.
    • Constructor Summary

      Constructors 
      Constructor Description
      Entry​(org.xmlpull.v1.XmlPullParser source, int index)
      Constructor for the Entry object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getName()
      This provides the name of the attribute.
      java.lang.String getPrefix()
      This is used to acquire the namespace prefix associated with this attribute.
      java.lang.String getReference()
      This is used to acquire the namespace reference that this attribute is in.
      java.lang.Object getSource()
      This is used to return the node for the attribute.
      java.lang.String getValue()
      This returns the value of the event.
      boolean isReserved()
      This returns true if the attribute is reserved.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.
      • value

        private final java.lang.String value
        This is the value that is used by this attribute.
    • Constructor Detail

      • Entry

        public Entry​(org.xmlpull.v1.XmlPullParser source,
                     int index)
        Constructor for the Entry object. This creates an attribute object that is used to extract the name, value namespace prefix, and namespace reference from the provided node. This is used to populate any start events created.
        Parameters:
        source - this is the parser used to get the attribute
        index - this is the index of the attribute to get
    • Method Detail

      • getName

        public java.lang.String getName()
        This provides the name of the attribute. This will be the name of the XML attribute without any namespace prefix. If the name begins with "xml" then this attribute is reserved. according to the namespaces for XML 1.0 specification.
        Returns:
        this returns the name of this attribute object
      • getValue

        public java.lang.String getValue()
        This returns the value of the event. This will be the value that the attribute contains. If the attribute does not have a value then this returns null or an empty string.
        Returns:
        this returns the value represented by this object
      • isReserved

        public boolean isReserved()
        This returns true if the attribute is reserved. An attribute is considered reserved if it begins with "xml" according to the namespaces in XML 1.0 specification. Such attributes are used for namespaces and other such details.
        Specified by:
        isReserved in interface Attribute
        Overrides:
        isReserved in class EventAttribute
        Returns:
        this returns true if the attribute is reserved
      • getReference

        public java.lang.String getReference()
        This is used to acquire the namespace reference that this attribute is in. A namespace is normally associated with an attribute if that attribute is prefixed with a known token. If there is no prefix then this will return null.
        Specified by:
        getReference in interface Attribute
        Overrides:
        getReference in class EventAttribute
        Returns:
        this provides the associated namespace reference
      • getPrefix

        public java.lang.String getPrefix()
        This is used to acquire the namespace prefix associated with this attribute. A prefix is used to qualify the attribute within a namespace. So, if this has a prefix then it should have a reference associated with it.
        Specified by:
        getPrefix in interface Attribute
        Overrides:
        getPrefix in class EventAttribute
        Returns:
        this returns the namespace prefix for the attribute
      • getSource

        public java.lang.Object getSource()
        This is used to return the node for the attribute. Because this represents an XML event the XML parser is returned. Returning the node helps with certain debugging issues.
        Specified by:
        getSource in interface Attribute
        Overrides:
        getSource in class EventAttribute
        Returns:
        this will return the source object for this