use of org.robolectric.res.android.ResXMLParser in project robolectric by robolectric.
the class ShadowXmlBlock method nativeCreateParseState.
@Implementation(minSdk = VERSION_CODES.LOLLIPOP, maxSdk = VERSION_CODES.P)
protected static long nativeCreateParseState(long obj) {
ResXMLTree osb = Registries.NATIVE_RES_XML_TREES.getNativeObject(obj);
// if (osb == NULL) {
// jniThrowNullPointerException(env, NULL);
// return 0;
// }
ResXMLParser st = new ResXMLParser(osb);
// if (st == NULL) {
// jniThrowException(env, "java/lang/OutOfMemoryError", NULL);
// return 0;
// }
st.restart();
return Registries.NATIVE_RES_XML_PARSERS.register(st);
}
use of org.robolectric.res.android.ResXMLParser in project robolectric by robolectric.
the class ShadowXmlBlock method nativeGetAttributeIndex.
@Implementation(minSdk = VERSION_CODES.LOLLIPOP)
protected static int nativeGetAttributeIndex(long token, String ns, String name) {
ResXMLParser st = getResXMLParser(token);
if (st == null || name == null) {
throw new NullPointerException();
}
int nsLen = 0;
if (ns != null) {
nsLen = ns.length();
}
return st.indexOfAttribute(ns, nsLen, name, name.length());
}
Aggregations