public abstract class XMLStreamReaderFactory extends Object
XMLStreamReader
.
This wraps XMLInputFactory
and allows us to reuse XMLStreamReader
instances
when appropriate.
Modifier and Type | Class and Description |
---|---|
static class |
XMLStreamReaderFactory.Default
Default
XMLStreamReaderFactory implementation
that can work with any XMLInputFactory . |
static class |
XMLStreamReaderFactory.NoLock
Similar to
XMLStreamReaderFactory.Default but doesn't do any synchronization. |
static interface |
XMLStreamReaderFactory.RecycleAware
Interface that can be implemented by
XMLStreamReader to
be notified when it's recycled. |
static class |
XMLStreamReaderFactory.Woodstox
Handles Woodstox's XIF but set properties to do the string interning.
|
static class |
XMLStreamReaderFactory.Zephyr
XMLStreamReaderFactory implementation for SJSXP/JAXP RI. |
Constructor and Description |
---|
XMLStreamReaderFactory() |
public static void set(XMLStreamReaderFactory f)
XMLStreamReaderFactory
instance that
the JAX-WS RI uses.public static XMLStreamReaderFactory get()
public static javax.xml.stream.XMLStreamReader create(InputSource source, boolean rejectDTDs)
public static javax.xml.stream.XMLStreamReader create(@Nullable String systemId, InputStream in, boolean rejectDTDs)
public static javax.xml.stream.XMLStreamReader create(@Nullable String systemId, InputStream in, @Nullable String encoding, boolean rejectDTDs)
public static javax.xml.stream.XMLStreamReader create(@Nullable String systemId, Reader reader, boolean rejectDTDs)
public static void recycle(javax.xml.stream.XMLStreamReader r)
XMLStreamReader
.
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 invked by multiple threads concurrently.
r
- The XMLStreamReader
instance that the caller finished using.
This could be any XMLStreamReader
implementation, not just
the ones that were created from this factory. So the implementation
of this class needs to be aware of that.public abstract javax.xml.stream.XMLStreamReader doCreate(String systemId, InputStream in, boolean rejectDTDs)
public abstract javax.xml.stream.XMLStreamReader doCreate(String systemId, Reader reader, boolean rejectDTDs)
public abstract void doRecycle(javax.xml.stream.XMLStreamReader r)
Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.