本文整理汇总了Java中org.xmlpull.v1.XmlPullParser.TYPES属性的典型用法代码示例。如果您正苦于以下问题:Java XmlPullParser.TYPES属性的具体用法?Java XmlPullParser.TYPES怎么用?Java XmlPullParser.TYPES使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.xmlpull.v1.XmlPullParser
的用法示例。
在下文中一共展示了XmlPullParser.TYPES属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPITarget
public static String getPITarget(XmlPullParser var0) throws IllegalStateException {
int var1;
try {
var1 = var0.getEventType();
} catch (XmlPullParserException var4) {
throw new IllegalStateException("could not determine parser state: " + var4 + var0.getPositionDescription());
}
if(var1 != 8) {
throw new IllegalStateException("parser must be on processing instruction and not " + XmlPullParser.TYPES[var1] + var0.getPositionDescription());
} else {
String var2 = var0.getText();
for(int var3 = 0; var3 < var2.length(); ++var3) {
if(isS(var2.charAt(var3))) {
return var2.substring(0, var3);
}
}
return var2;
}
}
示例2: getPIData
public static String getPIData(XmlPullParser var0) throws IllegalStateException {
int var1;
try {
var1 = var0.getEventType();
} catch (XmlPullParserException var5) {
throw new IllegalStateException("could not determine parser state: " + var5 + var0.getPositionDescription());
}
if(var1 != 8) {
throw new IllegalStateException("parser must be on processing instruction and not " + XmlPullParser.TYPES[var1] + var0.getPositionDescription());
} else {
String var2 = var0.getText();
int var3 = -1;
for(int var4 = 0; var4 < var2.length(); ++var4) {
if(isS(var2.charAt(var4))) {
var3 = var4;
} else if(var3 > 0) {
return var2.substring(var4);
}
}
return "";
}
}