List of usage examples for com.fasterxml.jackson.core Version Version
public Version(int major, int minor, int patchLevel, String snapshotInfo, String groupId, String artifactId)
From source file:com.tikinou.schedulesdirect.core.jackson.ModuleRegistration.java
private ModuleRegistration() { customModule = new SimpleModule("com.tikinou.schedulesdirect.core.jackson.module", new Version(1, 0, 0, null, null, null)); customModule.addDeserializer(ResponseCode.class, new StdDelegatingDeserializer<>(new ResponseCodeConverter())); customModule.addDeserializer(GetHeadendsResult.class, new StdDelegatingDeserializer<>(new HeadendResultConverter())); // customModule.addDeserializer(GetHeadendsResult.class, new HeadendResultDeserializer()); // customModule.addDeserializer(Boolean.class, new BooleanYNDeserializer()); // customModule.addDeserializer(Boolean.TYPE, new BooleanYNDeserializer()); }
From source file:de.escalon.hypermedia.spring.de.escalon.hypermedia.spring.jackson.JacksonHydraModule.java
public JacksonHydraModule() { super("json-hydra-module", new Version(1, 0, 0, null, "de.escalon.hypermedia", "hydra-spring")); setMixInAnnotation(ResourceSupport.class, ResourceSupportMixin.class); setMixInAnnotation(Resources.class, ResourcesMixin.class); setMixInAnnotation(Resource.class, ResourceMixin.class); addSerializer(Resource.class, new ResourceSerializer()); }
From source file:com.basho.riak.client.itest.ITestStats.java
@Test public void testDeserializer() throws IOException { NodeStats.UndefinedStatDeserializer usd = new NodeStats.UndefinedStatDeserializer(); SimpleModule module = new SimpleModule("UndefinedStatDeserializer", new Version(1, 0, 0, null, null, null)); module.addDeserializer(BigInteger.class, usd); String json = "{\"vnode_gets\":\"deprecated\",\"vnode_gets_total\":12345678}"; ObjectMapper mapper = new ObjectMapper(); mapper.registerModule(module);//from ww w. j av a 2s . c o m NodeStats stats = mapper.readValue(json, NodeStats.class); assertEquals(stats.vnodeGets(), BigInteger.ZERO); assertEquals(stats.vnodeGetsTotal(), BigInteger.valueOf(12345678)); }
From source file:org.jongo.json.JsonModule.java
@Override public Version version() { return new Version(2, 0, 0, "", "org.jongo", "jongomodule"); }
From source file:be.wegenenverkeer.common.resteasy.json.RestJsonMapper.java
/** * No-arguments constructor./*from w ww . ja va 2s . c o m*/ */ public RestJsonMapper() { super(); this.setSerializationInclusion(JsonInclude.Include.NON_NULL); this.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); this.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false); this.setDateFormat(new Iso8601AndOthersDateFormat()); SimpleModule testModule = new SimpleModule("jsr310", new Version(1, 0, 0, "", "be.wegenenverkeer.common", "common-resteasy")); testModule.addDeserializer(LocalDate.class, new LocalDateDeserializer()); testModule.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer()); testModule.addSerializer(LocalDate.class, new LocalDateSerializer()); testModule.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer()); this.registerModule(testModule); ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); if (null == classLoader) { classLoader = this.getClass().getClassLoader(); } try { Class clazz = classLoader.loadClass("com.fasterxml.jackson.datatype.joda.JodaModule"); Object instance = clazz.newInstance(); this.registerModule((Module) instance); } catch (Exception ex) { // ignore, we do not require joda-time, but inform the user LOG.warn("Add jackson-datatype-joda dependency for joda-time support."); } }
From source file:fr.javatic.mongo.jacksonCodec.javaTime.JavaTimeBsonModule.java
@Override public Version version() { return new Version(0, 1, 0, "", "", ""); }
From source file:com.concentricsky.android.khanacademy.data.remote.VideoDeserializerModule.java
public VideoDeserializerModule() { super("VideoDeserializerModule", new Version(1, 0, 0, null, "com.concentricsky.android", "khanacademy")); this.addDeserializer(Video.class, new VideoDeserializer()); defaultMapper = new ObjectMapper(); }
From source file:com.concentricsky.android.khanacademy.data.remote.UserVideoDeserializerModule.java
public UserVideoDeserializerModule() { super("UserVideoDeserializerModule", new Version(1, 0, 0, null, "com.concentricsky.android", "khanacademy")); this.addDeserializer(UserVideo.class, new UserVideoDeserializer()); defaultMapper = new ObjectMapper(); }
From source file:io.fabric8.cxf.endpoint.BeanValidationAnnotationIntrospector.java
@Override public Version version() { return new Version(1, 1, 0, "", "cxf", "json-schema-mbean"); }
From source file:org.apache.airavata.db.ModelConversionHelper.java
/** * Private method to register the custom serializers and deserializers *//*from w ww . j a v a 2s . c o m*/ private void init() { this.objectMapper = new ObjectMapper(); SimpleModule module = new SimpleModule("UserProfileService", new Version(1, 0, 0, null, null, null)); module.addSerializer(UserProfile.class, new UserProfileSerializer()); module.addDeserializer(UserProfile.class, new UserProfileDeserializer()); module.addSerializer(Publication.class, new PublicationSerializer()); module.addDeserializer(Publication.class, new PublicationDeserializer()); module.addSerializer(Institution.class, new InstitutionSerializer()); module.addDeserializer(Institution.class, new InstitutionDeserializer()); objectMapper.registerModule(module); }