public class XmlPullUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
getAttributeValue(XmlPullParser pp,
String name)
Return value of attribute with given name and no namespace.
|
static String |
getPIData(XmlPullParser pp)
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*)))? '?>' |
static String |
getPITarget(XmlPullParser pp)
Return PITarget from Processing Instruction (PI) as defined in
XML 1.0 Section 2.6 Processing Instructions
[16] PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>' |
static String |
getRequiredAttributeValue(XmlPullParser pp,
String namespace,
String name)
Read attribute value and return it or throw exception if
current element does not have such attribute.
|
static boolean |
matches(XmlPullParser pp,
int type,
String namespace,
String name)
Tests if the current event is of the given type and if the namespace and name match.
|
static void |
nextEndTag(XmlPullParser pp)
Call parser nextTag() and check that it is END_TAG, throw exception if not.
|
static void |
nextEndTag(XmlPullParser pp,
String namespace,
String name)
combine nextTag(); pp.require(XmlPullParser.END_TAG, namespace, name);
|
static void |
nextStartTag(XmlPullParser pp)
call parser nextTag() and check that it is START_TAG, throw exception if not.
|
static void |
nextStartTag(XmlPullParser pp,
String name)
combine nextTag(); pp.require(XmlPullParser.START_TAG, null, name);
|
static void |
nextStartTag(XmlPullParser pp,
String namespace,
String name)
combine nextTag(); pp.require(XmlPullParser.START_TAG, namespace, name);
|
static String |
nextText(XmlPullParser pp,
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)
|
static void |
skipSubTree(XmlPullParser pp)
Skip sub tree that is currently porser positioned on.
|
static void |
writeSimpleElement(XmlSerializer serializer,
String namespace,
String elementName,
String elementText)
Writes a simple element such as
|
public static final String XSI_NS
public static String getAttributeValue(XmlPullParser pp, String name)
public static String getPITarget(XmlPullParser pp) throws IllegalStateException
[16] PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>'IllegalStateExceptionpublic static String getPIData(XmlPullParser pp) throws IllegalStateException
[16] PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>'
NOTE: if there is no PI data it returns empty string.
IllegalStateExceptionpublic static void skipSubTree(XmlPullParser pp) throws XmlPullParserException, IOException
XmlPullParserExceptionIOExceptionpublic static void nextStartTag(XmlPullParser pp) throws XmlPullParserException, IOException
XmlPullParserExceptionIOExceptionpublic static void nextStartTag(XmlPullParser pp, String name) throws XmlPullParserException, IOException
XmlPullParserExceptionIOExceptionpublic static void nextStartTag(XmlPullParser pp, String namespace, String name) throws XmlPullParserException, IOException
XmlPullParserExceptionIOExceptionpublic static void nextEndTag(XmlPullParser pp, String namespace, String name) throws XmlPullParserException, IOException
XmlPullParserExceptionIOExceptionpublic static String nextText(XmlPullParser pp, String namespace, String name) throws IOException, XmlPullParserException
IOExceptionXmlPullParserExceptionpublic static String getRequiredAttributeValue(XmlPullParser pp, String namespace, String name) throws IOException, XmlPullParserException
IOExceptionXmlPullParserExceptionpublic static void nextEndTag(XmlPullParser pp) throws XmlPullParserException, IOException
XmlPullParserExceptionIOExceptionpublic static boolean matches(XmlPullParser pp, int type, String namespace, String name) throws XmlPullParserException
XmlPullParserExceptionpublic static void writeSimpleElement(XmlSerializer serializer, String namespace, String elementName, String elementText) throws IOException, XmlPullParserException
IOExceptionXmlPullParserExceptionCopyright © 2013. All Rights Reserved.