Search in sources :

Example 1 with ValueResourcesFileParser

use of org.jetbrains.android.util.ValueResourcesFileParser in project android by JetBrains.

the class AndroidBuildDataCache method parseValueResourceFile.

@NotNull
private static List<ResourceEntry> parseValueResourceFile(@NotNull File valueResXmlFile) throws IOException {
    final ArrayList<ResourceEntry> result = new ArrayList<ResourceEntry>();
    final InputStream inputStream = new BufferedInputStream(new FileInputStream(valueResXmlFile));
    try {
        FormsParsing.parse(inputStream, new ValueResourcesFileParser() {

            @Override
            protected void stop() {
                throw new FormsParsing.ParserStoppedException();
            }

            @Override
            protected void process(@NotNull ResourceEntry resourceEntry) {
                result.add(resourceEntry);
            }
        });
    } finally {
        inputStream.close();
    }
    return result;
}
Also used : FormsParsing(org.jetbrains.jps.incremental.java.FormsParsing) ResourceEntry(org.jetbrains.android.util.ResourceEntry) ValueResourcesFileParser(org.jetbrains.android.util.ValueResourcesFileParser) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

ResourceEntry (org.jetbrains.android.util.ResourceEntry)1 ValueResourcesFileParser (org.jetbrains.android.util.ValueResourcesFileParser)1 NotNull (org.jetbrains.annotations.NotNull)1 FormsParsing (org.jetbrains.jps.incremental.java.FormsParsing)1