org.codehaus.stax2.ri.evt
Class Stax2EventAllocatorImpl

java.lang.Object
  extended by org.codehaus.stax2.ri.evt.Stax2EventAllocatorImpl
All Implemented Interfaces:
XMLEventAllocator, XMLStreamConstants

public class Stax2EventAllocatorImpl
extends Object
implements XMLEventAllocator, 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
 
Constructor Summary
Stax2EventAllocatorImpl()
           
 
Method Summary
 XMLEvent allocate(XMLStreamReader r)
           
 void allocate(XMLStreamReader r, XMLEventConsumer consumer)
           
protected  DTD createDTD(XMLStreamReader r, Location loc)
           
protected  EntityReference createEntityReference(XMLStreamReader r, Location loc)
           
protected  StartElement createStartElement(XMLStreamReader r, Location loc)
           
protected  Location getLocation(XMLStreamReader r)
          Method used to get the Location object to use for an event to create.
 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 XMLEvent allocate(XMLStreamReader r)
                  throws XMLStreamException
Specified by:
allocate in interface XMLEventAllocator
Throws:
XMLStreamException

allocate

public void allocate(XMLStreamReader r,
                     XMLEventConsumer consumer)
              throws XMLStreamException
Specified by:
allocate in interface XMLEventAllocator
Throws:
XMLStreamException

newInstance

public XMLEventAllocator newInstance()
Specified by:
newInstance in interface XMLEventAllocator

getLocation

protected Location getLocation(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 EntityReference createEntityReference(XMLStreamReader r,
                                                Location loc)
                                         throws XMLStreamException
Throws:
XMLStreamException

createDTD

protected DTD createDTD(XMLStreamReader r,
                        Location loc)
                 throws XMLStreamException
Throws:
XMLStreamException

createStartElement

protected StartElement createStartElement(XMLStreamReader r,
                                          Location loc)
                                   throws XMLStreamException
Throws:
XMLStreamException