@Before public void setUp() throws Exception { resourceTable = new PackageResourceTable("pkg"); topLevelNodeHandler = new NodeHandler(); staxDocumentLoader = new StaxDocumentLoader("pkg", null, topLevelNodeHandler); }
/** * Creates an application resource table which can be constructed with multiple resources paths * representing overlayed resource libraries. */ public PackageResourceTable newResourceTable(String packageName, ResourcePath... resourcePaths) { return PerfStatsCollector.getInstance() .measure( "load legacy app resources", () -> { PackageResourceTable resourceTable = new PackageResourceTable(packageName); for (ResourcePath resourcePath : resourcePaths) { if (resourcePath.getRClass() != null) { addRClassValues(resourceTable, resourcePath.getRClass()); } } for (ResourcePath resourcePath : resourcePaths) { parseResourceFiles(resourcePath, resourceTable); } return resourceTable; }); }
/** Builds an Android framework resource table in the "android" package space. */ public PackageResourceTable newFrameworkResourceTable(ResourcePath resourcePath) { return PerfStatsCollector.getInstance() .measure( "load legacy framework resources", () -> { PackageResourceTable resourceTable = new PackageResourceTable("android"); if (resourcePath.getRClass() != null) { addRClassValues(resourceTable, resourcePath.getRClass()); addMissingStyleableAttributes(resourceTable, resourcePath.getRClass()); } if (resourcePath.getInternalRClass() != null) { addRClassValues(resourceTable, resourcePath.getInternalRClass()); addMissingStyleableAttributes(resourceTable, resourcePath.getInternalRClass()); } parseResourceFiles(resourcePath, resourceTable); return resourceTable; }); }
/** * Creates an application resource table which can be constructed with multiple resources paths representing * overlayed resource libraries. */ public PackageResourceTable newResourceTable(String packageName, ResourcePath... resourcePaths) { PackageResourceTable resourceTable = new PackageResourceTable(packageName); for (ResourcePath resourcePath : resourcePaths) { if (resourcePath.getRClass() != null) { addRClassValues(resourceTable, resourcePath.getRClass()); } } for (ResourcePath resourcePath : resourcePaths) { parseResourceFiles(resourcePath, resourceTable); } return resourceTable; }
/** * Creates an application resource table which can be constructed with multiple resources paths * representing overlayed resource libraries. */ public PackageResourceTable newResourceTable(String packageName, ResourcePath... resourcePaths) { return PerfStatsCollector.getInstance() .measure( "load legacy app resources", () -> { PackageResourceTable resourceTable = new PackageResourceTable(packageName); for (ResourcePath resourcePath : resourcePaths) { if (resourcePath.getRClass() != null) { addRClassValues(resourceTable, resourcePath.getRClass()); } } for (ResourcePath resourcePath : resourcePaths) { parseResourceFiles(resourcePath, resourceTable); } return resourceTable; }); }
/** * Builds an Android framework resource table in the "android" package space. */ public PackageResourceTable newFrameworkResourceTable(ResourcePath resourcePath) { PackageResourceTable resourceTable = new PackageResourceTable("android"); if (resourcePath.getRClass() != null) { addRClassValues(resourceTable, resourcePath.getRClass()); addMissingStyleableAttributes(resourceTable, resourcePath.getRClass()); } if (resourcePath.getInternalRClass() != null) { addRClassValues(resourceTable, resourcePath.getInternalRClass()); addMissingStyleableAttributes(resourceTable, resourcePath.getInternalRClass()); } parseResourceFiles(resourcePath, resourceTable); return resourceTable; }
/** Builds an Android framework resource table in the "android" package space. */ public PackageResourceTable newFrameworkResourceTable(ResourcePath resourcePath) { return PerfStatsCollector.getInstance() .measure( "load legacy framework resources", () -> { PackageResourceTable resourceTable = new PackageResourceTable("android"); if (resourcePath.getRClass() != null) { addRClassValues(resourceTable, resourcePath.getRClass()); addMissingStyleableAttributes(resourceTable, resourcePath.getRClass()); } if (resourcePath.getInternalRClass() != null) { addRClassValues(resourceTable, resourcePath.getInternalRClass()); addMissingStyleableAttributes(resourceTable, resourcePath.getInternalRClass()); } parseResourceFiles(resourcePath, resourceTable); return resourceTable; }); }