
com.xtremelabs.robolectric.res.StringResourceLoader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of robolectric Show documentation
Show all versions of robolectric Show documentation
An alternative Android testing framework.
package com.xtremelabs.robolectric.res;
import org.w3c.dom.Node;
public class StringResourceLoader extends XpathResourceXmlLoader implements ResourceValueConverter {
private ResourceReferenceResolver stringResolver = new ResourceReferenceResolver("string");
public StringResourceLoader(ResourceExtractor resourceExtractor) {
super(resourceExtractor, "/resources/string");
}
public String getValue(int resourceId) {
return stringResolver.getValue(resourceExtractor.getResourceName(resourceId));
}
public String getValue(String resourceName, boolean isSystem) {
return getValue(resourceExtractor.getResourceId(resourceName, isSystem));
}
@Override protected void processNode(Node node, String name, boolean isSystem) {
stringResolver.processResource(name, node.getTextContent(), this, isSystem);
}
@Override public Object convertRawValue(String rawValue) {
return rawValue;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy