Class DefaultEventAllocator

java.lang.Object
com.ctc.wstx.sr.ElemCallback
com.ctc.wstx.evt.DefaultEventAllocator
All Implemented Interfaces:
XMLEventAllocator, XMLStreamConstants

public class DefaultEventAllocator extends ElemCallback implements XMLEventAllocator, XMLStreamConstants
Straight-forward implementation of XMLEventAllocator, to be used with Woodstox' event reader.

One of few complications here is the way start elements are constructed. The pattern used is double-indirection, needed to get a callback from the stream reader, with data we need for constructing even Object... but without stream reader having any understanding of event Objects per se.

03-Dec-2004, TSa: One additional twist is that it's now possible to create slightly faster event handling, by indicating that the fully accurate Location information is not necessary. If so, allocator will just use one shared Location object passed to all event objects constructed.