本文整理匯總了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 "";
}
}