ResourceType type = getType(mValue.getLocalName(), attributes);
if (type == null) {
return null;
}
ResourceValue value;
String name = getName();
switch (type) {
case STYLE:
String parent = getAttributeValue(attributes, ATTR_PARENT);
try {
value = parseStyleValue(
new StyleResourceValue(type, name, parent, isFrameworks));
} catch (Throwable t) {
// TEMPORARY DIAGNOSTICS
System.err.println("Problem parsing attribute " + name + " of type " + type
+ " for node " + mValue);
return null;
}
break;
case DECLARE_STYLEABLE:
//noinspection deprecation
value = parseDeclareStyleable(new DeclareStyleableResourceValue(type, name,
isFrameworks));
break;
case ARRAY:
value = parseArrayValue(new ArrayResourceValue(name, isFrameworks));
break;
case PLURALS:
value = parsePluralsValue(new PluralsResourceValue(name, isFrameworks));
break;
case ATTR:
value = parseAttrValue(new AttrResourceValue(type, name, isFrameworks));
break;
case STRING:
value = parseTextValue(new TextResourceValue(type, name, isFrameworks));
break;
default:
value = parseValue(new ResourceValue(type, name, isFrameworks));
break;
}
return value;
}