@Override public JavaType getValueType() { return SimpleType.construct(String.class); }
@Override public JavaType getValueType() { return SimpleType.construct(String.class); }
private static <K> BeanProperty getBeanProperty(ObjectMapper objectMapper, Class klass, Class<K> type) throws JsonMappingException { JsonDeserializer deserializer = objectMapper.getDeserializerProvider().findTypedValueDeserializer( objectMapper.copyDeserializationConfig(), SimpleType.construct(klass), null); if (deserializer instanceof BeanDeserializer) { // First priority is a property creator, see if one exists Object propertyBasedCreator = privateGet(deserializer, "_propertyBasedCreator"); if (propertyBasedCreator != null) { Map<String, SettableBeanProperty> properties = (Map) privateGet(propertyBasedCreator, "_properties"); SettableBeanProperty beanProperty = properties.get("_id"); if (beanProperty != null) { checkType(type, beanProperty.getType().getRawClass()); return beanProperty; } } // Now try setters Iterator<SettableBeanProperty> iter = ((BeanDeserializer) deserializer).properties(); while (iter.hasNext()) { SettableBeanProperty beanProperty = iter.next(); if (beanProperty.getName().equals("_id")) { checkType(type, beanProperty.getType().getRawClass()); return beanProperty; } } } return null; }
private static <K> BeanProperty getBeanProperty(ObjectMapper objectMapper, Class klass, Class<K> type) throws JsonMappingException { JsonDeserializer deserializer = objectMapper.getDeserializerProvider().findTypedValueDeserializer( objectMapper.copyDeserializationConfig(), SimpleType.construct(klass), null); if (deserializer instanceof BeanDeserializer) { // First priority is a property creator, see if one exists Object propertyBasedCreator = privateGet(deserializer, "_propertyBasedCreator"); if (propertyBasedCreator != null) { Map<String, SettableBeanProperty> properties = (Map) privateGet(propertyBasedCreator, "_properties"); SettableBeanProperty beanProperty = properties.get("_id"); if (beanProperty != null) { checkType(type, beanProperty.getType().getRawClass()); return beanProperty; } } // Now try setters Iterator<SettableBeanProperty> iter = ((BeanDeserializer) deserializer).properties(); while (iter.hasNext()) { SettableBeanProperty beanProperty = iter.next(); if (beanProperty.getName().equals("_id")) { checkType(type, beanProperty.getType().getRawClass()); return beanProperty; } } } return null; }
try JavaType t = SimpleType.construct(Site.class); BeanProperty p = new Std("", t, null, null); JsonDeserializer<?> siteDeserializer = ctxt .construct(org.springframework.social.alfresco.api.entities.Document.class); BeanProperty p = new Std("", t, null, null); JsonDeserializer<?> documentDeserializer = ctxt .construct(org.springframework.social.alfresco.api.entities.Folder.class); BeanProperty p = new Std("", t, null, null); JsonDeserializer<?> folderDeserializer = ctxt