Class XppReader

    • Field Detail

      • parser

        private final org.xmlpull.v1.XmlPullParser parser
      • reader

        private final java.io.Reader reader
    • Constructor Detail

      • XppReader

        public XppReader​(java.io.Reader reader,
                         org.xmlpull.v1.XmlPullParser parser)
        Construct an XppReader.
        Parameters:
        reader - the reader with the input data
        parser - the XPP parser to use
        Since:
        1.4
      • XppReader

        public XppReader​(java.io.Reader reader,
                         org.xmlpull.v1.XmlPullParser parser,
                         NameCoder nameCoder)
        Construct an XppReader.
        Parameters:
        reader - the reader with the input data
        parser - the XPP parser to use
        nameCoder - the coder for XML friendly tag and attribute names
        Since:
        1.4
    • Method Detail

      • createParser

        protected org.xmlpull.v1.XmlPullParser createParser()
        Deprecated.
        As of 1.4, use XppReader(Reader, XmlPullParser) instead
        To use another implementation of org.xmlpull.v1.XmlPullParser, override this method.
      • getAttribute

        public java.lang.String getAttribute​(java.lang.String name)
        Description copied from interface: HierarchicalStreamReader
        Get the value of an attribute of the current node.

        If no such attribute exists, the method returns null.

      • getAttribute

        public java.lang.String getAttribute​(int index)
        Description copied from interface: HierarchicalStreamReader
        Get the value of an attribute of the current node, by index.

        Note, the behavior of this method is dependent on the underlying parser when calling it with a non-existing index. Typically some kind of RuntimeException is thrown.

      • getAttributeCount

        public int getAttributeCount()
        Description copied from interface: HierarchicalStreamReader
        Number of attributes in current node.
      • getAttributeName

        public java.lang.String getAttributeName​(int index)
        Description copied from interface: HierarchicalStreamReader
        Name of attribute in current node.

        Note, the behavior of this method is dependent on the underlying parser when calling it with a non-existing index. Typically some kind of RuntimeException is thrown.

      • appendErrors

        public void appendErrors​(ErrorWriter errorWriter)
        Description copied from interface: HierarchicalStreamReader
        If any errors are detected, allow the reader to add any additional information that can aid debugging (such as line numbers, XPath expressions, etc).
        Parameters:
        errorWriter - the error writer
      • close

        public void close()
        Description copied from interface: HierarchicalStreamReader
        Close the reader, if necessary.