This class is used to create implementations of XML Pull Parser.
Based on JAXP ideas but tailored to work in J2ME environments
(no access to system properties or file system).
isNamespaceAware
public boolean isNamespaceAware()
Indicates whether or not the factory is configured to produce
parsers which are namespace aware.
- true if the factory is configured to produce parsers
which are namespace aware; false otherwise.
newInstance
public static XmlPullParserFactory newInstance(Class classLoaderCtx)
throws XmlPullParserException
Get a new instance of a PullParserFactory used to create XPP.
NOTE: passing classLoaderCtx is not very useful in ME
but can be useful in container environment where
multiple class loaders are used
(it is using Class as ClassLoader is not in ME profile).
classLoaderCtx
- if not null it is used to find
default factory and to create instance
newInstance
public static XmlPullParserFactory newInstance(String factoryClassName)
throws XmlPullParserException
Get a new instance of a PullParserFactory from given class name.
factoryClassName
- use specified factory class if not null
readNode
public XmlNode readNode(Reader reader,
boolean closeAtEnd)
throws XmlPullParserException,
IOException
Read XmlNode from input - essentially it is utility function that
will create instance of pull parser, feed input inpt it and
return new node tree parsed form the input.
If closeAtEnd is true clos() will be called on reader
setNamespaceAware
public void setNamespaceAware(boolean awareness)
throws XmlPullParserException
Specifies that the parser produced by this factory will provide
support for XML namespaces.
By default the value of this is set to false.
awareness
- true if the parser produced by this code
will provide support for XML namespaces; false otherwise.
writeNode
public void writeNode(XmlNode node,
Writer writer)
throws XmlPullParserException,
IOException
Equivalent to calling writeNode(node, writer, false);