List of utility methods to do XmlPullParser Value Get
double | optFloatAttr(final XmlPullParser pp, final String attrName, final float defaultValue) opt Float Attr final String attr = optAttr(pp, attrName, null); if (attr != null) return Double.parseDouble(attr); else return defaultValue; |
int | optIntAttr(final XmlPullParser pp, final String attrName, final int defaultValue) opt Int Attr final String attr = optAttr(pp, attrName, null); if (attr != null) return Integer.parseInt(attr); else return defaultValue; |
void | optSkip(final XmlPullParser pp, final String tagName) opt Skip if (test(pp, tagName))
requireSkip(pp, tagName);
|
String | attr(final XmlPullParser pp, final String attrName) attr final String attr = optAttr(pp, attrName, null); if (attr != null) return attr; else throw new IllegalStateException("expecting attribute: " + attrName); |
void | copyXML(XmlPullParser xmlPullParser, XmlSerializer xmlSerializer) Copy an XML fragment from a source (pull parser) to a destination (serializer), pulling all element namespaces into the empty prefix. int startDepth = xmlPullParser.getDepth(); String namespace = null; do { int type = xmlPullParser.next(); switch (type) { case XmlPullParser.END_TAG: xmlSerializer.endTag(xmlPullParser.getNamespace(), xmlPullParser.getName()); ... |
void | exit(final XmlPullParser pp, final String tagName) exit pp.require(XmlPullParser.END_TAG, null, tagName); pp.next(); |
double | floatAttr(final XmlPullParser pp, final String attrName) float Attr return Double.parseDouble(attr(pp, attrName));
|
int | intAttr(final XmlPullParser pp, final String attrName) int Attr return Integer.parseInt(attr(pp, attrName));
|