Package com.sun.xml.ws.api.streaming
Class XMLStreamReaderFactory
- java.lang.Object
-
- com.sun.xml.ws.api.streaming.XMLStreamReaderFactory
-
- Direct Known Subclasses:
FastInfosetStreamReaderFactory,XMLStreamReaderFactory.Default,XMLStreamReaderFactory.NoLock
public abstract class XMLStreamReaderFactory extends Object
Factory forXMLStreamReader.This wraps
XMLInputFactoryand allows us to reuseXMLStreamReaderinstances when appropriate.- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classXMLStreamReaderFactory.DefaultDefaultXMLStreamReaderFactoryimplementation that can work with anyXMLInputFactory.static classXMLStreamReaderFactory.NoLockSimilar toXMLStreamReaderFactory.Defaultbut doesn't do any synchronization.static interfaceXMLStreamReaderFactory.RecycleAwareInterface that can be implemented byXMLStreamReaderto be notified when it's recycled.static classXMLStreamReaderFactory.WoodstoxHandles Woodstox's XIF, but sets properties to do the string interning, sets various limits, ...
-
Constructor Summary
Constructors Constructor Description XMLStreamReaderFactory()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static XMLStreamReadercreate(String systemId, InputStream in, boolean rejectDTDs)static XMLStreamReadercreate(String systemId, InputStream in, String encoding, boolean rejectDTDs)static XMLStreamReadercreate(String systemId, Reader reader, boolean rejectDTDs)static XMLStreamReadercreate(InputSource source, boolean rejectDTDs)abstract XMLStreamReaderdoCreate(String systemId, InputStream in, boolean rejectDTDs)abstract XMLStreamReaderdoCreate(String systemId, Reader reader, boolean rejectDTDs)abstract voiddoRecycle(XMLStreamReader r)static XMLStreamReaderFactoryget()static voidrecycle(XMLStreamReader r)Should be invoked when the code finished using anXMLStreamReader.static voidset(XMLStreamReaderFactory f)Overrides the singletonXMLStreamReaderFactoryinstance that the JAX-WS RI uses.
-
-
-
Method Detail
-
set
public static void set(XMLStreamReaderFactory f)
Overrides the singletonXMLStreamReaderFactoryinstance that the JAX-WS RI uses.
-
get
public static XMLStreamReaderFactory get()
-
create
public static XMLStreamReader create(InputSource source, boolean rejectDTDs)
-
create
public static XMLStreamReader create(@Nullable String systemId, InputStream in, boolean rejectDTDs)
-
create
public static XMLStreamReader create(@Nullable String systemId, InputStream in, @Nullable String encoding, boolean rejectDTDs)
-
create
public static XMLStreamReader create(@Nullable String systemId, Reader reader, boolean rejectDTDs)
-
recycle
public static void recycle(XMLStreamReader r)
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
XMLStreamReaderinstance. 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- TheXMLStreamReaderinstance that the caller finished using. This could be anyXMLStreamReaderimplementation, not just the ones that were created from this factory. So the implementation of this class needs to be aware of that.
-
doCreate
public abstract XMLStreamReader doCreate(String systemId, InputStream in, boolean rejectDTDs)
-
doCreate
public abstract XMLStreamReader doCreate(String systemId, Reader reader, boolean rejectDTDs)
-
doRecycle
public abstract void doRecycle(XMLStreamReader r)
-
-