public interface XmlPullParserWrapper extends XmlPullParser
| Modifier and Type | Field and Description |
|---|---|
static String |
XSD_NS |
static String |
XSI_NS |
CDSECT, COMMENT, DOCDECL, END_DOCUMENT, END_TAG, ENTITY_REF, FEATURE_PROCESS_DOCDECL, FEATURE_PROCESS_NAMESPACES, FEATURE_REPORT_NAMESPACE_ATTRIBUTES, FEATURE_VALIDATION, IGNORABLE_WHITESPACE, NO_NAMESPACE, PROCESSING_INSTRUCTION, START_DOCUMENT, START_TAG, TEXT, TYPES| Modifier and Type | Method and Description |
|---|---|
String |
getAttributeValue(String name)
Return value of attribute with given name and no namespace.
|
String |
getPIData()
Return everything past PITarget and S from Processing Instruction (PI) as defined in
XML 1.0 Section 2.6 Processing Instructions
[16] PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>' |
String |
getPITarget()
Return PITarget from Processing Instruction (PI) as defined in
XML 1.0 Section 2.6 Processing Instructions
[16] PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>' |
String |
getRequiredAttributeValue(String name)
Read attribute value and return it or throw exception if
current element does not have such attribute.
|
String |
getRequiredAttributeValue(String namespace,
String name)
Read attribute value and return it or throw exception if
current element does not have such attribute.
|
String |
getRequiredElementText(String namespace,
String name)
Read the text of a required element and return it or throw exception if
required element is not found.
|
boolean |
isNil()
Is the current tag nil? Checks for xsi:nil="true".
|
boolean |
matches(int type,
String namespace,
String name)
Tests if the current event is of the given type and if the namespace and name match.
|
void |
nextEndTag()
Call parser nextTag() and check that it is END_TAG, throw exception if not.
|
void |
nextEndTag(String name)
combine nextTag(); pp.require(XmlPullParser.END_TAG, null, name);
|
void |
nextEndTag(String namespace,
String name)
combine nextTag(); pp.require(XmlPullParser.END_TAG, namespace, name);
|
void |
nextStartTag()
call parser nextTag() and check that it is START_TAG, throw exception if not.
|
void |
nextStartTag(String name)
combine nextTag(); pp.require(XmlPullParser.START_TAG, null, name);
|
void |
nextStartTag(String namespace,
String name)
combine nextTag(); pp.require(XmlPullParser.START_TAG, namespace, name);
|
String |
nextText(String namespace,
String name)
Read text content of element ith given namespace and name
(use null namespace do indicate that nemspace should not be checked)
|
void |
skipSubTree()
Skip sub tree that is currently porser positioned on.
|
defineEntityReplacementText, getAttributeCount, getAttributeName, getAttributeNamespace, getAttributePrefix, getAttributeType, getAttributeValue, getAttributeValue, getColumnNumber, getDepth, getEventType, getFeature, getInputEncoding, getLineNumber, getName, getNamespace, getNamespace, getNamespaceCount, getNamespacePrefix, getNamespaceUri, getPositionDescription, getPrefix, getProperty, getText, getTextCharacters, isAttributeDefault, isEmptyElementTag, isWhitespace, next, nextTag, nextText, nextToken, require, setFeature, setInput, setInput, setPropertystatic final String XSI_NS
static final String XSD_NS
String getAttributeValue(String name)
String getPITarget() throws IllegalStateException
[16] PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>'IllegalStateExceptionString getPIData() throws IllegalStateException
[16] PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>'
NOTE: if there is no PI data it returns empty string.
IllegalStateExceptionString getRequiredAttributeValue(String name) throws IOException, XmlPullParserException
IOExceptionXmlPullParserExceptionString getRequiredAttributeValue(String namespace, String name) throws IOException, XmlPullParserException
IOExceptionXmlPullParserExceptionString getRequiredElementText(String namespace, String name) throws IOException, XmlPullParserException
IOExceptionXmlPullParserExceptionboolean isNil()
throws IOException,
XmlPullParserException
IOExceptionXmlPullParserExceptionboolean matches(int type,
String namespace,
String name)
throws XmlPullParserException
XmlPullParserExceptionvoid nextStartTag()
throws XmlPullParserException,
IOException
XmlPullParserExceptionIOExceptionvoid nextStartTag(String name) throws XmlPullParserException, IOException
XmlPullParserExceptionIOExceptionvoid nextStartTag(String namespace, String name) throws XmlPullParserException, IOException
XmlPullParserExceptionIOExceptionvoid nextEndTag()
throws XmlPullParserException,
IOException
XmlPullParserExceptionIOExceptionvoid nextEndTag(String name) throws XmlPullParserException, IOException
XmlPullParserExceptionIOExceptionvoid nextEndTag(String namespace, String name) throws XmlPullParserException, IOException
XmlPullParserExceptionIOExceptionString nextText(String namespace, String name) throws IOException, XmlPullParserException
IOExceptionXmlPullParserExceptionvoid skipSubTree()
throws XmlPullParserException,
IOException
pp.require(XmlPullParser.START_TAG, null, null);
int level = 1;
while(level > 0) {
int eventType = pp.next();
if(eventType == XmlPullParser.END_TAG) {
--level;
} else if(eventType == XmlPullParser.START_TAG) {
++level;
}
}
XmlPullParserExceptionIOExceptionCopyright © 2013. All Rights Reserved.