Class AbstractXMLEventParser

    • Field Detail

      • CHARACTERS_CONTENT

        protected static final java.lang.String CHARACTERS_CONTENT
        See Also:
        Constant Field Values
      • namespaceURI

        protected java.lang.String namespaceURI
      • fields

        protected AVList fields
    • Constructor Detail

      • AbstractXMLEventParser

        public AbstractXMLEventParser()
        Construct a parser with no qualifying namespace.
      • AbstractXMLEventParser

        public AbstractXMLEventParser​(java.lang.String namespaceURI)
        Constructs a parser and qualifies it for a specified namespace.
        Parameters:
        namespaceURI - the qualifying namespace URI. May be null to indicate no namespace qualification.
    • Method Detail

      • getNamespaceURI

        public java.lang.String getNamespaceURI()
        Returns the qualifying namespace URI specified at construction.
        Returns:
        the namespace URI. Returns null if no name space was specified at construction.
      • setNamespaceURI

        protected void setNamespaceURI​(java.lang.String namespaceURI)
      • newInstance

        public XMLEventParser newInstance()
                                   throws java.lang.Exception
        Description copied from interface: XMLEventParser
        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.
        Specified by:
        newInstance in interface XMLEventParser
        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.
      • setField

        public void setField​(javax.xml.namespace.QName keyName,
                             java.lang.Object value)
      • setField

        public void setField​(java.lang.String keyName,
                             java.lang.Object value)
      • setFields

        public void setFields​(java.util.Map<java.lang.String,​java.lang.Object> newFields)
      • getField

        public java.lang.Object getField​(javax.xml.namespace.QName keyName)
      • getField

        public java.lang.Object getField​(java.lang.String keyName)
      • hasField

        public boolean hasField​(javax.xml.namespace.QName keyName)
      • hasField

        public boolean hasField​(java.lang.String keyName)
      • removeField

        public void removeField​(java.lang.String keyName)
      • hasFields

        public boolean hasFields()
      • getFields

        public AVList getFields()
      • setParent

        public void setParent​(XMLEventParser parent)
        Description copied from interface: XMLEventParser
        Specifies the parent parser of this parser.
        Specified by:
        setParent in interface XMLEventParser
        Parameters:
        parent - this parser's parent parser.
      • freeResources

        public void freeResources()
        Description copied from interface: XMLEventParser
        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.
        Specified by:
        freeResources in interface XMLEventParser
      • getAConstructor

        protected java.lang.reflect.Constructor<? extends AbstractXMLEventParser> getAConstructor​(java.lang.Class... parameterTypes)
      • allocate

        public XMLEventParser allocate​(XMLEventParserContext ctx,
                                       javax.xml.stream.events.XMLEvent event)
        Create a parser for a specified event.
        Parameters:
        ctx - the current parser context.
        event - the event for which the parser is created. Only the event type is used; the new parser can operate on any event of that type.
        Returns:
        the new parser.
      • parse

        public java.lang.Object parse​(XMLEventParserContext ctx,
                                      javax.xml.stream.events.XMLEvent inputEvent,
                                      java.lang.Object... args)
                               throws javax.xml.stream.XMLStreamException
        Parse the event and initialize the parser's values to those found in the event.
        Specified by:
        parse in interface XMLEventParser
        Parameters:
        ctx - a current parser context.
        inputEvent - 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.
      • doAddCharacters

        protected void doAddCharacters​(XMLEventParserContext ctx,
                                       javax.xml.stream.events.XMLEvent event,
                                       java.lang.Object... args)
      • getCharacters

        public java.lang.String getCharacters()
      • doParseEventContent

        protected void doParseEventContent​(XMLEventParserContext ctx,
                                           javax.xml.stream.events.XMLEvent event,
                                           java.lang.Object... args)
                                    throws javax.xml.stream.XMLStreamException
        Parse an event's sub-elements.
        Parameters:
        ctx - a current parser context.
        event - the event to parse.
        args - an optional list of arguments that may by used by subclasses.
        Throws:
        javax.xml.stream.XMLStreamException - if an exception occurs during event-stream reading.
      • doAddEventContent

        protected void doAddEventContent​(java.lang.Object o,
                                         XMLEventParserContext ctx,
                                         javax.xml.stream.events.XMLEvent event,
                                         java.lang.Object... args)
                                  throws javax.xml.stream.XMLStreamException
        Throws:
        javax.xml.stream.XMLStreamException
      • doParseEventAttributes

        protected void doParseEventAttributes​(XMLEventParserContext ctx,
                                              javax.xml.stream.events.XMLEvent event,
                                              java.lang.Object... args)
                                       throws javax.xml.stream.XMLStreamException
        Parse an event's attributes.
        Parameters:
        ctx - a current parser context.
        event - the event to parse.
        args - an optional list of arguments that may by used by subclasses.
        Throws:
        javax.xml.stream.XMLStreamException - if an exception occurs during event-stream reading.
      • doAddEventAttribute

        protected void doAddEventAttribute​(javax.xml.stream.events.Attribute attr,
                                           XMLEventParserContext ctx,
                                           javax.xml.stream.events.XMLEvent event,
                                           java.lang.Object... args)
                                    throws javax.xml.stream.XMLStreamException
        Throws:
        javax.xml.stream.XMLStreamException
      • parseCharacterContent

        protected java.lang.String parseCharacterContent​(XMLEventParserContext ctx,
                                                         javax.xml.stream.events.XMLEvent stringEvent,
                                                         java.lang.Object... args)
                                                  throws javax.xml.stream.XMLStreamException
        Throws:
        javax.xml.stream.XMLStreamException