use of org.jsonschema2pojo.Jackson2Annotator in project jsonschema2pojo by joelittlejohn.
the class Example method main.
public static void main(String[] args) throws IOException {
// BEGIN EXAMPLE
JCodeModel codeModel = new JCodeModel();
URL source = Example.class.getResource("/schema/required.json");
GenerationConfig config = new DefaultGenerationConfig() {
@Override
public boolean isGenerateBuilders() {
// set config option by overriding method
return true;
}
};
SchemaMapper mapper = new SchemaMapper(new RuleFactory(config, new Jackson2Annotator(config), new SchemaStore()), new SchemaGenerator());
mapper.generate(codeModel, "ClassName", "com.example", source);
codeModel.build(Files.createTempDirectory("required").toFile());
// END EXAMPLE
}
Aggregations