Package org.simpleframework.xml.stream
Class PullProvider
java.lang.Object
org.simpleframework.xml.stream.PullProvider
- All Implemented Interfaces:
Provider
The
PullProvider
class is used to provide an event
reader that uses the XML pull API available on Google Android. It
provides the best performance on Android as it avoids having to
build a full DOM model. The EventReader
produced by
this provider will have full namespace capabilities and also has
line numbers available for each of the events that are extracted.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.xmlpull.v1.XmlPullParserFactory
This is used to create a new XML pull parser for the reader. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprovide
(InputStream source) This provides anEventReader
that will read from the specified input stream.This provides anEventReader
that will read from the specified reader.
-
Field Details
-
factory
private final org.xmlpull.v1.XmlPullParserFactory factoryThis is used to create a new XML pull parser for the reader.
-
-
Constructor Details
-
PullProvider
Constructor for thePullProvider
object. This will instantiate a namespace aware pull parser factory that will be used to parse the XML documents that are read by the framework. If XML pull is not available this will fail.- Throws:
Exception
-
-
Method Details
-
provide
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. -
provide
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.
-