Class MXParser

  • All Implemented Interfaces:
    org.xmlpull.v1.XmlPullParser

    public class MXParser
    extends org.xmlpull.mxp1.MXParser
    MXParser that returns an IGNORABLE_WHITESPACE event when a whitespace character or a line feed is received. This parser is useful when not validating documents.
    Author:
    Gaston Dombiak
    • Field Summary

      • Fields inherited from class org.xmlpull.mxp1.MXParser

        allStringsInterned, attributeCount, attributeName, attributeNameHash, attributePrefix, attributeUri, attributeValue, buf, bufAbsoluteStart, bufEnd, bufLoadFactor, bufSoftLimit, bufStart, charRefOneCharBuf, columnNumber, depth, elName, elNamespaceCount, elPrefix, elRawName, elRawNameEnd, elRawNameLine, elUri, emptyElementTag, entityEnd, entityName, entityNameBuf, entityNameHash, entityRefName, entityReplacement, entityReplacementBuf, eventType, FEATURE_NAMES_INTERNED, FEATURE_XML_ROUNDTRIP, inputEncoding, inputStream, lineNumber, location, LOOKUP_MAX, LOOKUP_MAX_CHAR, lookupNameChar, lookupNameStartChar, namespaceEnd, namespacePrefix, namespacePrefixHash, namespaceUri, NCODING, NO, pastEndTag, pc, pcEnd, pcStart, pos, posEnd, posStart, preventBufferCompaction, processNamespaces, PROPERTY_LOCATION, PROPERTY_XMLDECL_CONTENT, PROPERTY_XMLDECL_STANDALONE, PROPERTY_XMLDECL_VERSION, reachedEnd, READ_CHUNK_SIZE, reader, roundtripSupported, seenAmpersand, seenDocdecl, seenEndTag, seenMarkup, seenRoot, seenStartTag, TANDALONE, text, tokenize, usePC, VERSION, XML_URI, xmlDeclContent, xmlDeclStandalone, xmlDeclVersion, XMLNS_URI, YES
      • Fields inherited from interface org.xmlpull.v1.XmlPullParser

        CDSECT, COMMENT, DOCDECL, END_DOCUMENT, END_TAG, ENTITY_REF, FEATURE_PROCESS_DOCDECL, FEATURE_PROCESS_NAMESPACES, FEATURE_REPORT_NAMESPACE_ATTRIBUTES, FEATURE_VALIDATION, IGNORABLE_WHITESPACE, NO_NAMESPACE, PROCESSING_INSTRUCTION, START_DOCUMENT, START_TAG, TEXT, TYPES
    • Constructor Summary

      Constructors 
      Constructor Description
      MXParser()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long getLastHeartbeat()
      Returns the last time a heartbeat was received.
      protected char more()
      Makes sure that each individual character is a valid XML character.
      protected int nextImpl()  
      void resetInput()  
      • Methods inherited from class org.xmlpull.mxp1.MXParser

        defineEntityReplacementText, ensureAttributesCapacity, ensureElementsCapacity, ensureEntityCapacity, ensureNamespacesCapacity, ensurePC, fastHash, fillBuf, getAttributeCount, getAttributeName, getAttributeNamespace, getAttributePrefix, getAttributeType, getAttributeValue, getAttributeValue, getColumnNumber, getDepth, getEventType, getFeature, getInputEncoding, getLineNumber, getName, getNamespace, getNamespace, getNamespaceCount, getNamespacePrefix, getNamespaceUri, getPositionDescription, getPrefix, getProperty, getText, getTextCharacters, isAttributeDefault, isEmptyElementTag, isNameChar, isNameStartChar, isS, isWhitespace, joinPC, lookuEntityReplacement, newString, newStringIntern, next, nextTag, nextText, nextToken, parseAttribute, parseCDSect, parseComment, parseDocdecl, parseEndTag, parseEntityRef, parseEpilog, parsePI, parseProlog, parseStartTag, parseXmlDecl, parseXmlDeclWithVersion, printable, printable, require, requireInput, requireNextS, reset, resetStringCache, setFeature, setInput, setInput, setProperty, skipS, skipSubTree
    • Constructor Detail

      • MXParser

        public MXParser()
    • Method Detail

      • nextImpl

        protected int nextImpl()
                        throws org.xmlpull.v1.XmlPullParserException,
                               IOException
        Overrides:
        nextImpl in class org.xmlpull.mxp1.MXParser
        Throws:
        org.xmlpull.v1.XmlPullParserException
        IOException
      • getLastHeartbeat

        public long getLastHeartbeat()
        Returns the last time a heartbeat was received. Hearbeats are represented as whitespaces or \n characters received when an XmlPullParser.END_TAG was parsed. Note that we can falsely detect heartbeats when parsing XHTML content but that is fine.
        Returns:
        the time in milliseconds when a heartbeat was received.
      • resetInput

        public void resetInput()
      • more

        protected char more()
                     throws IOException,
                            org.xmlpull.v1.XmlPullParserException
        Makes sure that each individual character is a valid XML character. Note that when MXParser is being modified to handle multibyte chars correctly, this method needs to change (as then, there are more codepoints to check).
        Overrides:
        more in class org.xmlpull.mxp1.MXParser
        Throws:
        IOException
        org.xmlpull.v1.XmlPullParserException