java.lang.Object
com.sun.xml.ws.api.streaming.XMLStreamReaderFactory
- Direct Known Subclasses:
FastInfosetStreamReaderFactory
,XMLStreamReaderFactory.Default
,XMLStreamReaderFactory.NoLock
Factory for
XMLStreamReader
.
This wraps XMLInputFactory
and allows us to reuse XMLStreamReader
instances
when appropriate.
- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
DefaultXMLStreamReaderFactory
implementation that can work with anyXMLInputFactory
.static class
Similar toXMLStreamReaderFactory.Default
but doesn't do any synchronization.static interface
Interface that can be implemented byXMLStreamReader
to be notified when it's recycled.static final class
Handles Woodstox's XIF, but sets properties to do the string interning, sets various limits, ... -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic XMLStreamReader
create
(String systemId, InputStream in, boolean rejectDTDs) static XMLStreamReader
create
(String systemId, InputStream in, String encoding, boolean rejectDTDs) static XMLStreamReader
static XMLStreamReader
create
(InputSource source, boolean rejectDTDs) abstract XMLStreamReader
doCreate
(String systemId, InputStream in, boolean rejectDTDs) abstract XMLStreamReader
abstract void
static XMLStreamReaderFactory
get()
static void
Should be invoked when the code finished using anXMLStreamReader
.static void
Overrides the singletonXMLStreamReaderFactory
instance that the JAX-WS RI uses.
-
Constructor Details
-
XMLStreamReaderFactory
protected XMLStreamReaderFactory()Default constructor.
-
-
Method Details
-
set
Overrides the singletonXMLStreamReaderFactory
instance that the JAX-WS RI uses. -
get
-
create
-
create
-
create
public static XMLStreamReader create(@Nullable String systemId, InputStream in, @Nullable String encoding, boolean rejectDTDs) -
create
-
recycle
Should be invoked when the code finished using anXMLStreamReader
.If the recycled instance implements
XMLStreamReaderFactory.RecycleAware
,XMLStreamReaderFactory.RecycleAware.onRecycled()
will be invoked to let the instance know that it's being recycled.It is not a hard requirement to call this method on every
XMLStreamReader
instance. Not doing so just reduces the performance by throwing away possibly reusable instances. So the caller should always consider the effort it takes to recycle vs the possible performance gain by doing so.This method may be invoked by multiple threads concurrently.
- Parameters:
r
- TheXMLStreamReader
instance that the caller finished using. This could be anyXMLStreamReader
implementation, not just the ones that were created from this factory. So the implementation of this class needs to be aware of that.
-
doCreate
-
doCreate
-
doRecycle
-