XmlPullParserUtil


@UnstableApi
class XmlPullParserUtil


XmlPullParser utility methods.

Summary

Public functions

java-static String?
getAttributeValue(xpp: XmlPullParser!, attributeName: String!)

Returns the value of an attribute of the current start tag.

java-static String?

Returns the value of an attribute of the current start tag.

java-static Boolean

Returns whether the current event is an end tag.

java-static Boolean
isEndTag(xpp: XmlPullParser!, name: String!)

Returns whether the current event is an end tag with the specified name.

java-static Boolean

Returns whether the current event is a start tag.

java-static Boolean
isStartTag(xpp: XmlPullParser!, name: String!)

Returns whether the current event is a start tag with the specified name.

java-static Boolean

Returns whether the current event is a start tag with the specified name.

Public functions

getAttributeValue

java-static fun getAttributeValue(xpp: XmlPullParser!, attributeName: String!): String?

Returns the value of an attribute of the current start tag.

Parameters
xpp: XmlPullParser!

The XmlPullParser to query.

attributeName: String!

The name of the attribute.

Returns
String?

The value of the attribute, or null if the current event is not a start tag or if no such attribute was found.

getAttributeValueIgnorePrefix

java-static fun getAttributeValueIgnorePrefix(xpp: XmlPullParser!, attributeName: String!): String?

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
xpp: XmlPullParser!

The XmlPullParser to query.

attributeName: String!

The name of the attribute.

Returns
String?

The value of the attribute, or null if the current event is not a start tag or if no such attribute was found.

isEndTag

java-static fun isEndTag(xpp: XmlPullParser!): Boolean

Returns whether the current event is an end tag.

Parameters
xpp: XmlPullParser!

The XmlPullParser to query.

Returns
Boolean

Whether the current event is an end tag.

Throws
org.xmlpull.v1.XmlPullParserException

If an error occurs querying the parser.

isEndTag

java-static fun isEndTag(xpp: XmlPullParser!, name: String!): Boolean

Returns whether the current event is an end tag with the specified name.

Parameters
xpp: XmlPullParser!

The XmlPullParser to query.

name: String!

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

java-static fun isStartTag(xpp: XmlPullParser!): Boolean

Returns whether the current event is a start tag.

Parameters
xpp: XmlPullParser!

The XmlPullParser to query.

Returns
Boolean

Whether the current event is a start tag.

Throws
org.xmlpull.v1.XmlPullParserException

If an error occurs querying the parser.

isStartTag

java-static fun isStartTag(xpp: XmlPullParser!, name: String!): Boolean

Returns whether the current event is a start tag with the specified name.

Parameters
xpp: XmlPullParser!

The XmlPullParser to query.

name: String!

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

java-static fun isStartTagIgnorePrefix(xpp: XmlPullParser!, name: String!): Boolean

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
xpp: XmlPullParser!

The XmlPullParser to query.

name: String!

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.