|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.xml.fastinfoset.stax.events.StAXEventAllocatorBase
public class StAXEventAllocatorBase
allows a user to register a way to allocate events given an XMLStreamReader. The XMLEventAllocator can be set on an XMLInputFactory using the property "javax.xml.stream.allocator" This base class uses EventFactory to create events as recommended in the JavaDoc of XMLEventAllocator. However, creating new object per each event reduces performance. The implementation of EventReader therefore will set the Allocator to StAXEventAllocator which implements the Allocate methods without creating new objects. The spec for the first Allocate method states that it must NOT modify the state of the Reader while the second MAY. For consistency, both Allocate methods in this implementation will NOT modify the state.
Constructor Summary | |
---|---|
StAXEventAllocatorBase()
Creates a new instance of XMLEventAllocator |
Method Summary | |
---|---|
protected void |
addAttributes(StartElementEvent event,
javax.xml.stream.XMLStreamReader streamReader)
|
protected void |
addNamespaces(EndElementEvent event,
javax.xml.stream.XMLStreamReader streamReader)
|
protected void |
addNamespaces(StartElementEvent event,
javax.xml.stream.XMLStreamReader streamReader)
|
javax.xml.stream.events.XMLEvent |
allocate(javax.xml.stream.XMLStreamReader streamReader)
This method allocates an event given the current state of the XMLStreamReader. |
void |
allocate(javax.xml.stream.XMLStreamReader streamReader,
javax.xml.stream.util.XMLEventConsumer consumer)
This method allocates an event or set of events given the current state of the XMLStreamReader and adds the event or set of events to the consumer that was passed in. |
javax.xml.stream.util.XMLEventAllocator |
newInstance()
This method creates an instance of the XMLEventAllocator. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StAXEventAllocatorBase()
Method Detail |
---|
public javax.xml.stream.util.XMLEventAllocator newInstance()
newInstance
in interface javax.xml.stream.util.XMLEventAllocator
public javax.xml.stream.events.XMLEvent allocate(javax.xml.stream.XMLStreamReader streamReader) throws javax.xml.stream.XMLStreamException
allocate
in interface javax.xml.stream.util.XMLEventAllocator
streamReader
- The XMLStreamReader to allocate from
javax.xml.stream.XMLStreamException
public void allocate(javax.xml.stream.XMLStreamReader streamReader, javax.xml.stream.util.XMLEventConsumer consumer) throws javax.xml.stream.XMLStreamException
allocate
in interface javax.xml.stream.util.XMLEventAllocator
streamReader
- The XMLStreamReader to allocate fromconsumer
- The XMLEventConsumer to add to.
javax.xml.stream.XMLStreamException
protected void addAttributes(StartElementEvent event, javax.xml.stream.XMLStreamReader streamReader)
protected void addNamespaces(StartElementEvent event, javax.xml.stream.XMLStreamReader streamReader)
protected void addNamespaces(EndElementEvent event, javax.xml.stream.XMLStreamReader streamReader)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |