Class StaxReaderWrapper

  • All Implemented Interfaces:
    IXMLReader

    public class StaxReaderWrapper
    extends java.lang.Object
    implements IXMLReader
    Wrapper for the Java stax interface.
    • Field Detail

      • bis

        protected java.io.BufferedInputStream bis
        The stream.
      • reader

        protected javax.xml.stream.XMLStreamReader reader
        The wrapped reader.
      • tagstack

        protected java.util.LinkedList<XmlTag> tagstack
        The current tag.
      • closedtag

        protected XmlTag closedtag
        The last tag that was closed.
    • Constructor Detail

      • StaxReaderWrapper

        public StaxReaderWrapper​(java.io.InputStream in)
      • StaxReaderWrapper

        public StaxReaderWrapper​(javax.xml.stream.XMLStreamReader reader)
    • Method Detail

      • getEventType

        public int getEventType()
        Gets the XML event type.
        Specified by:
        getEventType in interface IXMLReader
        Returns:
        Event type.
      • hasNext

        public boolean hasNext()
        Returns if the reader has more events.
        Specified by:
        hasNext in interface IXMLReader
        Returns:
        True, if there are more events.
      • next

        public int next()
        Selects the next event.
        Specified by:
        next in interface IXMLReader
      • getXmlTag

        public XmlTag getXmlTag()
        Get the XML tag struct.
        Specified by:
        getXmlTag in interface IXMLReader
        Returns:
        Struct defining the tag.
      • getClosedTag

        public XmlTag getClosedTag()
        Get the XML tag struct of the last closed tag.
        Specified by:
        getClosedTag in interface IXMLReader
        Returns:
        Struct defining the tag.
      • getXmlTagStack

        public java.util.LinkedList<XmlTag> getXmlTagStack()
        Get the XML tag stack.
        Specified by:
        getXmlTagStack in interface IXMLReader
        Returns:
        Stack defining the tags.
      • getAttributes

        public java.util.Map<java.lang.String,​java.lang.String> getAttributes()
        Returns the attributes.
        Specified by:
        getAttributes in interface IXMLReader
        Returns:
        The attributes.
      • getText

        public java.lang.String getText()
        Get the text for the element.
        Specified by:
        getText in interface IXMLReader
        Returns:
        The text.
      • close

        public void close()
        Closes the reader.
        Specified by:
        close in interface IXMLReader
      • getLocation

        public ILocation getLocation()
        Returns the current parser location.
        Specified by:
        getLocation in interface IXMLReader
        Returns:
        Location