@Override @SuppressWarnings("unchecked") public JsonSerializer<Object> createSerializer(SerializationConfig config, JavaType type, BeanProperty property) throws JsonMappingException { JsonSerializer<?> ser = findCustomSerializer(type.getRawClass(), config); if (ser != null) { return (JsonSerializer<Object>) ser; } return super.createSerializer(config, type, property); }
@Override @SuppressWarnings("unchecked") public JsonSerializer<Object> createSerializer(SerializationConfig config, JavaType type, BeanProperty property) throws JsonMappingException { JsonSerializer<?> ser = findCustomSerializer(type.getRawClass(), config); if (ser != null) { return (JsonSerializer<Object>) ser; } return super.createSerializer(config, type, property); }
@Override @SuppressWarnings("unchecked") public JsonSerializer<Object> createSerializer(SerializationConfig config, JavaType type, BeanProperty property) throws JsonMappingException { JsonSerializer<?> ser = findCustomSerializer(type.getRawClass(), config); if (ser != null) { return (JsonSerializer<Object>) ser; } return super.createSerializer(config, type, property); }
private BeanHelper getBeanHelper(Class<?> beanClass) { if (beanClass == null) { return null; } try { final SerializationConfig serializationConfig = objectMapper.getSerializationConfig(); final JavaType simpleType = objectMapper.constructType(beanClass); final JsonSerializer<?> jsonSerializer = BeanSerializerFactory.instance.createSerializer(serializationConfig, simpleType, null); if (jsonSerializer == null) { return null; } if (jsonSerializer instanceof BeanSerializer) { return new BeanHelper((BeanSerializer) jsonSerializer); } else { final String jsonSerializerName = jsonSerializer.getClass().getName(); throw new RuntimeException(String.format("Unknown serializer '%s' for class '%s'", jsonSerializerName, beanClass)); } } catch (JsonMappingException e) { throw new RuntimeException(e); } }
@Override @SuppressWarnings("unchecked") public JsonSerializer<Object> createSerializer(SerializationConfig config, JavaType type, BeanProperty property) throws JsonMappingException { JsonSerializer<?> ser = findCustomSerializer(type.getRawClass(), config); if (ser != null) { return (JsonSerializer<Object>) ser; } return super.createSerializer(config, type, property); }
@Override @SuppressWarnings("unchecked") public JsonSerializer<Object> createSerializer(SerializationConfig config, JavaType type, BeanProperty property) throws JsonMappingException { JsonSerializer<?> ser = findCustomSerializer(type.getRawClass(), config); if (ser != null) { return (JsonSerializer<Object>) ser; } return super.createSerializer(config, type, property); }
return super.createSerializer(type, config);