Package org.simpleframework.xml.stream
Interface Provider
-
- All Known Implementing Classes:
DocumentProvider
,PullProvider
,StreamProvider
interface Provider
TheProvider
object is used to represent the provider of an XML parser. All XML parsers are represented as an event reader much like the StAX event reader. Providing a interface to the parser in this manner ensures that the core framework is not coupled to any specific implementation and also ensures that it should run in multiple environments that may support specific XML parsers.- See Also:
NodeBuilder
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description EventReader
provide(java.io.InputStream source)
This provides anEventReader
that will read from the specified input stream.EventReader
provide(java.io.Reader source)
This provides anEventReader
that will read from the specified reader.
-
-
-
Method Detail
-
provide
EventReader provide(java.io.InputStream source) throws java.lang.Exception
This provides anEventReader
that 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.- Parameters:
source
- this is the stream to read the document with- Returns:
- this is used to return the event reader implementation
- Throws:
java.lang.Exception
-
provide
EventReader provide(java.io.Reader source) throws java.lang.Exception
This provides anEventReader
that will read from the specified reader. When reading from a reader the character encoding should be the same as the source XML document.- Parameters:
source
- this is the reader to read the document with- Returns:
- this is used to return the event reader implementation
- Throws:
java.lang.Exception
-
-