ParserBean extension;
try (InputStream is = new FileInputStream(extensionGrammar)) {
ArrayList<Pair<String,Reader>> files = new ArrayList<>();
files.add(new Pair<String, Reader>(extensionGrammar.getName(), new InputStreamReader(is)));
XMLSkinParser xmlSkinParser = new XMLSkinParser(files,
new CompilerLogger(new PrintCompilerLogHandler(new PrintStream(new OutputStream() {
public void write(int b) {
//Nothing - suppress all messages
}
}))));
xmlSkinParser.parse();
Field parserField = xmlSkinParser.getClass().getDeclaredField("currentParser");
parserField.setAccessible(true);
extension = (ParserBean)parserField.get(xmlSkinParser);
} catch (Exception e) {
throw new BuildException(e);
}