use of com.github.victools.jsonschema.module.jackson.JacksonOption in project jsonschema-generator by victools.
the class SchemaGeneratorMojo method addJacksonModule.
/**
* Add the Jackson module to the generator config.
*
* @param configBuilder The builder on which the config is added
* @param module The modules section form the pom
* @throws MojoExecutionException Exception in case of error
*/
private void addJacksonModule(SchemaGeneratorConfigBuilder configBuilder, GeneratorModule module) throws MojoExecutionException {
if (module.options == null || module.options.length == 0) {
configBuilder.with(new JacksonModule());
} else {
JacksonOption[] jacksonOptions = new JacksonOption[module.options.length];
for (int i = 0; i < module.options.length; i++) {
try {
jacksonOptions[i] = JacksonOption.valueOf(module.options[i]);
} catch (IllegalArgumentException e) {
throw new MojoExecutionException("Error: Unknown Jackson option " + module.options[i], e);
}
}
configBuilder.with(new JacksonModule(jacksonOptions));
}
}
Aggregations