Java Code Examples for com.fasterxml.jackson.databind.BeanDescription

The following are top voted examples for showing how to use com.fasterxml.jackson.databind.BeanDescription. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: aws-xray-sdk-java   File: EntityImpl.java   Source Code and License 8 votes vote down vote up
@Override
public void setupModule(SetupContext setupContext) {
    super.setupModule(setupContext);
    setupContext.addBeanSerializerModifier(new BeanSerializerModifier() {
        @SuppressWarnings("unchecked")
        @Override
        public JsonSerializer<?> modifySerializer(SerializationConfig serializationConfig, BeanDescription beanDescription, JsonSerializer<?> jsonSerializer) {
            Class<?> beanClass = beanDescription.getBeanClass();
            if (Cause.class.isAssignableFrom(beanClass)) {
                return new CauseSerializer((JsonSerializer<Object>) jsonSerializer);
            } else if (StackTraceElement.class.isAssignableFrom(beanClass)) {
                return new StackTraceElementSerializer();
            }
            return jsonSerializer;
        }
    });
}
 
Example 2
Project: allure2   File: XmlParserModule.java   Source Code and License 6 votes vote down vote up
@Override
public void setupModule(final SetupContext context) {
    super.setupModule(context);
    context.addBeanDeserializerModifier(new BeanDeserializerModifier() {
        @Override
        public JsonDeserializer<?> modifyCollectionDeserializer(final DeserializationConfig config,
                                                                final CollectionType type,
                                                                final BeanDescription beanDesc,
                                                                final JsonDeserializer<?> deserializer) {
            if (deserializer instanceof CollectionDeserializer) {
                return new ListDeserializer((CollectionDeserializer) deserializer);
            } else {
                return super.modifyCollectionDeserializer(config, type, beanDesc,
                        deserializer);
            }
        }
    });
}
 
Example 3
Project: cikm16-wdvd-feature-extraction   File: MapDeserializerModifier.java   Source Code and License 6 votes vote down vote up
@Override
public JsonDeserializer<?> modifyMapDeserializer(
		DeserializationConfig config, MapType type,
		BeanDescription beanDesc,
		JsonDeserializer<?> deserializer) {
	
	// statements
	if (isMapOfStringAndListOfStatements(type)) {
		return new ModifiedMapDeserializer<String, List<JacksonStatement>>(deserializer);
	}
	// labels and descriptions
	else if (isMapOfStringAndMonolingualTextValue(type)) {
		return new ModifiedMapDeserializer<String, JacksonMonolingualTextValue>(deserializer);
	}
	// sitelinks
	else if (isMapOfStringAndSitelink(type)) {
		return new ModifiedMapDeserializer<String, JacksonSiteLink>(deserializer);
	}
	// aliases and miscallaneous that does not need this workaround
	else {
		return deserializer;
	}
}
 
Example 4
Project: jddd   File: SimpleValueObjectSerializerModifier.java   Source Code and License 6 votes vote down vote up
@Override
public BeanSerializerBuilder updateBuilder(SerializationConfig config, BeanDescription beanDesc,
		BeanSerializerBuilder builder) {

	for (BeanPropertyWriter writer : builder.getProperties()) {

		JavaType propertyType = writer.getMember().getType();
		Class<?> type = propertyType.getRawClass();
		List<BeanPropertyDefinition> properties = getProperties(propertyType, config);

		Optional.ofNullable(AnnotationUtils.findAnnotation(type, ValueObject.class))//
				.filter(it -> properties.size() == 1)//
				.flatMap(it -> properties.stream().findFirst())//
				.ifPresent(it -> writer.assignSerializer(new PropertyAccessingSerializer(it)));
	}

	return builder;
}
 
Example 5
Project: datadog-jmx-collector   File: JmxCollectorMain.java   Source Code and License 6 votes vote down vote up
@Bean
public ObjectMapper objectMapper() {
    ObjectMapper mapper = new ObjectMapper();
    SimpleModule module = new SimpleModule();
    module.setDeserializerModifier( new BeanDeserializerModifier() {
        @Override
        public JsonDeserializer<Enum> modifyEnumDeserializer( DeserializationConfig config, final JavaType type, BeanDescription beanDesc,
          final JsonDeserializer<?> deserializer ) {
            return new JsonDeserializer<Enum>() {
                @Override
                public Enum deserialize( JsonParser jp, DeserializationContext ctxt ) throws IOException {
                    Class<? extends Enum> rawClass = (Class<Enum<?>>) type.getRawClass();
                    return Enum.valueOf( rawClass, jp.getValueAsString().toUpperCase() );
                }
            };
        }
    } );

    module.addDeserializer( Expression.class, new ExpressionDeserializer( expressionParser() ) );
    module.addDeserializer( Range.class, new RangeDeserializer() );
    mapper.registerModule( module );

    return mapper;
}
 
Example 6
Project: java-triton   File: PostprocessModificationModule.java   Source Code and License 6 votes vote down vote up
@Override
public void setupModule(final SetupContext context) {
    super.setupModule(context);

    context.addBeanSerializerModifier(new BeanSerializerModifier() {

        public JsonSerializer<?> modifySerializer(
                final SerializationConfig config,
                final BeanDescription beanDesc,
                final JsonSerializer<?> serializer) {
            Class<?> valueClass = beanDesc.getType().getRawClass();

            if (serializer instanceof BeanSerializerBase
                    && MODIFIABLE_CLASSES.contains(valueClass)) {
                return new FlatteningModifySerializer(
                        (BeanSerializerBase) serializer);
            }

            return serializer;
        }
    });
}
 
Example 7
Project: bowman   File: JacksonClientModule.java   Source Code and License 6 votes vote down vote up
public JacksonClientModule() {
	setSerializerModifier(new BeanSerializerModifier() {

		@Override
		public List<BeanPropertyWriter> changeProperties(SerializationConfig config, BeanDescription beanDesc,
				List<BeanPropertyWriter> beanProperties) {
			
			for (BeanPropertyWriter writer : beanProperties) {
				if (writer.getAnnotation(LinkedResource.class) != null) {
					writer.assignSerializer(new LinkedResourceUriSerializer());
				}
			}
			
			return beanProperties;
		}
	});
	
	setMixInAnnotation(Resource.class, ResourceMixin.class);
}
 
Example 8
Project: aem-core-wcm-components   File: DefaultMethodSkippingModuleProvider.java   Source Code and License 6 votes vote down vote up
public DefaultMethodSkippingModuleProvider() {
    module = new SimpleModule();
    module.setSerializerModifier(new BeanSerializerModifier() {
        @Override
        public List<BeanPropertyWriter> changeProperties(SerializationConfig config, BeanDescription beanDesc, List<BeanPropertyWriter> beanProperties) {

            return super.changeProperties(config, beanDesc, beanProperties.stream().filter(bpw -> {
                final AnnotatedMember jacksonMember = bpw.getMember();
                final Member member = jacksonMember.getMember();
                if (member instanceof Method) {
                    final Method method = (Method) member;
                    if (method.isDefault()) {
                        // only exclude default methods if they are defined on interfaces from the core components
                        return !method.getDeclaringClass().getName().startsWith(PACKAGE_CORE_COMPONENTS);
                    }
                }
                return true;
            }).collect(Collectors.toList()));
        }
    });
}
 
Example 9
Project: NyBatisCore   File: SerializerModifier.java   Source Code and License 6 votes vote down vote up
@Override
public JsonSerializer<?> modifySerializer( SerializationConfig config, BeanDescription beanDesc, JsonSerializer<?> serializer ) {

    Class<?> klass = beanDesc.getBeanClass();

    if( klass == Boolean.class ) {
        return new BooleanSerializer( serializer );
    } else if( klass == Integer.class ) {
        return new IntegerSerializer( serializer );
    } else if( klass == Long.class ) {
        return new LongSerializer( serializer );
    } else if( klass == Float.class ) {
        return new FloatSerializer( serializer );
    } else if( klass == Double.class ) {
        return new DoubleSerializer( serializer );
    } else if( klass == BigDecimal.class ) {
        return new BigDecimalSerializer( serializer );
    } else if( ClassUtil.isExtendedBy( klass, Date.class ) ) {
        return new DateSerializer( serializer );
    }

    return serializer;

}
 
Example 10
Project: eMonocot   File: HibernateSerializers.java   Source Code and License 6 votes vote down vote up
@Override
public JsonSerializer<?> findSerializer(
		SerializationConfig config, JavaType type,
		BeanDescription beanDesc)
		{
	Class<?> raw = type.getRawClass();

	/* Note: PersistentCollection does not implement Collection, so we
	 * may get some types here...
	 */
	if (PersistentCollection.class.isAssignableFrom(raw)) {
		// TODO: handle iterator types? Or PersistentArrayHolder?
	}

	if (HibernateProxy.class.isAssignableFrom(raw)) {
		return new HibernateProxySerializer(isEnabled(Feature.FORCE_LAZY_LOADING));
	}
	return null;
		}
 
Example 11
Project: Gaffer   File: GraphConfigurationService.java   Source Code and License 6 votes vote down vote up
@SuppressFBWarnings(value = "REC_CATCH_EXCEPTION", justification = "Need to wrap all runtime exceptions before they are given to the user")
@Override
public Set<String> getSerialisedFields(final String className) {
    final Class<?> clazz;
    try {
        clazz = Class.forName(className);
    } catch (final Exception e) {
        throw new IllegalArgumentException("Class name was not recognised: " + className, e);
    }

    final ObjectMapper mapper = new ObjectMapper();
    final JavaType type = mapper.getTypeFactory().constructType(clazz);
    final BeanDescription introspection = mapper.getSerializationConfig().introspect(type);
    final List<BeanPropertyDefinition> properties = introspection.findProperties();

    final Set<String> fields = new HashSet<>();
    for (final BeanPropertyDefinition property : properties) {
        fields.add(property.getName());
    }

    return fields;
}
 
Example 12
Project: Gaffer   File: GraphConfigurationServiceV2.java   Source Code and License 6 votes vote down vote up
@SuppressFBWarnings(value = "REC_CATCH_EXCEPTION", justification = "Need to wrap all runtime exceptions before they are given to the user")
@Override
public Response getSerialisedFields(final String className) {
    final Class<?> clazz;
    try {
        clazz = Class.forName(className);
    } catch (final Exception e) {
        throw new IllegalArgumentException("Class name was not recognised: " + className, e);
    }

    final ObjectMapper mapper = new ObjectMapper();
    final JavaType type = mapper.getTypeFactory().constructType(clazz);
    final BeanDescription introspection = mapper.getSerializationConfig()
                                                .introspect(type);
    final List<BeanPropertyDefinition> properties = introspection.findProperties();

    final Set<String> fields = new HashSet<>();
    for (final BeanPropertyDefinition property : properties) {
        fields.add(property.getName());
    }

    return Response.ok(fields)
                   .header(GAFFER_MEDIA_TYPE_HEADER, GAFFER_MEDIA_TYPE)
                   .build();
}
 
Example 13
Project: logsniffer   File: CoreAppConfig.java   Source Code and License 6 votes vote down vote up
@Bean
public ObjectMapper jsonObjectMapper() {
	final ObjectMapper jsonMapper = new ObjectMapper();
	jsonMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
	jsonMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
	jsonMapper.configure(Feature.ALLOW_UNQUOTED_FIELD_NAMES, true);
	jsonMapper.configure(Feature.ALLOW_SINGLE_QUOTES, true);
	jsonMapper.configure(MapperFeature.DEFAULT_VIEW_INCLUSION, false);

	final SimpleModule module = new SimpleModule("FieldsMapping", Version.unknownVersion());
	module.setSerializerModifier(new BeanSerializerModifier() {
		@Override
		public JsonSerializer<?> modifyMapSerializer(final SerializationConfig config, final MapType valueType,
				final BeanDescription beanDesc, final JsonSerializer<?> serializer) {
			if (FieldsMap.class.isAssignableFrom(valueType.getRawClass())) {
				return new FieldsMapMixInLikeSerializer();
			} else {
				return super.modifyMapSerializer(config, valueType, beanDesc, serializer);
			}
		}
	});
	jsonMapper.registerModule(module);
	return jsonMapper;
}
 
Example 14
Project: metadict   File: MetadictJacksonModule.java   Source Code and License 6 votes vote down vote up
@Override
public void setupModule(SetupContext context) {
    super.setupModule(context);

    context.addBeanSerializerModifier(new BeanSerializerModifier() {

        public JsonSerializer<?> modifySerializer(
                SerializationConfig config,
                BeanDescription beanDesc,
                JsonSerializer<?> serializer) {
            if (serializer instanceof BeanSerializerBase) {
                return new DictionaryObjectSerializer(
                        (BeanSerializerBase) serializer);
            }
            return serializer;
        }
    });
}
 
Example 15
Project: vavr-jackson   File: VavrSerializers.java   Source Code and License 6 votes vote down vote up
@Override
public JsonSerializer<?> findCollectionLikeSerializer(SerializationConfig config,
                                                      CollectionLikeType type, BeanDescription beanDesc,
                                                      TypeSerializer elementTypeSerializer, JsonSerializer<Object> elementValueSerializer) {
    Class<?> raw = type.getRawClass();
    if (raw == CharSeq.class) {
        return new CharSeqSerializer(type);
    }
    if (Seq.class.isAssignableFrom(raw)) {
        return new ArraySerializer<>(type);
    }
    if (Set.class.isAssignableFrom(raw)) {
        return new ArraySerializer<>(type);
    }
    if (PriorityQueue.class.isAssignableFrom(raw)) {
        return new ArraySerializer<>(type);
    }
    return super.findCollectionLikeSerializer(config, type, beanDesc, elementTypeSerializer, elementValueSerializer);
}
 
Example 16
Project: QuizUpWinner   File: TypeNameIdResolver.java   Source Code and License 6 votes vote down vote up
public String idFromValue(Object paramObject)
{
  Class localClass = paramObject.getClass();
  String str1 = localClass.getName();
  synchronized (this._typeToId)
  {
    String str2 = (String)this._typeToId.get(str1);
    String str3 = str2;
    if (str2 == null)
    {
      if (this._config.isAnnotationProcessingEnabled())
      {
        BeanDescription localBeanDescription = this._config.introspectClassAnnotations(localClass);
        str3 = this._config.getAnnotationIntrospector().findTypeName(localBeanDescription.getClassInfo());
      }
      if (str3 == null)
        str3 = _defaultTypeId(localClass);
      this._typeToId.put(str1, str3);
    }
    return str3;
  }
}
 
Example 17
Project: QuizUpWinner   File: BeanDeserializerFactory.java   Source Code and License 6 votes vote down vote up
protected void addInjectables(DeserializationContext paramDeserializationContext, BeanDescription paramBeanDescription, BeanDeserializerBuilder paramBeanDeserializerBuilder)
{
  Map localMap = paramBeanDescription.findInjectables();
  if (localMap != null)
  {
    boolean bool = paramDeserializationContext.canOverrideAccessModifiers();
    Iterator localIterator = localMap.entrySet().iterator();
    while (localIterator.hasNext())
    {
      Map.Entry localEntry = (Map.Entry)localIterator.next();
      AnnotatedMember localAnnotatedMember = (AnnotatedMember)localEntry.getValue();
      if (bool)
        localAnnotatedMember.fixAccess();
      paramBeanDeserializerBuilder.addInjectable(localAnnotatedMember.getName(), paramBeanDescription.resolveType(localAnnotatedMember.getGenericType()), paramBeanDescription.getClassAnnotations(), localAnnotatedMember, localEntry.getKey());
    }
  }
}
 
Example 18
Project: QuizUpWinner   File: BasicSerializerFactory.java   Source Code and License 6 votes vote down vote up
protected JsonSerializer<?> buildEnumSerializer(SerializationConfig paramSerializationConfig, JavaType paramJavaType, BeanDescription paramBeanDescription)
{
  JsonFormat.Value localValue = paramBeanDescription.findExpectedFormat(null);
  if ((localValue != null) && (localValue.getShape() == JsonFormat.Shape.OBJECT))
  {
    ((BasicBeanDescription)paramBeanDescription).removeProperty("declaringClass");
    return null;
  }
  Object localObject = EnumSerializer.construct(paramJavaType.getRawClass(), paramSerializationConfig, paramBeanDescription, localValue);
  if (this._factoryConfig.hasSerializerModifiers())
  {
    Iterator localIterator = this._factoryConfig.serializerModifiers().iterator();
    while (localIterator.hasNext())
      localObject = ((BeanSerializerModifier)localIterator.next()).modifyEnumSerializer(paramSerializationConfig, paramJavaType, paramBeanDescription, (JsonSerializer)localObject);
  }
  return localObject;
}
 
Example 19
Project: QuizUpWinner   File: BasicSerializerFactory.java   Source Code and License 6 votes vote down vote up
protected final JsonSerializer<?> findSerializerByLookup(JavaType paramJavaType, SerializationConfig paramSerializationConfig, BeanDescription paramBeanDescription, boolean paramBoolean)
{
  String str = paramJavaType.getRawClass().getName();
  JsonSerializer localJsonSerializer1 = (JsonSerializer)_concrete.get(str);
  if (localJsonSerializer1 == null)
  {
    Class localClass = (Class)_concreteLazy.get(str);
    if (localClass != null)
      try
      {
        JsonSerializer localJsonSerializer2 = (JsonSerializer)localClass.newInstance();
        return localJsonSerializer2;
      }
      catch (Exception localException)
      {
        throw new IllegalStateException("Failed to instantiate standard serializer (of type " + localClass.getName() + "): " + localException.getMessage(), localException);
      }
  }
  return localJsonSerializer1;
}
 
Example 20
Project: QuizUpWinner   File: BasicSerializerFactory.java   Source Code and License 6 votes vote down vote up
protected final JsonSerializer<?> findSerializerByPrimaryType(SerializerProvider paramSerializerProvider, JavaType paramJavaType, BeanDescription paramBeanDescription, boolean paramBoolean)
{
  Class localClass = paramJavaType.getRawClass();
  if (InetAddress.class.isAssignableFrom(localClass))
    return InetAddressSerializer.instance;
  if (TimeZone.class.isAssignableFrom(localClass))
    return TimeZoneSerializer.instance;
  if (Charset.class.isAssignableFrom(localClass))
    return ToStringSerializer.instance;
  JsonSerializer localJsonSerializer = findOptionalStdSerializer(paramSerializerProvider, paramJavaType, paramBeanDescription, paramBoolean);
  if (localJsonSerializer != null)
    return localJsonSerializer;
  if (Number.class.isAssignableFrom(localClass))
    return NumberSerializers.NumberSerializer.instance;
  if (Enum.class.isAssignableFrom(localClass))
    return buildEnumSerializer(paramSerializerProvider.getConfig(), paramJavaType, paramBeanDescription);
  if (Calendar.class.isAssignableFrom(localClass))
    return CalendarSerializer.instance;
  if (java.util.Date.class.isAssignableFrom(localClass))
    return DateSerializer.instance;
  return null;
}
 
Example 21
Project: QuizUpWinner   File: DeserializerCache.java   Source Code and License 6 votes vote down vote up
protected final JsonDeserializer<Object> _createDeserializer(DeserializationContext paramDeserializationContext, DeserializerFactory paramDeserializerFactory, JavaType paramJavaType)
{
  DeserializationConfig localDeserializationConfig = paramDeserializationContext.getConfig();
  if ((paramJavaType.isAbstract()) || (paramJavaType.isMapLikeType()) || (paramJavaType.isCollectionLikeType()))
    paramJavaType = paramDeserializerFactory.mapAbstractType(localDeserializationConfig, paramJavaType);
  BeanDescription localBeanDescription = localDeserializationConfig.introspect(paramJavaType);
  JsonDeserializer localJsonDeserializer = findDeserializerFromAnnotation(paramDeserializationContext, localBeanDescription.getClassInfo());
  if (localJsonDeserializer != null)
    return localJsonDeserializer;
  JavaType localJavaType1 = modifyTypeByAnnotation(paramDeserializationContext, localBeanDescription.getClassInfo(), paramJavaType);
  if (localJavaType1 != paramJavaType)
  {
    paramJavaType = localJavaType1;
    localBeanDescription = localDeserializationConfig.introspect(localJavaType1);
  }
  Class localClass = localBeanDescription.findPOJOBuilder();
  if (localClass != null)
    return paramDeserializerFactory.createBuilderBasedDeserializer(paramDeserializationContext, paramJavaType, localBeanDescription, localClass);
  Converter localConverter = localBeanDescription.findDeserializationConverter();
  if (localConverter == null)
    return _createDeserializer2(paramDeserializationContext, paramDeserializerFactory, paramJavaType, localBeanDescription);
  JavaType localJavaType2 = localConverter.getInputType(paramDeserializationContext.getTypeFactory());
  if (!localJavaType2.hasRawClass(paramJavaType.getRawClass()))
    localBeanDescription = localDeserializationConfig.introspect(localJavaType2);
  return new StdDelegatingDeserializer(localConverter, localJavaType2, _createDeserializer2(paramDeserializationContext, paramDeserializerFactory, localJavaType2, localBeanDescription));
}
 
Example 22
Project: QuizUpWinner   File: AbstractDeserializer.java   Source Code and License 6 votes vote down vote up
public AbstractDeserializer(BeanDeserializerBuilder paramBeanDeserializerBuilder, BeanDescription paramBeanDescription, Map<String, SettableBeanProperty> paramMap)
{
  this._baseType = paramBeanDescription.getType();
  this._objectIdReader = paramBeanDeserializerBuilder.getObjectIdReader();
  this._backRefProperties = paramMap;
  Class localClass = this._baseType.getRawClass();
  this._acceptString = localClass.isAssignableFrom(String.class);
  boolean bool1;
  if ((localClass == Boolean.TYPE) || (localClass.isAssignableFrom(Boolean.class)))
    bool1 = true;
  else
    bool1 = false;
  this._acceptBoolean = bool1;
  boolean bool2;
  if ((localClass == Integer.TYPE) || (localClass.isAssignableFrom(Integer.class)))
    bool2 = true;
  else
    bool2 = false;
  this._acceptInt = bool2;
  boolean bool3;
  if ((localClass == Double.TYPE) || (localClass.isAssignableFrom(Double.class)))
    bool3 = true;
  else
    bool3 = false;
  this._acceptDouble = bool3;
}
 
Example 23
Project: QuizUpWinner   File: BeanDeserializerFactory.java   Source Code and License 6 votes vote down vote up
protected JsonDeserializer<?> findStdDeserializer(DeserializationContext paramDeserializationContext, JavaType paramJavaType, BeanDescription paramBeanDescription)
{
  JsonDeserializer localJsonDeserializer = findDefaultDeserializer(paramDeserializationContext, paramJavaType, paramBeanDescription);
  if (localJsonDeserializer != null)
    return localJsonDeserializer;
  if (AtomicReference.class.isAssignableFrom(paramJavaType.getRawClass()))
  {
    JavaType[] arrayOfJavaType = paramDeserializationContext.getTypeFactory().findTypeParameters(paramJavaType, AtomicReference.class);
    JavaType localJavaType;
    if ((arrayOfJavaType == null) || (arrayOfJavaType.length <= 0))
      localJavaType = TypeFactory.unknownType();
    else
      localJavaType = arrayOfJavaType[0];
    return new JdkDeserializers.AtomicReferenceDeserializer(localJavaType);
  }
  return findOptionalStdDeserializer(paramDeserializationContext, paramJavaType, paramBeanDescription);
}
 
Example 24
Project: iiif-apis   File: DeserializerModifier.java   Source Code and License 5 votes vote down vote up
@Override
public JsonDeserializer<?> modifyEnumDeserializer(DeserializationConfig config, JavaType type,
    BeanDescription beanDesc, JsonDeserializer<?> deserializer) {
  if (Arrays.asList(Quality.class, Format.class).contains(type.getRawClass())) {
    return new EnumDeserializer((Class<? extends Enum>) type.getRawClass());
  }
  return super.modifyEnumDeserializer(config, type, beanDesc, deserializer);
}
 
Example 25
Project: iiif-apis   File: DeserializerModifier.java   Source Code and License 5 votes vote down vote up
@Override
public JsonDeserializer<?> modifyDeserializer(DeserializationConfig config, BeanDescription beanDesc,
    JsonDeserializer<?> deserializer) {
  // We don't use the @JsonDeserialize annotation since we only want the
  // custom deserializer for the abstract type and not for the actual types.
  if (Service.class == beanDesc.getBeanClass()) {
    return new ServiceDeserializer();
  } else if (Resource.class == beanDesc.getBeanClass()) {
    return new ResourceDeserializer();
  } else if (Profile.class == beanDesc.getBeanClass()) {
    return new ProfileDeserializer((JsonDeserializer<Object>) deserializer);
  }
  return super.modifyDeserializer(config, beanDesc, deserializer);
}
 
Example 26
Project: iiif-apis   File: SerializerModifier.java   Source Code and License 5 votes vote down vote up
@Override
public JsonSerializer<?> modifyCollectionSerializer(SerializationConfig config, CollectionType valueType,
    BeanDescription beanDesc, JsonSerializer<?> serializer) {
  if (valueType.getRawClass() == ArrayList.class) {
    return new IiifIndexedListSerializer((IndexedListSerializer) serializer, config.getTypeFactory());
  }
  return super.modifyCollectionSerializer(config, valueType, beanDesc, serializer);
}
 
Example 27
Project: iiif-apis   File: SerializerModifier.java   Source Code and License 5 votes vote down vote up
@Override
public JsonSerializer<?> modifySerializer(SerializationConfig config, BeanDescription beanDesc,
    JsonSerializer<?> serializer) {
  if (Resource.class.isAssignableFrom(beanDesc.getBeanClass())) {
    return new ResourceSerializer((JsonSerializer<Object>) serializer);
  } else if (Profile.class.isAssignableFrom(beanDesc.getBeanClass())) {
    return new ProfileSerializer((JsonSerializer<Object>) serializer);
  }
  return super.modifySerializer(config, beanDesc, serializer);
}
 
Example 28
Project: JRediClients   File: DefenceModule.java   Source Code and License 5 votes vote down vote up
@Override
public ValueInstantiator findValueInstantiator(DeserializationConfig config, BeanDescription beanDesc,
        ValueInstantiator defaultInstantiator) {
    if (DEFAULT_NO_DESER_CLASS_NAMES.contains(beanDesc.getClassInfo().getRawType().getName())) {
        throw new IllegalArgumentException("Illegal type " + beanDesc.getClassInfo().getRawType().getName() + " to deserialize: prevented for security reasons");
    }
    
    return super.findValueInstantiator(config, beanDesc, defaultInstantiator);
}
 
Example 29
Project: known-issue   File: JacksonEnumExtension.java   Source Code and License 5 votes vote down vote up
@Override
public JsonDeserializer<Enum> modifyEnumDeserializer(DeserializationConfig config,
                                                     final JavaType type,
                                                     BeanDescription beanDesc,
                                                     final JsonDeserializer<?> deserializer) {
    return new EnumJsonDeserializer(type);

}
 
Example 30
Project: kowalski   File: ArtifactDeserializerModifier.java   Source Code and License 5 votes vote down vote up
@Override
public JsonDeserializer<?> modifyDeserializer(DeserializationConfig config, BeanDescription beanDesc,
		JsonDeserializer<?> deserializer) {
	if (Artifact.class.isAssignableFrom(beanDesc.getType().getRawClass())) {
		return new ArtifactDeserializer();
	}
	return super.modifyDeserializer(config, beanDesc, deserializer);
}
 
Example 31
Project: web3j   File: ObjectMapperFactory.java   Source Code and License 5 votes vote down vote up
private static ObjectMapper configureObjectMapper(
        ObjectMapper objectMapper, boolean shouldIncludeRawResponses) {
    if (shouldIncludeRawResponses) {
        SimpleModule module = new SimpleModule();
        module.setDeserializerModifier(new BeanDeserializerModifier() {
            @Override
            public JsonDeserializer<?> modifyDeserializer(DeserializationConfig config,
                                                          BeanDescription beanDesc,
                                                          JsonDeserializer<?> deserializer) {
                if (Response.class.isAssignableFrom(beanDesc.getBeanClass())) {
                    return new RawResponseDeserializer(deserializer);
                }

                return deserializer;
            }
        });

        objectMapper.registerModule(module);
    }

    objectMapper.configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true);
    objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);

    return objectMapper;
}
 
Example 32
Project: -deprecated-hlp-candidate   File: SupernodeModule.java   Source Code and License 5 votes vote down vote up
public SupernodeModule(Supplier<Boolean> production) {
    super("Supernode");

    this.formatter = HyperLedgerSettings.getInstance().getTxWireFormatter();

    addDeserializer(MasterPrivateKey.class, new MasterPrivateKeyDeserializer());
    addDeserializer(MasterPublicKey.class, new MasterPublicKeyDeserializer());
    addDeserializer(Script.class, new ScriptDeserializer());
    addDeserializer(UIAddress.class, new AddressDeserializer());
    addDeserializer(Transaction.class, new TransactionDeserializer(formatter));
    addDeserializer(Hash.class, new HashDeserializer());
    addDeserializer(TID.class, new TIDDeserializer());
    addDeserializer(BID.class, new BIDDeserializer());

    addSerializer(MasterPrivateKey.class, new MasterPrivateKeySerializer());
    addSerializer(MasterPublicKey.class, new MasterPublicKeySerializer());
    addSerializer(Script.class, new ScriptSerializer());
    addSerializer(UIAddress.class, new AddressSerializer());
    addSerializer(Transaction.class, new TransactionSerializer());
    addSerializer(Outpoint.class, new OutpointSerializer());
    addSerializer(Hash.class, new HashSerializer());
    addSerializer(TID.class, new TIDSerializer());
    addSerializer(BID.class, new BIDSerializer());

    this.setSerializerModifier(new BeanSerializerModifier() {
        @Override
        public JsonSerializer<?> modifySerializer(SerializationConfig config,
                                                  BeanDescription beanDesc,
                                                  JsonSerializer<?> serializer) {
            if (serializer instanceof MasterPublicKeySerializer) {
                MasterPublicKeySerializer.class.cast(serializer).setProduction(production.get());
            }
            if (serializer instanceof MasterPrivateKeySerializer) {
                MasterPrivateKeySerializer.class.cast(serializer).setProduction(production.get());
            }

            return serializer;
        }
    });
}
 
Example 33
Project: SensorThingsServer   File: EntitySerializer.java   Source Code and License 5 votes vote down vote up
protected void serializeField(
        Entity entity,
        JsonGenerator gen,
        SerializerProvider serializers,
        BeanDescription beanDescription,
        BeanPropertyDefinition beanPropertyDefinition) throws Exception {
    serializeFieldTyped(entity, gen, serializers, beanDescription, beanPropertyDefinition, null);
}
 
Example 34
Project: SensorThingsServer   File: EntitySerializer.java   Source Code and License 5 votes vote down vote up
protected void serializeFieldTyped(
        Entity entity,
        JsonGenerator gen,
        SerializerProvider serializers,
        BeanDescription beanDescription,
        BeanPropertyDefinition beanPropertyDefinition,
        TypeSerializer typeSerializer) throws Exception {
    try {
        if (typeSerializer == null) {
            typeSerializer = serializers.findTypeSerializer(serializers.constructType(beanPropertyDefinition.getAccessor().getRawType()));
        }
        if (typeSerializer == null) {
            // if not static type if available use dynamic type if available
            Object propertyValue = beanPropertyDefinition.getAccessor().getValue(entity);
            if (propertyValue != null) {
                typeSerializer = serializers.findTypeSerializer(serializers.constructType(propertyValue.getClass()));
            }
        }

        BeanPropertyWriter bpw = new BeanPropertyWriter(
                beanPropertyDefinition,
                beanPropertyDefinition.getAccessor(),
                beanDescription.getClassAnnotations(),
                beanPropertyDefinition.getAccessor().getType(),
                null, // will be searched automatically
                typeSerializer, // will not be searched automatically
                beanPropertyDefinition.getAccessor().getType(),
                suppressNulls(serializers.getConfig().getDefaultPropertyInclusion()),
                suppressableValue(serializers.getConfig().getDefaultPropertyInclusion()));
        bpw.serializeAsField(entity, gen, serializers);
    } catch (JsonMappingException ex) {
        Logger.getLogger(EntitySerializer.class.getName()).log(Level.SEVERE, null, ex);
    }
}
 
Example 35
Project: jb4jsonld-jackson   File: JsonLdSerializerModifier.java   Source Code and License 5 votes vote down vote up
@Override
public JsonSerializer<?> modifySerializer(SerializationConfig config, BeanDescription beanDesc,
                                          JsonSerializer<?> serializer) {
    if (BeanAnnotationProcessor.isOwlClassEntity(beanDesc.getBeanClass())) {
        return new JacksonJsonLdSerializer<>();
    }
    return serializer;
}
 
Example 36
Project: jb4jsonld-jackson   File: JsonLdDeserializerModifier.java   Source Code and License 5 votes vote down vote up
@Override
public JsonDeserializer<?> modifyDeserializer(DeserializationConfig config, BeanDescription beanDesc,
                                              JsonDeserializer<?> deserializer) {
    if (BeanAnnotationProcessor.isOwlClassEntity(beanDesc.getBeanClass())) {
        return new JacksonJsonLdDeserializer(deserializer, beanDesc.getBeanClass());
    }
    return deserializer;
}
 
Example 37
Project: sam   File: JsonHelper.java   Source Code and License 5 votes vote down vote up
public static JsonSerializer<Object> getBeanSerializer(SerializerProvider sp, Class<?> cls) throws JsonMappingException {

    final SerializationConfig config = sp.getConfig();
    final JavaType type = config.constructType(cls);
    final BeanDescription beanDesc = config.introspect(type);
    return BeanSerializerFactory.instance.findBeanSerializer(sp, type, beanDesc);
  }
 
Example 38
Project: https-github.com-g0t4-jenkins2-course-spring-boot   File: ConfigurationPropertiesReportEndpoint.java   Source Code and License 5 votes vote down vote up
@Override
public List<BeanPropertyWriter> changeProperties(SerializationConfig config,
		BeanDescription beanDesc, List<BeanPropertyWriter> beanProperties) {
	List<BeanPropertyWriter> result = new ArrayList<BeanPropertyWriter>();
	for (BeanPropertyWriter writer : beanProperties) {
		boolean readable = isReadable(beanDesc, writer);
		if (readable) {
			result.add(writer);
		}
	}
	return result;
}
 
Example 39
Project: https-github.com-g0t4-jenkins2-course-spring-boot   File: ConfigurationPropertiesReportEndpoint.java   Source Code and License 5 votes vote down vote up
private boolean isReadable(BeanDescription beanDesc, BeanPropertyWriter writer) {
	Class<?> parentType = beanDesc.getType().getRawClass();
	Class<?> type = writer.getType().getRawClass();
	AnnotatedMethod setter = findSetter(beanDesc, writer);
	// If there's a setter, we assume it's OK to report on the value,
	// similarly, if there's no setter but the package names match, we assume
	// that its a nested class used solely for binding to config props, so it
	// should be kosher. This filter is not used if there is JSON metadata for
	// the property, so it's mainly for user-defined beans.
	return (setter != null) || ClassUtils.getPackageName(parentType)
			.equals(ClassUtils.getPackageName(type));
}
 
Example 40
Project: https-github.com-g0t4-jenkins2-course-spring-boot   File: ConfigurationPropertiesReportEndpoint.java   Source Code and License 5 votes vote down vote up
private AnnotatedMethod findSetter(BeanDescription beanDesc,
		BeanPropertyWriter writer) {
	String name = "set" + StringUtils.capitalize(writer.getName());
	Class<?> type = writer.getType().getRawClass();
	AnnotatedMethod setter = beanDesc.findMethod(name, new Class<?>[] { type });
	// The enabled property of endpoints returns a boolean primitive but is set
	// using a Boolean class
	if (setter == null && type.equals(Boolean.TYPE)) {
		setter = beanDesc.findMethod(name, new Class<?>[] { Boolean.class });
	}
	return setter;
}
 
Example 41
Project: https-github.com-g0t4-jenkins2-course-spring-boot   File: DataSourceJsonSerializationTests.java   Source Code and License 5 votes vote down vote up
@Override
public List<BeanPropertyWriter> changeProperties(SerializationConfig config,
		BeanDescription beanDesc, List<BeanPropertyWriter> beanProperties) {
	List<BeanPropertyWriter> result = new ArrayList<BeanPropertyWriter>();
	for (BeanPropertyWriter writer : beanProperties) {
		AnnotatedMethod setter = beanDesc.findMethod(
				"set" + StringUtils.capitalize(writer.getName()),
				new Class<?>[] { writer.getType().getRawClass() });
		if (setter != null && this.conversionService.canConvert(String.class,
				writer.getType().getRawClass())) {
			result.add(writer);
		}
	}
	return result;
}
 
Example 42
Project: autorest-clientruntime-for-java   File: FlatteningDeserializer.java   Source Code and License 5 votes vote down vote up
/**
 * Gets a module wrapping this serializer as an adapter for the Jackson
 * ObjectMapper.
 *
 * @param mapper the object mapper for default deserializations
 * @return a simple module to be plugged onto Jackson ObjectMapper.
 */
public static SimpleModule getModule(final ObjectMapper mapper) {
    SimpleModule module = new SimpleModule();
    module.setDeserializerModifier(new BeanDeserializerModifier() {
        @Override
        public JsonDeserializer<?> modifyDeserializer(DeserializationConfig config, BeanDescription beanDesc, JsonDeserializer<?> deserializer) {
            if (beanDesc.getBeanClass().getAnnotation(JsonFlatten.class) != null) {
                return new FlatteningDeserializer(beanDesc.getBeanClass(), deserializer, mapper);
            }
            return deserializer;
        }
    });
    return module;
}
 
Example 43
Project: autorest-clientruntime-for-java   File: FlatteningSerializer.java   Source Code and License 5 votes vote down vote up
/**
 * Gets a module wrapping this serializer as an adapter for the Jackson
 * ObjectMapper.
 *
 * @param mapper the object mapper for default serializations
 * @return a simple module to be plugged onto Jackson ObjectMapper.
 */
public static SimpleModule getModule(final ObjectMapper mapper) {
    SimpleModule module = new SimpleModule();
    module.setSerializerModifier(new BeanSerializerModifier() {
        @Override
        public JsonSerializer<?> modifySerializer(SerializationConfig config, BeanDescription beanDesc, JsonSerializer<?> serializer) {
            if (beanDesc.getBeanClass().getAnnotation(JsonFlatten.class) != null) {
                return new FlatteningSerializer(beanDesc.getBeanClass(), serializer, mapper);
            }
            return serializer;
        }
    });
    return module;
}
 
Example 44
Project: graphql-spqr   File: ConvertingDeserializers.java   Source Code and License 5 votes vote down vote up
@Override
public JsonDeserializer<?> findMapDeserializer(MapType type, DeserializationConfig config,
                                               BeanDescription beanDesc, KeyDeserializer keyDeserializer,
                                               TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer) {

    return forJavaType(type);
}
 
Example 45
Project: graphql-spqr   File: JacksonValueMapper.java   Source Code and License 5 votes vote down vote up
@Override
public Set<InputField> getInputFields(AnnotatedType type) {
    JavaType javaType = objectMapper.getTypeFactory().constructType(type.getType());
    BeanDescription desc = objectMapper.getDeserializationConfig().introspect(javaType);
    return desc.findProperties().stream()
            .filter(BeanPropertyDefinition::couldDeserialize)
            .map(def -> new InputField(def.getName(), def.getMetadata().getDescription(), getInputFieldType(type, def)))
            .collect(Collectors.toSet());
}
 
Example 46
Project: endpoints-java   File: JacksonResourceSchemaProvider.java   Source Code and License 5 votes vote down vote up
@Override
public ResourceSchema getResourceSchema(TypeToken<?> type, ApiConfig config) {
  ResourceSchema schema = super.getResourceSchema(type, config);
  if (schema != null) {
    return schema;
  }
  ObjectMapper objectMapper =
      ObjectMapperUtil.createStandardObjectMapper(config.getSerializationConfig());
  JavaType javaType = objectMapper.getTypeFactory().constructType(type.getRawType());
  BeanDescription beanDescription = objectMapper.getSerializationConfig().introspect(javaType);
  ResourceSchema.Builder schemaBuilder = ResourceSchema.builderForType(type.getRawType());
  Set<String> genericDataFieldNames = getGenericDataFieldNames(type);
  for (BeanPropertyDefinition definition : beanDescription.findProperties()) {
    TypeToken<?> propertyType = getPropertyType(type, toMethod(definition.getGetter()),
        toMethod(definition.getSetter()), definition.getField(), config);
    String name = definition.getName();
    if (genericDataFieldNames == null || genericDataFieldNames.contains(name)) {
      if (hasUnresolvedType(propertyType)) {
        logger.warning("skipping field '" + name + "' of type '" + propertyType
            + "' because it is unresolved.");
        continue;
      }
      if (propertyType != null) {
        schemaBuilder.addProperty(name, ResourcePropertySchema.of(propertyType));
      } else {
        logger.warning("No type found for property '" + name + "' on class '" + type + "'.");
      }
    } else {
      logger.fine("skipping field '" + name + "' because it's not a Java client model field.");
    }
  }
  return schemaBuilder.build();
}
 
Example 47
Project: endpoints-java   File: ObjectMapperUtil.java   Source Code and License 5 votes vote down vote up
@Override
public JsonSerializer<?> modifyMapSerializer(SerializationConfig config, MapType valueType,
    BeanDescription beanDesc, JsonSerializer<?> serializer) {
  if (serializer instanceof MapSerializer) {
    // TODO: We should probably be propagating the NON_EMPTY inclusion here, but it's breaking
    // discovery.
    return new DeepEmptyCheckingSerializer<>(serializer);
  }
  return serializer;
}
 
Example 48
Project: emodb   File: LazyJsonModule.java   Source Code and License 5 votes vote down vote up
@Override
public void setupModule(SetupContext context) {
    // Modify the Map serializer to the delegate if it matches Map<String, ?>
    context.addBeanSerializerModifier(new BeanSerializerModifier() {
        @Override
        public JsonSerializer<?> modifyMapSerializer(SerializationConfig config, MapType valueType, BeanDescription beanDesc,
                                                     JsonSerializer<?> serializer) {
            if (valueType.getKeyType().equals(SimpleType.construct(String.class))) {
                return new DelegatingMapSerializer(serializer);
            }
            return serializer;
        }
    });
}
 
Example 49
Project: Sparkplug   File: DeserializerModifier.java   Source Code and License 5 votes vote down vote up
@Override
public JsonDeserializer<?> modifyDeserializer(DeserializationConfig config, BeanDescription beanDesc, JsonDeserializer<?> deserializer) {
    if (Metric.class.equals(beanDesc.getBeanClass())) {
        return new MetricDeserializer(deserializer);
    }

    return super.modifyDeserializer(config, beanDesc, deserializer);
}
 
Example 50
Project: httpQL   File: BeanPropertyIntrospector.java   Source Code and License 5 votes vote down vote up
private static BeanDescription introspect(Class<?> type) {
  final JavaType javaType;
  SerializationConfig sc = Rosetta.getMapper().getSerializationConfig().withView(RosettaProperty.class);

  javaType = Rosetta.getMapper().getTypeFactory().constructType(type);
  return sc.introspect(javaType);
}
 
Example 51
Project: gvnix1   File: DataBinderBeanDeserializerModifier.java   Source Code and License 5 votes vote down vote up
@Override
public JsonDeserializer<?> modifyDeserializer(DeserializationConfig config,
        BeanDescription beanDesc, JsonDeserializer<?> deserializer) {
    if (deserializer instanceof BeanDeserializerBase) {
        return new DataBinderDeserializer(
                (BeanDeserializerBase) deserializer);
    }
    // When there is no custom-deserializer implementation returns the
    // default jackson deserializer
    return deserializer;
}
 
Example 52
Project: spring-boot-concourse   File: ConfigurationPropertiesReportEndpoint.java   Source Code and License 5 votes vote down vote up
@Override
public List<BeanPropertyWriter> changeProperties(SerializationConfig config,
		BeanDescription beanDesc, List<BeanPropertyWriter> beanProperties) {
	List<BeanPropertyWriter> result = new ArrayList<BeanPropertyWriter>();
	for (BeanPropertyWriter writer : beanProperties) {
		boolean readable = isReadable(beanDesc, writer);
		if (readable) {
			result.add(writer);
		}
	}
	return result;
}
 
Example 53
Project: spring-boot-concourse   File: ConfigurationPropertiesReportEndpoint.java   Source Code and License 5 votes vote down vote up
private boolean isReadable(BeanDescription beanDesc, BeanPropertyWriter writer) {
	String parentType = beanDesc.getType().getRawClass().getName();
	String type = writer.getType().getTypeName();
	AnnotatedMethod setter = findSetter(beanDesc, writer);
	// If there's a setter, we assume it's OK to report on the value,
	// similarly, if there's no setter but the package names match, we assume
	// that its a nested class used solely for binding to config props, so it
	// should be kosher. This filter is not used if there is JSON metadata for
	// the property, so it's mainly for user-defined beans.
	return (setter != null) || ClassUtils.getPackageName(parentType)
			.equals(ClassUtils.getPackageName(type));
}
 
Example 54
Project: spring-boot-concourse   File: ConfigurationPropertiesReportEndpoint.java   Source Code and License 5 votes vote down vote up
private AnnotatedMethod findSetter(BeanDescription beanDesc,
		BeanPropertyWriter writer) {
	String name = "set" + StringUtils.capitalize(writer.getName());
	Class<?> type = writer.getType().getRawClass();
	AnnotatedMethod setter = beanDesc.findMethod(name, new Class<?>[] { type });
	// The enabled property of endpoints returns a boolean primitive but is set
	// using a Boolean class
	if (setter == null && type.equals(Boolean.TYPE)) {
		setter = beanDesc.findMethod(name, new Class<?>[] { Boolean.class });
	}
	return setter;
}
 
Example 55
Project: spring-boot-concourse   File: DataSourceJsonSerializationTests.java   Source Code and License 5 votes vote down vote up
@Override
public List<BeanPropertyWriter> changeProperties(SerializationConfig config,
		BeanDescription beanDesc, List<BeanPropertyWriter> beanProperties) {
	List<BeanPropertyWriter> result = new ArrayList<BeanPropertyWriter>();
	for (BeanPropertyWriter writer : beanProperties) {
		AnnotatedMethod setter = beanDesc.findMethod(
				"set" + StringUtils.capitalize(writer.getName()),
				new Class<?>[] { writer.getType().getRawClass() });
		if (setter != null && this.conversionService.canConvert(String.class,
				writer.getType().getRawClass())) {
			result.add(writer);
		}
	}
	return result;
}
 
Example 56
Project: JglTF   File: JacksonUtils.java   Source Code and License 5 votes vote down vote up
/**
 * Creates a BeanDeserializerModifier that replaces the 
 * SettableBeanProperties in the BeanDeserializerBuilder with
 * ErrorReportingSettableBeanProperty instances that forward
 * information about errors when setting bean properties to the
 * given consumer. (Don't ask ... )  
 * 
 * @param jsonErrorConsumer The consumer for {@link JsonError}s.
 * If this is <code>null</code>, then no errors will be reported.
 * @return The modifier
 */
private static BeanDeserializerModifier 
    createErrorHandlingBeanDeserializerModifier(
        Consumer<? super JsonError> jsonErrorConsumer)
{
    return new BeanDeserializerModifier()
    {
        @Override
        public BeanDeserializerBuilder updateBuilder(
            DeserializationConfig config,
            BeanDescription beanDesc,
            BeanDeserializerBuilder builder)
        {
            Iterator<SettableBeanProperty> propertiesIterator =
                builder.getProperties();
            while (propertiesIterator.hasNext())
            {
                SettableBeanProperty property = propertiesIterator.next();
                SettableBeanProperty wrappedProperty =
                    new ErrorReportingSettableBeanProperty(
                        property, jsonErrorConsumer);
                builder.addOrReplaceProperty(wrappedProperty, true);
            }
            return builder;
        }
    };    
}
 
Example 57
Project: evt-bridge   File: ESBeanSerializerModifier.java   Source Code and License 5 votes vote down vote up
@Override
public JsonSerializer<?> modifySerializer(SerializationConfig config, BeanDescription beanDesc, JsonSerializer<?> serializer) {
	if (serializer instanceof BeanSerializerBase) {
		return new ESBeanSerializer((BeanSerializerBase) serializer);
	}
	
	return serializer;
}
 
Example 58
Project: android-rxjava-training   File: TotallylazyDeserializers.java   Source Code and License 5 votes vote down vote up
/**
 * We have plenty of collection types to support...
 */
@Override
public JsonDeserializer<?> findCollectionDeserializer(CollectionType type,
                                                      DeserializationConfig config, BeanDescription beanDesc,
                                                      TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer)
        throws JsonMappingException {
    return new SequenceDeserializer(type,
            elementTypeDeserializer, elementDeserializer);
}
 
Example 59
Project: android-rxjava-training   File: TotallylazyDeserializers.java   Source Code and License 5 votes vote down vote up
@Override
public JsonDeserializer<?> findMapDeserializer(MapType type,
                                               DeserializationConfig config, BeanDescription beanDesc,
                                               KeyDeserializer keyDeserializer,
                                               TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer)
        throws JsonMappingException {
    return null;
}
 
Example 60
Project: android-rxjava-training   File: TotallylazyDeserializers.java   Source Code and License 5 votes vote down vote up
@Override
public JsonDeserializer<?> findMapLikeDeserializer(MapLikeType type,
                                                   DeserializationConfig config, BeanDescription beanDesc,
                                                   KeyDeserializer keyDeserializer, TypeDeserializer elementTypeDeserializer,
                                                   JsonDeserializer<?> elementDeserializer)
        throws JsonMappingException {
    return null;
}