use of org.jsonschema2pojo.DefaultGenerationConfig 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 = new URL("file:///path/to/my/schema.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(new File("output"));
// END EXAMPLE
}
use of org.jsonschema2pojo.DefaultGenerationConfig in project jsonschema2pojo by joelittlejohn.
the class RuleFactoryImplTest method schemaStoreIsReturned.
@Test
public void schemaStoreIsReturned() {
SchemaStore mockSchemaStore = mock(SchemaStore.class);
RuleFactory ruleFactory = new RuleFactory(new DefaultGenerationConfig(), new NoopAnnotator(), mockSchemaStore);
assertThat(ruleFactory.getSchemaStore(), is(sameInstance(mockSchemaStore)));
}
Aggregations