org.gjt.xpp

Class XmlPullParserFactory

public class XmlPullParserFactory extends Object

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).

Author: Aleksander Slominski

See Also: XmlPullParser

Field Summary
static StringDEFAULT_PROPERTY_NAME
Constructor Summary
protected XmlPullParserFactory()
Proteted constructor to be called by factory implementations.
Method Summary
booleanisNamespaceAware()
Indicates whether or not the factory is configured to produce parsers which are namespace aware.
XmlEndTagnewEndTag()
Create new end tag.
XmlFormatternewFormatter()
Return new XML formatter.
static XmlPullParserFactorynewInstance()
Get a new instance of a PullParserFactory used to create XPP.
static XmlPullParserFactorynewInstance(String factoryClassName)
Get a new instance of a PullParserFactory from given class name.
static XmlPullParserFactorynewInstance(Class classLoaderCtx)
Get a new instance of a PullParserFactory used to create XPP.
XmlNodenewNode()
Return new XML node.
XmlNodenewNode(XmlPullParser pp)
Return new XML node that is represeting tree from current pull parser start tag.
XmlPullNodenewPullNode(XmlPullParser pp)
Return new XML pull node that is represeting tree from current pull parser start tag.
XmlPullParsernewPullParser()
Create new XML pull parser.
XmlRecordernewRecorder()
Return new XML recorder.
XmlStartTagnewStartTag()
Return new XML start tag.
XmlNodereadNode(Reader reader, boolean closeAtEnd)
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.
XmlNodereadNode(Reader reader)
Equivalent to calling readNode(reader, false);
voidsetNamespaceAware(boolean awareness)
Specifies that the parser produced by this factory will provide support for XML namespaces.
voidwriteNode(XmlNode node, Writer writer, boolean closeAtEnd)
voidwriteNode(XmlNode node, Writer writer)
Equivalent to calling writeNode(node, writer, false);

Field Detail

DEFAULT_PROPERTY_NAME

public static final String DEFAULT_PROPERTY_NAME

Constructor Detail

XmlPullParserFactory

protected XmlPullParserFactory()
Proteted constructor to be called by factory implementations.

Method Detail

isNamespaceAware

public boolean isNamespaceAware()
Indicates whether or not the factory is configured to produce parsers which are namespace aware.

Returns: true if the factory is configured to produce parsers which are namespace aware; false otherwise.

newEndTag

public XmlEndTag newEndTag()
Create new end tag.

newFormatter

public XmlFormatter newFormatter()
Return new XML formatter.

newInstance

public static XmlPullParserFactory newInstance()
Get a new instance of a PullParserFactory used to create XPP.

newInstance

public static XmlPullParserFactory newInstance(String factoryClassName)
Get a new instance of a PullParserFactory from given class name.

Parameters: factoryClassName use specified factory class if not null

newInstance

public static XmlPullParserFactory newInstance(Class classLoaderCtx)
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).

Parameters: classLoaderCtx if not null it is used to find default factory and to create instance

newNode

public XmlNode newNode()
Return new XML node.

newNode

public XmlNode newNode(XmlPullParser pp)
Return new XML node that is represeting tree from current pull parser start tag.

newPullNode

public XmlPullNode newPullNode(XmlPullParser pp)
Return new XML pull node that is represeting tree from current pull parser start tag.

newPullParser

public XmlPullParser newPullParser()
Create new XML pull parser.

newRecorder

public XmlRecorder newRecorder()
Return new XML recorder.

newStartTag

public XmlStartTag newStartTag()
Return new XML start tag.

readNode

public XmlNode readNode(Reader reader, boolean closeAtEnd)
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

readNode

public XmlNode readNode(Reader reader)
Equivalent to calling readNode(reader, false);

setNamespaceAware

public void setNamespaceAware(boolean awareness)
Specifies that the parser produced by this factory will provide support for XML namespaces. By default the value of this is set to false.

Parameters: 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, boolean closeAtEnd)

writeNode

public void writeNode(XmlNode node, Writer writer)
Equivalent to calling writeNode(node, writer, false);
Copyright (c) 2003 IU Extreme! Lab http://www.extreme.indiana.edu/ All Rights Reserved.

Note this package is deprecated by XPP3 that implements XmlPull API