|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Generic interface for simple and quick XML Pull Parser.
XmlPullParserFactory
Field Summary | |
static byte |
CONTENT
element content was just read |
static byte |
END_DOCUMENT
signal logical end of xml document |
static byte |
END_TAG
end tag was just read |
static byte |
START_TAG
start tag was just read |
Method Summary | |
int |
getColumnNumber()
|
int |
getContentLength()
Return how big is content. |
int |
getDepth()
Returns the current depth of the element. |
byte |
getEventType()
Returns the type of the current element (START_TAG, END_TAG, CONTENT, etc) |
int |
getLineNumber()
|
java.lang.String |
getLocalName()
Returns the local name of the current element (current event must be START_TAG or END_TAG) |
int |
getNamespacesLength(int depth)
|
java.lang.String |
getNamespaceUri()
Returns the namespace URI of the current element Returns null if not applicable (current event must be START_TAG or END_TAG) |
java.lang.String |
getPosDesc()
|
java.lang.String |
getPrefix()
Returns the prefix of the current element or null if elemet has no prefix. |
java.lang.String |
getQNameLocal(java.lang.String qName)
Return local part of qname. |
java.lang.String |
getQNameUri(java.lang.String qName)
Return uri part of qname. |
java.lang.String |
getRawName()
Returns the raw name (prefix + ':' + localName) of the current element (current event must be START_TAG or END_TAG) |
boolean |
isAllowedMixedContent()
Is mixed element context allowed? |
boolean |
isNamespaceAttributesReporting()
Is parser going to report namespace attributes (xmlns*) ? |
boolean |
isNamespaceAware()
Is parser namespace aware? |
boolean |
isWhitespaceContent()
Check if last CONTENT contained only whitespace characters. |
byte |
next()
Get next parsing event. |
java.lang.String |
readContent()
Read current content as Stirng. |
void |
readEndTag(XmlEndTag etag)
Read current end tag. |
void |
readNamespacesPrefixes(int depth,
java.lang.String[] prefixes,
int off,
int len)
Return namespace prefixes for element at depth |
void |
readNamespacesUris(int depth,
java.lang.String[] uris,
int off,
int len)
Return namespace URIs for element at depth |
byte |
readNode(XmlNode node)
Read subtree into node: call readNodeWithoutChildren and then parse subtree adding children (values obtained with readXontent or readNodeWithoutChildren). |
void |
readNodeWithoutChildren(XmlNode node)
Read node: it calls readStartTag and then if parser is namespaces aware currently declared nemaspeces will be added and defaultNamespace will be set. |
void |
readStartTag(XmlStartTag stag)
Read current start tag. |
void |
reset()
Reset the parser state. |
void |
setAllowedMixedContent(boolean enable)
Allow for mixed element content. |
void |
setInput(char[] buf)
Set the input for parser. |
void |
setInput(char[] buf,
int off,
int len)
Set the input for parser. |
void |
setInput(java.io.Reader in)
Set the input for parser. |
void |
setNamespaceAttributesReporting(boolean enable)
Make parser to report xmlns* attributes. |
void |
setNamespaceAware(boolean enable)
Indicate that the parser understands XML Namespaces |
byte |
skipNode()
Goes directly to the next sibling |
Field Detail |
public static final byte END_DOCUMENT
public static final byte START_TAG
public static final byte END_TAG
public static final byte CONTENT
Method Detail |
public void setInput(java.io.Reader in) throws XmlPullParserException
XmlPullParserException
public void setInput(char[] buf) throws XmlPullParserException
XmlPullParserException
public void setInput(char[] buf, int off, int len) throws XmlPullParserException
XmlPullParserException
public void reset() throws XmlPullParserException
XmlPullParserException
public boolean isAllowedMixedContent()
public void setAllowedMixedContent(boolean enable) throws XmlPullParserException
NOTE: this is not resetable parameter.
XmlPullParserException
public boolean isNamespaceAware()
public void setNamespaceAware(boolean enable) throws XmlPullParserException
NOTE: this is not resetable parameter.
XmlPullParserException
public boolean isNamespaceAttributesReporting()
public void setNamespaceAttributesReporting(boolean enable) throws XmlPullParserException
XmlPullParserException
public java.lang.String getNamespaceUri()
public java.lang.String getLocalName()
public java.lang.String getPrefix()
public java.lang.String getRawName()
public java.lang.String getQNameLocal(java.lang.String qName) throws XmlPullParserException
XmlPullParserException
public java.lang.String getQNameUri(java.lang.String qName) throws XmlPullParserException
XmlPullParserException
public int getDepth()
public int getNamespacesLength(int depth)
public void readNamespacesPrefixes(int depth, java.lang.String[] prefixes, int off, int len) throws XmlPullParserException
XmlPullParserException
public void readNamespacesUris(int depth, java.lang.String[] uris, int off, int len) throws XmlPullParserException
XmlPullParserException
public java.lang.String getPosDesc()
public int getLineNumber()
public int getColumnNumber()
public byte next() throws XmlPullParserException, java.io.IOException
NOTE: empty element (such as <tag/>) will be reported with just two events: START_TAG, END_TAG - it must be so to preserve parsing equivalency of empty element to <tag></tag>.
XmlPullParserException
java.io.IOException
public byte getEventType() throws XmlPullParserException
XmlPullParserException
public boolean isWhitespaceContent() throws XmlPullParserException
XmlPullParserException
public int getContentLength() throws XmlPullParserException
NOTE: parser must be on CONTENT event.
XmlPullParserException
public java.lang.String readContent() throws XmlPullParserException
NOTE: parser must be on CONTENT event.
XmlPullParserException
public void readEndTag(XmlEndTag etag) throws XmlPullParserException
NOTE: parser must be on END_TAG event.
XmlPullParserException
public void readStartTag(XmlStartTag stag) throws XmlPullParserException
NOTE: parser must be on START_TAG event.
XmlPullParserException
public void readNodeWithoutChildren(XmlNode node) throws XmlPullParserException
NOTE: parser must be on START_TAG event. and all events will written into node!
XmlPullParserException
public byte readNode(XmlNode node) throws XmlPullParserException, java.io.IOException
NOTE: parser must be on START_TAG event. and all events will written into node!
XmlPullParserException
java.io.IOException
public byte skipNode() throws XmlPullParserException, java.io.IOException
NOTE: parser must be on START_TAG event. and all intermittent events will be lost!
XmlPullParserException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |