public final class EventAllocatorImpl
extends org.codehaus.stax2.ri.evt.Stax2EventAllocatorImpl
Modifier and Type | Field and Description |
---|---|
protected boolean |
_cfgPreserveLocation |
protected javax.xml.stream.Location |
_lastLocation
Last used location info; only relevant to non-accurate-location
allocators.
|
(package private) static EventAllocatorImpl |
sStdInstance |
Modifier | Constructor and Description |
---|---|
protected |
EventAllocatorImpl(boolean preserveLocation) |
Modifier and Type | Method and Description |
---|---|
javax.xml.stream.events.XMLEvent |
allocate(javax.xml.stream.XMLStreamReader r) |
static EventAllocatorImpl |
getDefaultInstance() |
static EventAllocatorImpl |
getFastInstance() |
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()
Default implementation assumes that the caller knows how to
share instances, and so need not create new copies.
|
static final EventAllocatorImpl sStdInstance
protected final boolean _cfgPreserveLocation
protected javax.xml.stream.Location _lastLocation
protected EventAllocatorImpl(boolean preserveLocation)
preserveLocation
- If true, allocator will construct instances
that have accurate location information; if false, instances
will only have some generic shared Location info. Latter option
will reduce memory usage/thrashing a bit, and may improve speed.public static EventAllocatorImpl getDefaultInstance()
public static EventAllocatorImpl getFastInstance()
public javax.xml.stream.util.XMLEventAllocator newInstance()
Note: if this class is sub-classes, this method should be redefined if assumptions about shareability do not hold.
newInstance
in interface javax.xml.stream.util.XMLEventAllocator
newInstance
in class org.codehaus.stax2.ri.evt.Stax2EventAllocatorImpl
public javax.xml.stream.events.XMLEvent allocate(javax.xml.stream.XMLStreamReader r) throws javax.xml.stream.XMLStreamException
allocate
in interface javax.xml.stream.util.XMLEventAllocator
allocate
in class org.codehaus.stax2.ri.evt.Stax2EventAllocatorImpl
javax.xml.stream.XMLStreamException
protected javax.xml.stream.Location getLocation(javax.xml.stream.XMLStreamReader r)
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).getLocation
in class org.codehaus.stax2.ri.evt.Stax2EventAllocatorImpl