XmlPullParserUtil
@UnstableApi
public final class XmlPullParserUtil
XmlPullParser utility methods.
Summary
Public methods |
|
|---|---|
static @Nullable String |
getAttributeValue(XmlPullParser xpp, String attributeName)Returns the value of an attribute of the current start tag. |
static @Nullable String |
getAttributeValueIgnorePrefix(XmlPullParser xpp, String attributeName)Returns the value of an attribute of the current start tag. |
static boolean |
isEndTag(XmlPullParser xpp)Returns whether the current event is an end tag. |
static boolean |
isEndTag(XmlPullParser xpp, String name)Returns whether the current event is an end tag with the specified name. |
static boolean |
isStartTag(XmlPullParser xpp)Returns whether the current event is a start tag. |
static boolean |
isStartTag(XmlPullParser xpp, String name)Returns whether the current event is a start tag with the specified name. |
static boolean |
isStartTagIgnorePrefix(XmlPullParser xpp, String name)Returns whether the current event is a start tag with the specified name. |
Public methods
getAttributeValue
public static @Nullable String getAttributeValue(XmlPullParser xpp, String attributeName)
Returns the value of an attribute of the current start tag.
| Parameters | |
|---|---|
XmlPullParser xpp |
The |
String attributeName |
The name of the attribute. |
getAttributeValueIgnorePrefix
public static @Nullable String getAttributeValueIgnorePrefix(XmlPullParser xpp, String attributeName)
Returns the value of an attribute of the current start tag. Any raw attribute names in the current start tag have their prefixes stripped before matching.
| Parameters | |
|---|---|
XmlPullParser xpp |
The |
String attributeName |
The name of the attribute. |
isEndTag
public static boolean isEndTag(XmlPullParser xpp)
Returns whether the current event is an end tag.
| Parameters | |
|---|---|
XmlPullParser xpp |
The |
| Returns | |
|---|---|
boolean |
Whether the current event is an end tag. |
| Throws | |
|---|---|
org.xmlpull.v1.XmlPullParserException |
If an error occurs querying the parser. |
isEndTag
public static boolean isEndTag(XmlPullParser xpp, String name)
Returns whether the current event is an end tag with the specified name.
| Parameters | |
|---|---|
XmlPullParser xpp |
The |
String name |
The specified name. |
| Returns | |
|---|---|
boolean |
Whether the current event is an end tag with the specified name. |
| Throws | |
|---|---|
org.xmlpull.v1.XmlPullParserException |
If an error occurs querying the parser. |
isStartTag
public static boolean isStartTag(XmlPullParser xpp)
Returns whether the current event is a start tag.
| Parameters | |
|---|---|
XmlPullParser xpp |
The |
| Returns | |
|---|---|
boolean |
Whether the current event is a start tag. |
| Throws | |
|---|---|
org.xmlpull.v1.XmlPullParserException |
If an error occurs querying the parser. |
isStartTag
public static boolean isStartTag(XmlPullParser xpp, String name)
Returns whether the current event is a start tag with the specified name.
| Parameters | |
|---|---|
XmlPullParser xpp |
The |
String name |
The specified name. |
| Returns | |
|---|---|
boolean |
Whether the current event is a start tag with the specified name. |
| Throws | |
|---|---|
org.xmlpull.v1.XmlPullParserException |
If an error occurs querying the parser. |
isStartTagIgnorePrefix
public static boolean isStartTagIgnorePrefix(XmlPullParser xpp, String name)
Returns whether the current event is a start tag with the specified name. If the current event has a raw name then its prefix is stripped before matching.
| Parameters | |
|---|---|
XmlPullParser xpp |
The |
String name |
The specified name. |
| Returns | |
|---|---|
boolean |
Whether the current event is a start tag with the specified name. |
| Throws | |
|---|---|
org.xmlpull.v1.XmlPullParserException |
If an error occurs querying the parser. |