Class Stax2EventAllocatorImpl

  • All Implemented Interfaces:
    javax.xml.stream.util.XMLEventAllocator, javax.xml.stream.XMLStreamConstants

    public class Stax2EventAllocatorImpl
    extends java.lang.Object
    implements javax.xml.stream.util.XMLEventAllocator, javax.xml.stream.XMLStreamConstants
    Base implementation of XMLEventAllocator, to be used either as is, or as a base for more specialized Stax2 event allocator implementation.
    • Field Summary

      • Fields inherited from interface javax.xml.stream.XMLStreamConstants

        ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      javax.xml.stream.events.XMLEvent allocate​(javax.xml.stream.XMLStreamReader r)  
      void allocate​(javax.xml.stream.XMLStreamReader r, javax.xml.stream.util.XMLEventConsumer consumer)  
      protected javax.xml.stream.events.DTD createDTD​(javax.xml.stream.XMLStreamReader r, javax.xml.stream.Location loc)  
      protected javax.xml.stream.events.EntityReference createEntityReference​(javax.xml.stream.XMLStreamReader r, javax.xml.stream.Location loc)  
      protected javax.xml.stream.events.StartElement createStartElement​(javax.xml.stream.XMLStreamReader r, javax.xml.stream.Location loc)  
      protected javax.xml.stream.Location getLocation​(javax.xml.stream.XMLStreamReader r)
      Method used to get the Location object to use for an event to create.
      javax.xml.stream.util.XMLEventAllocator newInstance()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Stax2EventAllocatorImpl

        public Stax2EventAllocatorImpl()
    • Method Detail

      • allocate

        public javax.xml.stream.events.XMLEvent allocate​(javax.xml.stream.XMLStreamReader r)
                                                  throws javax.xml.stream.XMLStreamException
        Specified by:
        allocate in interface javax.xml.stream.util.XMLEventAllocator
        Throws:
        javax.xml.stream.XMLStreamException
      • allocate

        public void allocate​(javax.xml.stream.XMLStreamReader r,
                             javax.xml.stream.util.XMLEventConsumer consumer)
                      throws javax.xml.stream.XMLStreamException
        Specified by:
        allocate in interface javax.xml.stream.util.XMLEventAllocator
        Throws:
        javax.xml.stream.XMLStreamException
      • newInstance

        public javax.xml.stream.util.XMLEventAllocator newInstance()
        Specified by:
        newInstance in interface javax.xml.stream.util.XMLEventAllocator
      • getLocation

        protected javax.xml.stream.Location getLocation​(javax.xml.stream.XMLStreamReader r)
        Method used to get the Location object to use for an event to create. Base implementation just calls stream reader's accessors, but sub-classes may choose to use other methods (esp. when not in "preserve location" mode).
      • createEntityReference

        protected javax.xml.stream.events.EntityReference createEntityReference​(javax.xml.stream.XMLStreamReader r,
                                                                                javax.xml.stream.Location loc)
                                                                         throws javax.xml.stream.XMLStreamException
        Throws:
        javax.xml.stream.XMLStreamException
      • createDTD

        protected javax.xml.stream.events.DTD createDTD​(javax.xml.stream.XMLStreamReader r,
                                                        javax.xml.stream.Location loc)
                                                 throws javax.xml.stream.XMLStreamException
        Throws:
        javax.xml.stream.XMLStreamException
      • createStartElement

        protected javax.xml.stream.events.StartElement createStartElement​(javax.xml.stream.XMLStreamReader r,
                                                                          javax.xml.stream.Location loc)
                                                                   throws javax.xml.stream.XMLStreamException
        Throws:
        javax.xml.stream.XMLStreamException