All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.robolectric.res.OpaqueFileLoader Maven / Gradle / Ivy

There is a newer version: 3.4-rc2
Show newest version
package org.robolectric.res;

public class OpaqueFileLoader extends XmlLoader {
  private final ResBunch resBunch;
  private final String attrType;
  private final ResType resType;

  public OpaqueFileLoader(ResBunch resBunch, String attrType) {
    this(resBunch, attrType, ResType.LAYOUT);
  }

  public OpaqueFileLoader(ResBunch resBunch, String attrType, ResType resType) {
    this.resBunch = resBunch;
    this.attrType = attrType;
    this.resType = resType;
  }

  @Override
  protected void processResourceXml(FsFile xmlFile, XpathResourceXmlLoader.XmlNode xmlNode, XmlContext xmlContext) {
    resBunch.put(attrType, xmlFile.getBaseName(), new FileTypedResource(xmlFile, resType, xmlContext));
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy