@Override public JsonSerializer<?> modifyArraySerializer(SerializationConfig config, ArrayType valueType, BeanDescription beanDesc, JsonSerializer<?> serializer) { if (valueType.getRawClass().equals(byte[].class)) { return this.serializer; } return super.modifyArraySerializer(config, valueType, beanDesc, serializer); }
Class<?> raw = type.getRawClass();
public JsonDeserializer<?> findArrayDeserializer(ArrayType type, DeserializationConfig config, BeanDescription beanDesc, TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer) throws JsonMappingException { return (_classMappings == null) ? null : _classMappings.get(new ClassKey(type.getRawClass())); }
@Override public JsonDeserializer<?> findArrayDeserializer(ArrayType type, DeserializationConfig config, BeanDescription beanDesc, TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer) throws JsonMappingException { return (_classMappings == null) ? null : _classMappings.get(new ClassKey(type.getRawClass())); }
@Override public JsonSerializer<?> modifyArraySerializer(SerializationConfig config, ArrayType valueType, BeanDescription beanDesc, JsonSerializer<?> serializer) { if (valueType.getRawClass().equals(byte[].class)) { return this.serializer; } return super.modifyArraySerializer(config, valueType, beanDesc, serializer); }
public JsonDeserializer<?> findArrayDeserializer(ArrayType type, DeserializationConfig config, BeanDescription beanDesc, TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer) throws JsonMappingException { return (_classMappings == null) ? null : _classMappings.get(new ClassKey(type.getRawClass())); }
@Override public JsonDeserializer<?> findArrayDeserializer(ArrayType type, DeserializationConfig config, BeanDescription beanDesc, TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer) throws JsonMappingException { return (_classMappings == null) ? null : _classMappings.get(new ClassKey(type.getRawClass())); }
@Override public JsonDeserializer<?> findArrayDeserializer(ArrayType type, DeserializationConfig config, BeanDescription beanDesc, TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer) throws JsonMappingException { return (_classMappings == null) ? null : _classMappings.get(new ClassKey(type.getRawClass())); }
/** * Same as {@link #getType(com.fasterxml.jackson.databind.type.SimpleType)} * * @param jacksonType * @return */ public Type getType(ArrayType jacksonType) { String signature = JacksonSignature.createSignature(jacksonType); String contentSignature = JacksonSignature.createSignature(jacksonType.getContentType()); Class<?> contentType = jacksonType.getContentType().getRawClass(); Class<?> containerClass = jacksonType.getRawClass(); CollectionTypeJrapidoc type = new CollectionTypeJrapidoc(containerClass.getName(), signature, contentType.getName(), contentSignature); if (cache.containsKey(signature)) { return cache.get(signature); } cache.put(signature, type); getType(jacksonType.getContentType()); return type; }
return deserializeFromBase64(jp, ctxt); throw ctxt.mappingException(_arrayType.getRawClass());
return deserializeFromBase64(jp, ctxt); throw ctxt.mappingException(_arrayType.getRawClass());
return deserializeFromBase64(jp, ctxt); throw ctxt.mappingException(_arrayType.getRawClass());
return deserializeFromBase64(jp, ctxt); throw ctxt.mappingException(_arrayType.getRawClass());
return deserializeFromBase64(p, ctxt); return (Object[]) ctxt.handleUnexpectedToken(_arrayType.getRawClass(), p);
/** * Helper method that handles configuration details when constructing serializers for * <code>Object[]</code> (and subtypes, except for String). */ protected JsonSerializer<?> buildArraySerializer(SerializationConfig config, ArrayType type, BeanDescription beanDesc, boolean staticTyping, TypeSerializer elementTypeSerializer, JsonSerializer<Object> elementValueSerializer) throws JsonMappingException { Class<?> raw = type.getRawClass(); // Important: do NOT use standard serializers if non-standard element value serializer specified if (elementValueSerializer == null || ClassUtil.isJacksonStdImpl(elementValueSerializer)) { if (String[].class == raw) { return StringArraySerializer.instance; } // other standard types? JsonSerializer<?> ser = StdArraySerializers.findStandardImpl(raw); if (ser != null) { return ser; } } return new ObjectArraySerializer(type.getContentType(), staticTyping, elementTypeSerializer, elementValueSerializer); }
@Override public JsonDeserializer<?> createContextual(DeserializationContext ctxt, BeanProperty property) throws JsonMappingException { JsonDeserializer<?> deser = _elementDeserializer; Boolean unwrapSingle = findFormatFeature(ctxt, property, _arrayType.getRawClass(), JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY); // May have a content converter deser = findConvertingContentDeserializer(ctxt, property, deser); final JavaType vt = _arrayType.getContentType(); if (deser == null) { deser = ctxt.findContextualValueDeserializer(vt, property); } else { // if directly assigned, probably not yet contextual, so: deser = ctxt.handleSecondaryContextualization(deser, property, vt); } TypeDeserializer elemTypeDeser = _elementTypeDeserializer; if (elemTypeDeser != null) { elemTypeDeser = elemTypeDeser.forProperty(property); } return withResolved(elemTypeDeser, deser, unwrapSingle); }
Class<?> raw = type.getRawClass();
Class<?> raw = type.getRawClass();
Class<?> raw = type.getRawClass();
Class<?> raw = type.getRawClass();