Class StAXEventAllocatorBase

java.lang.Object
com.sun.xml.fastinfoset.stax.events.StAXEventAllocatorBase
All Implemented Interfaces:
XMLEventAllocator

public class StAXEventAllocatorBase extends Object implements XMLEventAllocator
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.