Interface XMLEventParser

    • Method Detail

      • parse

        java.lang.Object parse​(XMLEventParserContext context,
                               javax.xml.stream.events.XMLEvent event,
                               java.lang.Object... args)
                        throws javax.xml.stream.XMLStreamException
        Parse the event and initialize the parser's values to those found in the event.
        Parameters:
        context - a current parser context.
        event - the event to parse.
        args - an optional list of arguments that may by used by subclasses.
        Returns:
        if parsing is successful, returns this, otherwise returns null.
        Throws:
        javax.xml.stream.XMLStreamException - if an exception occurs during event-stream reading.
      • newInstance

        XMLEventParser newInstance()
                            throws java.lang.Exception
        Creates a new empty parser instance of the same type. This is used by XMLEventParserContext when creating parsers associated with specific event types. The returned parser has the same namespace as the instance creating it, but has empty fields for all other values.
        Returns:
        a new parser instance. The namespace URI is the same as the creating parser, but all other fields are empty.
        Throws:
        java.lang.Exception - if an error or exception occurs while attempting to create the parser.
      • setParent

        void setParent​(XMLEventParser parent)
        Specifies the parent parser of this parser.
        Parameters:
        parent - this parser's parent parser.
      • getParent

        XMLEventParser getParent()
        Returns this parser's parent parser.
        Returns:
        this parser's parent parser.
      • freeResources

        void freeResources()
        Release large resources used by the parser, but does not dispose of the parser itself. Call this method once its data is no longer needed, such as after mappings and related representations are created. For example, if a parser holds a large number of positions, and those positions are no longer needed after the positions are converted to points or copied to other storage, this method releases the memory associated with the original positions.