if ("schema".equals(method)) {
Schema.Parser parser = new Schema.Parser();
for (File src : determineInputs(inputs, SCHEMA_FILTER)) {
Schema schema = parser.parse(src);
SpecificCompiler compiler = new SpecificCompiler(schema);
compiler.setStringType(stringType);
if (encoding != null) {
compiler.setOutputCharacterEncoding(encoding);
}
compiler.compileToDestination(src, output);
}
} else if ("protocol".equals(method)) {
for (File src : determineInputs(inputs, PROTOCOL_FILTER)) {
Protocol protocol = Protocol.parse(src);
SpecificCompiler compiler = new SpecificCompiler(protocol);
compiler.setStringType(stringType);
if (encoding != null) {
compiler.setOutputCharacterEncoding(encoding);
}
compiler.compileToDestination(src, output);
}
} else {
System.err.println("Expected \"schema\" or \"protocol\".");
return 1;
}