use of com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule in project ORCID-Source by ORCID.
the class PublicSwaggerResource method scan.
/**
* Scan the classes and add in the OAuth information
*/
@Override
protected synchronized Swagger scan(Application app) {
// tell swagger to pick up our jaxb annotations
Json.mapper().registerModule(new JaxbAnnotationModule());
Swagger s = super.scan(app);
OAuth2Definition oauthTwoLegs = new OAuth2Definition();
oauthTwoLegs.application(this.tokenEndPoint);
oauthTwoLegs.scope(ScopePathType.READ_PUBLIC.value(), "Read Public record");
s.securityDefinition("orcid_two_legs", oauthTwoLegs);
return s;
}
use of com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule in project fabric8 by fabric8io.
the class JsonSchemaLookup method init.
public void init() {
LOG.log(Level.INFO, "Creating JsonSchemaLookup instance");
try {
if (mapper == null) {
mapper = new ObjectMapper();
mapper.setVisibility(new IgnorePropertiesBackedByTransientFields(mapper.getVisibilityChecker()));
JaxbAnnotationModule module1 = new JaxbAnnotationModule();
mapper.registerModule(module1);
BeanValidationAnnotationModule module2 = new BeanValidationAnnotationModule();
mapper.registerModule(module2);
}
// now lets expose the mbean...
singleton = this;
} catch (Exception e) {
LOG.log(Level.WARNING, "Exception during initialization: ", e);
throw new RuntimeException(e);
}
}
use of com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule in project swagger-core by swagger-api.
the class JaxbObjectMapperFactory method getMapper.
public static ObjectMapper getMapper() {
ObjectMapper mapper = ObjectMapperFactory.createJson();
mapper.registerModule(new JaxbAnnotationModule());
return mapper;
}
use of com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule in project mycore by MyCoRe-Org.
the class MCRJobQueueResource method toJSON.
private <T> String toJSON(T entity) throws IOException {
StringWriter sw = new StringWriter();
ObjectMapper mapper = new ObjectMapper();
mapper.registerModule(new JaxbAnnotationModule());
mapper.writeValue(sw, entity);
return sw.toString();
}
use of com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule in project CFLint by cflint.
the class ConfigUtils method unmarshalJson.
public static <E> E unmarshalJson(final InputStream inputStream, final Class<E> expectedClass) throws IOException {
final ObjectMapper objectMapper = new ObjectMapper();
final JaxbAnnotationModule module = new JaxbAnnotationModule();
objectMapper.registerModule(module);
// mapper.setAnnotationIntrospector(introspector);
return objectMapper.readValue(inputStream, expectedClass);
}
Aggregations