config, beanDesc, contentTypeDeser, contentDeser); if (deser == null) { Class<?> collectionClass = type.getRawClass(); if (contentDeser == null) { // not defined by annotation
return null; Class<?> raw = type.getRawClass(); if (EnumSet.class.isAssignableFrom(raw)) {
throws JsonMappingException Class<?> raw = type.getRawClass();
public JsonDeserializer<?> findCollectionDeserializer(CollectionType type, DeserializationConfig config, BeanDescription beanDesc, TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer) throws JsonMappingException { return (_classMappings == null) ? null : _classMappings.get(new ClassKey(type.getRawClass())); }
public JsonDeserializer<?> findCollectionDeserializer(CollectionType type, DeserializationConfig config, BeanDescription beanDesc, TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer) throws JsonMappingException { return (_classMappings == null) ? null : _classMappings.get(new ClassKey(type.getRawClass())); }
@Override public JsonDeserializer<?> findCollectionDeserializer(CollectionType type, DeserializationConfig config, BeanDescription beanDesc, TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer) throws JsonMappingException { return (_classMappings == null) ? null : _classMappings.get(new ClassKey(type.getRawClass())); }
@Override public JsonDeserializer<?> findCollectionDeserializer(CollectionType type, DeserializationConfig config, BeanDescription beanDesc, TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer) throws JsonMappingException { return (_classMappings == null) ? null : _classMappings.get(new ClassKey(type.getRawClass())); }
@Override public JsonDeserializer<?> findCollectionDeserializer(CollectionType type, DeserializationConfig config, BeanDescription beanDesc, TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer) throws JsonMappingException { return (_classMappings == null) ? null : _classMappings.get(new ClassKey(type.getRawClass())); }
@Override public JsonDeserializer<?> findCollectionDeserializer(CollectionType type, DeserializationConfig config, BeanDescription beanDesc, TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer) throws JsonMappingException { if (IonContainer.class.isAssignableFrom(type.getRawClass())) { return ION_VALUE_DESERIALIZER; } return super.findCollectionDeserializer(type, config, beanDesc, elementTypeDeserializer, elementDeserializer); } }
/** {@inheritDoc} */ @Override public JsonSerializer<?> findCollectionSerializer(SerializationConfig config, CollectionType type, BeanDescription beanDesc, TypeSerializer elementTypeSerializer, JsonSerializer<Object> elementValueSerializer) { if (Collection.class.isAssignableFrom(type.getRawClass()) && jsonContext.isSupportedType(type.getContentType().getRawClass())) { return createSerializer(); } return null; }
@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); }
throws JsonMappingException Class<?> raw = type.getRawClass();
/** {@inheritDoc} */ @Override public JsonDeserializer<?> findCollectionDeserializer(CollectionType type, DeserializationConfig config, BeanDescription beanDesc, TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer) throws JsonMappingException { Class clazz = type.getContentType().getRawClass(); if (Collection.class.isAssignableFrom(type.getRawClass()) && jsonContext.isSupportedType(clazz)) { return new BeanListTypeDeserializer(jsonContext, clazz); } return null; }
private void addbackReferencedFields(Object deserializedObject, DeserializationContext ctxt) throws IOException { String id = Documents.getId(deserializedObject); for (ConstructibleAnnotatedCollection constructibleField : this.backReferencedFields) { DocumentReferences ann = constructibleField.getField() .getAnnotation(DocumentReferences.class); try { ViewBasedCollection handler; if (ann.fetch().equals(FetchType.EAGER)) { handler = new ViewBasedCollection(id, couchDbConnector, clazz, ann, constructibleField); handler.initialize(); } else { handler = new LazyLoadingViewBasedCollection(id, couchDbConnector, clazz, ann, constructibleField); } Object o = Proxy.newProxyInstance(constructibleField .getCollectionType().getRawClass().getClassLoader(), new Class[] { constructibleField.getCollectionType() .getRawClass() }, handler); constructibleField.getSetter().set(deserializedObject, o); } catch (Exception e) { throw new IOException( "Failed creating reflection proxy for collection " + constructibleField, e); } } }
@Override public T deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { // Should usually point to START_ARRAY if (jp.isExpectedStartArrayToken()) { return _deserializeContents(jp, ctxt); } // But may support implicit arrays from single values? if (ctxt.isEnabled(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY)) { return _deserializeFromSingleValue(jp, ctxt); } throw ctxt.mappingException(_containerType.getRawClass()); }
private List<?> loadFromBackReferences(String thisId, DocumentReferences ann, CollectionType collectionType, String fieldName) throws JsonMappingException { try { Class<?> raw = collectionType.getRawClass(); if (Set.class.isAssignableFrom(raw)) { ViewQuery query = createBackReferenceQuery(thisId, ann, fieldName); Class<?> klass = collectionType.getContentType().getRawClass(); return loadSetResult(query, klass); } else { throw new DbAccessException("Unsupported back reference collection type: " + raw); } } catch (DbAccessException e) { if (e.getCause() instanceof JsonProcessingException) { JsonProcessingException jpe = (JsonProcessingException) e .getCause(); throw JsonMappingException.wrapWithPath(jpe, new JsonMappingException.Reference(collectionType .getContentType().getRawClass()), fieldName); } else { throw e; } } }
Class<?> collectionClass = type.getRawClass(); if (contentDeser == null) { // not defined by annotation
Class<?> collectionClass = type.getRawClass(); if (contentDeser == null) { // not defined by annotation
throws JsonMappingException Class<?> raw = type.getRawClass(); if (EnumSet.class.isAssignableFrom(raw)) {
Class<?> raw = type.getRawClass(); if (EnumSet.class.isAssignableFrom(raw)) {