Package org.simpleframework.xml.stream
Class DocumentProvider
- java.lang.Object
-
- org.simpleframework.xml.stream.DocumentProvider
-
- All Implemented Interfaces:
Provider
class DocumentProvider extends java.lang.Object implements Provider
TheDocumentProviderobject is used to provide event reader implementations for DOM. Wrapping the mechanics of the DOM framework within aProviderensures that it can be plugged in without any dependencies. This allows other parsers to be swapped in should there be such a requirement.- See Also:
DocumentProvider
-
-
Field Summary
Fields Modifier and Type Field Description private javax.xml.parsers.DocumentBuilderFactoryfactoryThis is the factory that is used to create DOM parsers.
-
Constructor Summary
Constructors Constructor Description DocumentProvider()Constructor for theDocumentProviderobject.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EventReaderprovide(java.io.InputStream source)This provides anEventReaderthat will read from the specified input stream.EventReaderprovide(java.io.Reader source)This provides anEventReaderthat will read from the specified reader.private EventReaderprovide(org.xml.sax.InputSource source)This provides anEventReaderthat will read from the specified source.
-
-
-
Method Detail
-
provide
public EventReader provide(java.io.InputStream source) throws java.lang.Exception
This provides anEventReaderthat will read from the specified input stream. When reading from an input stream the character encoding should be taken from the XML prolog or it should default to the UTF-8 character encoding.
-
provide
public EventReader provide(java.io.Reader source) throws java.lang.Exception
This provides anEventReaderthat will read from the specified reader. When reading from a reader the character encoding should be the same as the source XML document.
-
provide
private EventReader provide(org.xml.sax.InputSource source) throws java.lang.Exception
This provides anEventReaderthat will read from the specified source. When reading from a source the character encoding should be the same as the source XML document.- Parameters:
source- this is the source to read the document with- Returns:
- this is used to return the event reader implementation
- Throws:
java.lang.Exception
-
-