public class XmlPullParserFactory extends Object
XmlPullParser| Modifier and Type | Field and Description |
|---|---|
protected String |
classNamesLocation
Unused, but we have to keep it because it's public API.
|
protected HashMap<String,Boolean> |
features |
protected ArrayList |
parserClasses |
static String |
PROPERTY_NAME |
protected ArrayList |
serializerClasses |
| Modifier | Constructor and Description |
|---|---|
protected |
XmlPullParserFactory()
Protected constructor to be called by factory implementations.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
getFeature(String name)
Return the current value of the feature with given name.
|
boolean |
isNamespaceAware()
Indicates whether or not the factory is configured to produce
parsers which are namespace aware
(it simply set feature XmlPullParser.FEATURE_PROCESS_NAMESPACES to true or false).
|
boolean |
isValidating()
Indicates whether or not the factory is configured to produce parsers
which validate the XML content during parse.
|
static XmlPullParserFactory |
newInstance()
Creates a new instance of a PullParserFactory that can be used
to create XML pull parsers.
|
static XmlPullParserFactory |
newInstance(String unused,
Class unused2)
Creates a factory that always returns instances of of
KXmlParser and
KXmlSerializer. |
XmlPullParser |
newPullParser()
Creates a new instance of a XML Pull Parser
using the currently configured factory features.
|
XmlSerializer |
newSerializer()
Creates a new instance of a XML Serializer.
|
void |
setFeature(String name,
boolean state)
Set the features to be set when XML Pull Parser is created by this factory.
|
void |
setNamespaceAware(boolean awareness)
Specifies that the parser produced by this factory will provide
support for XML namespaces.
|
void |
setValidating(boolean validating)
Specifies that the parser produced by this factory will be validating
(it simply set feature XmlPullParser.FEATURE_VALIDATION to true or false).
|
public static final String PROPERTY_NAME
protected ArrayList parserClasses
protected ArrayList serializerClasses
protected String classNamesLocation
protected XmlPullParserFactory()
public void setFeature(String name, boolean state) throws XmlPullParserException
NOTE: factory features are not used for XML Serializer.
name - string with URI identifying featurestate - if true feature will be set; if false will be ignoredXmlPullParserExceptionpublic boolean getFeature(String name)
NOTE: factory features are not used for XML Serializer.
name - The name of feature to be retrieved.public void setNamespaceAware(boolean awareness)
awareness - true if the parser produced by this code
will provide support for XML namespaces; false otherwise.public boolean isNamespaceAware()
public void setValidating(boolean validating)
validating - - if true the parsers created by this factory must be validating.public boolean isValidating()
public XmlPullParser newPullParser() throws XmlPullParserException
XmlPullParserExceptionpublic XmlSerializer newSerializer() throws XmlPullParserException
NOTE: factory features are not used for XML Serializer.
XmlPullParserException - if a parser cannot be created which satisfies the
requested configuration.public static XmlPullParserFactory newInstance() throws XmlPullParserException
KXmlParser and KXmlSerializer.XmlPullParserExceptionpublic static XmlPullParserFactory newInstance(String unused, Class unused2) throws XmlPullParserException
KXmlParser and
KXmlSerializer. This does not support factories capable of
creating arbitrary parser and serializer implementations. Both arguments to this
method are unused.XmlPullParserException