Charsets.UTF_8));
KXmlParser parser = new KXmlParser();
parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false);
parser.setInput(reader);
ResourceType lastType = null;
String lastTypeName = "";
while (true) {
int event = parser.next();
if (event == XmlPullParser.START_TAG) {
// As of API 15 there are a number of "java-symbol" entries here
if (!parser.getName().equals("public")) { //$NON-NLS-1$
continue;
}
String name = null;
String typeName = null;
for (int i = 0, n = parser.getAttributeCount(); i < n; i++) {
String attribute = parser.getAttributeName(i);
if (attribute.equals("name")) { //$NON-NLS-1$
name = parser.getAttributeValue(i);
if (typeName != null) {
// Skip id attribute processing
break;
}
} else if (attribute.equals("type")) { //$NON-NLS-1$
typeName = parser.getAttributeValue(i);
}
}
if (name != null && typeName != null) {
ResourceType type = null;
if (typeName.equals(lastTypeName)) {
type = lastType;
} else {
type = ResourceType.getEnum(typeName);
lastType = type;