List of usage examples for com.fasterxml.jackson.jaxrs.cfg Annotations JACKSON
Annotations JACKSON
To view the source code for com.fasterxml.jackson.jaxrs.cfg Annotations JACKSON.
Click Source Link
From source file:org.killbill.commons.skeleton.modules.JaxrsJacksonModule.java
public JaxrsJacksonModule(final ObjectMapper mapper) { this(mapper, Annotations.JACKSON, Annotations.JAXB); }
From source file:org.usrz.libs.httpd.handlers.RestHandlerProvider.java
@Override protected HttpHandler get(Injector injector, Configurations configurations) { /* Setup our object mapper (could be qualified with path) */ final ObjectMapper mapper = getInstance(injector, ObjectMapper.class, path); final Map<Class<?>, Integer> contractPriorities = new HashMap<>(); contractPriorities.put(MessageBodyWriter.class, Integer.MIN_VALUE); contractPriorities.put(MessageBodyReader.class, Integer.MIN_VALUE); config.register(//w w w. j av a2 s . c o m new JacksonJsonProvider(mapper, new Annotations[] { Annotations.JACKSON, Annotations.JAXB }), Collections.unmodifiableMap(contractPriorities)); /* Create a ServiceLocator parent of all locators and inject the configurations */ final ServiceLocator locator = ServiceLocatorFactory.create(injector, path); /* Set up the ObjectMapper that will be used by this application */ ServiceLocatorUtilities.addOneConstant(locator, mapper, null, ObjectMapper.class); /* Create a brand new Grizzly HTTP container from Jersey */ log.debug("Jersey application at \"%s\" initializing", path.value()); GrizzlyHttpContainer container = GrizzlyHttpContainerFactory.create(config, locator); log.info("Jersey application at \"%s\" initialized successfully", path.value()); /* Create our handler and add it to our server configuration */ final HttpServer server = injector.getInstance(HttpServer.class); server.getServerConfiguration().addHttpHandler(container, path.value()); log.info("Serving \"%s\" using Jersey application \"%s\"", path.value(), config.getApplicationName()); /* All done! */ return container; }
From source file:com.dell.asm.asmcore.asmmanager.util.ProxyUtil.java
public static void initAsmDeployerProxy() { // asm-deployer does not require the auth headers the java services do and always uses json JacksonJaxbJsonProvider provider = new AsmJacksonJsonProvider(); provider.setAnnotationsToUse(new Annotations[] { Annotations.JACKSON, Annotations.JAXB }); asmDeployerProxy = JAXRSClientFactory.create(AsmManagerApp.asmDeployerApiUrl, IAsmDeployerService.class, Collections.singletonList(provider)); WebClient.client(asmDeployerProxy).type(MediaType.APPLICATION_JSON); WebClient.client(asmDeployerProxy).accept(MediaType.APPLICATION_JSON); }