protected void addReferenceProperties(DeserializationConfig paramDeserializationConfig, BasicBeanDescription paramBasicBeanDescription, BeanDeserializerBuilder paramBeanDeserializerBuilder) throws JsonMappingException { Map localMap = paramBasicBeanDescription.findBackReferenceProperties(); if (localMap != null) { Iterator localIterator = localMap.entrySet().iterator(); while (localIterator.hasNext()) { Map.Entry localEntry = (Map.Entry)localIterator.next(); String str = (String)localEntry.getKey(); AnnotatedMember localAnnotatedMember = (AnnotatedMember)localEntry.getValue(); if ((localAnnotatedMember instanceof AnnotatedMethod)) { paramBeanDeserializerBuilder.addBackReferenceProperty(str, constructSettableProperty(paramDeserializationConfig, paramBasicBeanDescription, localAnnotatedMember.getName(), (AnnotatedMethod)localAnnotatedMember)); continue; } paramBeanDeserializerBuilder.addBackReferenceProperty(str, constructSettableProperty(paramDeserializationConfig, paramBasicBeanDescription, localAnnotatedMember.getName(), (AnnotatedField)localAnnotatedMember)); } } }
protected SettableBeanProperty constructSettableProperty(DeserializationConfig paramDeserializationConfig, BasicBeanDescription paramBasicBeanDescription, String paramString, AnnotatedField paramAnnotatedField) throws JsonMappingException { if (paramDeserializationConfig.isEnabled(DeserializationConfig.Feature.CAN_OVERRIDE_ACCESS_MODIFIERS)) paramAnnotatedField.fixAccess(); JavaType localJavaType1 = paramBasicBeanDescription.bindingsForBeanType().resolveType(paramAnnotatedField.getGenericType()); BeanProperty.Std localStd = new BeanProperty.Std(paramString, localJavaType1, paramBasicBeanDescription.getClassAnnotations(), paramAnnotatedField); JavaType localJavaType2 = resolveType(paramDeserializationConfig, paramBasicBeanDescription, localJavaType1, paramAnnotatedField, localStd); if (localJavaType2 != localJavaType1) localStd = localStd.withType(localJavaType2); JsonDeserializer localJsonDeserializer = findDeserializerFromAnnotation(paramDeserializationConfig, paramAnnotatedField, localStd); JavaType localJavaType3 = modifyTypeByAnnotation(paramDeserializationConfig, paramAnnotatedField, localJavaType2, paramString); SettableBeanProperty.FieldProperty localFieldProperty = new SettableBeanProperty.FieldProperty(paramString, localJavaType3, (TypeDeserializer)localJavaType3.getTypeHandler(), paramBasicBeanDescription.getClassAnnotations(), paramAnnotatedField); if (localJsonDeserializer != null) localFieldProperty.setValueDeserializer(localJsonDeserializer); AnnotationIntrospector.ReferenceProperty localReferenceProperty = paramDeserializationConfig.getAnnotationIntrospector().findReferenceType(paramAnnotatedField); if ((localReferenceProperty != null) && (localReferenceProperty.isManagedReference())) localFieldProperty.setManagedReferenceName(localReferenceProperty.getName()); return localFieldProperty; }
public String findDeserializablePropertyName(AnnotatedField paramAnnotatedField) { String str1 = this._primary.findDeserializablePropertyName(paramAnnotatedField); if (str1 == null) str1 = this._secondary.findDeserializablePropertyName(paramAnnotatedField); String str2; do { do return str1; while (str1.length() != 0); str2 = this._secondary.findDeserializablePropertyName(paramAnnotatedField); } while (str2 == null); return str2; }
public String findSerializablePropertyName(AnnotatedField paramAnnotatedField) { String str1 = this._primary.findSerializablePropertyName(paramAnnotatedField); if (str1 == null) str1 = this._secondary.findSerializablePropertyName(paramAnnotatedField); String str2; do { do return str1; while (str1.length() != 0); str2 = this._secondary.findSerializablePropertyName(paramAnnotatedField); } while (str2 == null); return str2; }
protected void addReferenceProperties(DeserializationConfig paramDeserializationConfig, BasicBeanDescription paramBasicBeanDescription, BeanDeserializerBuilder paramBeanDeserializerBuilder) { Map localMap = paramBasicBeanDescription.findBackReferenceProperties(); if (localMap != null) { Iterator localIterator = localMap.entrySet().iterator(); while (localIterator.hasNext()) { Map.Entry localEntry = (Map.Entry)localIterator.next(); String str = (String)localEntry.getKey(); AnnotatedMember localAnnotatedMember = (AnnotatedMember)localEntry.getValue(); if ((localAnnotatedMember instanceof AnnotatedMethod)) paramBeanDeserializerBuilder.addBackReferenceProperty(str, constructSettableProperty(paramDeserializationConfig, paramBasicBeanDescription, localAnnotatedMember.getName(), (AnnotatedMethod)localAnnotatedMember)); else paramBeanDeserializerBuilder.addBackReferenceProperty(str, constructSettableProperty(paramDeserializationConfig, paramBasicBeanDescription, localAnnotatedMember.getName(), (AnnotatedField)localAnnotatedMember)); } } }
protected SettableBeanProperty constructSettableProperty(DeserializationConfig paramDeserializationConfig, BasicBeanDescription paramBasicBeanDescription, String paramString, AnnotatedField paramAnnotatedField) { if (paramDeserializationConfig.isEnabled(DeserializationConfig.Feature.CAN_OVERRIDE_ACCESS_MODIFIERS)) paramAnnotatedField.fixAccess(); JavaType localJavaType1 = paramBasicBeanDescription.bindingsForBeanType().resolveType(paramAnnotatedField.getGenericType()); BeanProperty.Std localStd = new BeanProperty.Std(paramString, localJavaType1, paramBasicBeanDescription.getClassAnnotations(), paramAnnotatedField); JavaType localJavaType2 = resolveType(paramDeserializationConfig, paramBasicBeanDescription, localJavaType1, paramAnnotatedField, localStd); if (localJavaType2 != localJavaType1) localStd = localStd.withType(localJavaType2); JsonDeserializer localJsonDeserializer = findDeserializerFromAnnotation(paramDeserializationConfig, paramAnnotatedField, localStd); JavaType localJavaType3 = modifyTypeByAnnotation(paramDeserializationConfig, paramAnnotatedField, localJavaType2, paramString); Object localObject = new SettableBeanProperty.FieldProperty(paramString, localJavaType3, (TypeDeserializer)localJavaType3.getTypeHandler(), paramBasicBeanDescription.getClassAnnotations(), paramAnnotatedField); if (localJsonDeserializer != null) localObject = ((SettableBeanProperty)localObject).withValueDeserializer(localJsonDeserializer); AnnotationIntrospector.ReferenceProperty localReferenceProperty = paramDeserializationConfig.getAnnotationIntrospector().findReferenceType(paramAnnotatedField); if ((localReferenceProperty != null) && (localReferenceProperty.isManagedReference())) ((SettableBeanProperty)localObject).setManagedReferenceName(localReferenceProperty.getName()); return localObject; }
protected List<BeanPropertyWriter> findBeanProperties(SerializationConfig paramSerializationConfig, BasicBeanDescription paramBasicBeanDescription) { List localList = paramBasicBeanDescription.findProperties(); AnnotationIntrospector localAnnotationIntrospector = paramSerializationConfig.getAnnotationIntrospector(); removeIgnorableTypes(paramSerializationConfig, paramBasicBeanDescription, localList); if (paramSerializationConfig.isEnabled(SerializationConfig.Feature.REQUIRE_SETTERS_FOR_GETTERS)) removeSetterlessGetters(paramSerializationConfig, paramBasicBeanDescription, localList); if (localList.isEmpty()) return null; boolean bool = usesStaticTyping(paramSerializationConfig, paramBasicBeanDescription, null, null); PropertyBuilder localPropertyBuilder = constructPropertyBuilder(paramSerializationConfig, paramBasicBeanDescription); ArrayList localArrayList = new ArrayList(localList.size()); TypeBindings localTypeBindings = paramBasicBeanDescription.bindingsForBeanType(); Iterator localIterator = localList.iterator(); while (localIterator.hasNext()) { BeanPropertyDefinition localBeanPropertyDefinition = (BeanPropertyDefinition)localIterator.next(); AnnotatedMember localAnnotatedMember = localBeanPropertyDefinition.getAccessor(); AnnotationIntrospector.ReferenceProperty localReferenceProperty = localAnnotationIntrospector.findReferenceType(localAnnotatedMember); if ((localReferenceProperty == null) || (!localReferenceProperty.isBackReference())) { String str = localBeanPropertyDefinition.getName(); if ((localAnnotatedMember instanceof AnnotatedMethod)) localArrayList.add(_constructWriter(paramSerializationConfig, localTypeBindings, localPropertyBuilder, bool, str, (AnnotatedMethod)localAnnotatedMember)); else localArrayList.add(_constructWriter(paramSerializationConfig, localTypeBindings, localPropertyBuilder, bool, str, (AnnotatedField)localAnnotatedMember)); } } return localArrayList; }
public boolean hasIgnoreMarker(AnnotatedMember paramAnnotatedMember) { if ((paramAnnotatedMember instanceof AnnotatedMethod)) return isIgnorableMethod((AnnotatedMethod)paramAnnotatedMember); if ((paramAnnotatedMember instanceof AnnotatedField)) return isIgnorableField((AnnotatedField)paramAnnotatedMember); if ((paramAnnotatedMember instanceof AnnotatedConstructor)) return isIgnorableConstructor((AnnotatedConstructor)paramAnnotatedMember); return false; }
@Override public boolean isFieldVisible(AnnotatedField f) { return false; }
@Override public String nameForField(MapperConfig<?> config, AnnotatedField field, String defaultName) { return convert(defaultName); }
public FieldProperty(String paramString, JavaType paramJavaType, TypeDeserializer paramTypeDeserializer, Annotations paramAnnotations, AnnotatedField paramAnnotatedField) { super(paramJavaType, paramTypeDeserializer, paramAnnotations); this._annotated = paramAnnotatedField; this._field = paramAnnotatedField.getAnnotated(); }
public boolean isIgnorableField(AnnotatedField paramAnnotatedField) { return (this._primary.isIgnorableField(paramAnnotatedField)) || (this._secondary.isIgnorableField(paramAnnotatedField)); }
public String nameForField(MapperConfig<?> paramMapperConfig, AnnotatedField paramAnnotatedField, String paramString) { return paramString; }
/** * @param contentTypeSer Optional explicit type information serializer * to use for contained values (only used for properties that are * of container type) */ protected BeanPropertyWriter buildProperty(String name, JsonSerializer<Object> ser, TypeSerializer typeSer, TypeSerializer contentTypeSer, AnnotatedMember am, boolean defaultUseStaticTyping) { Field f; Method m; if (am instanceof AnnotatedField) { m = null; f = ((AnnotatedField) am).getAnnotated(); } else { m = ((AnnotatedMethod) am).getAnnotated(); f = null; } // do we have annotation that forces type to use (to declared type or its super type)? JavaType serializationType = findSerializationType(am, defaultUseStaticTyping); // Container types can have separate type serializers for content (value / element) type if (contentTypeSer != null) { /* 04-Feb-2010, tatu: Let's force static typing for collection, if there is * type information for contents. Should work well (for JAXB case); can be * revisited if this causes problems. */ if (serializationType == null) { serializationType = TypeFactory.type(am.getGenericType()); } JavaType ct = serializationType.getContentType(); ct.setTypeHandler(contentTypeSer); } Object suppValue = null; boolean suppressNulls = false; JsonSerialize.Inclusion methodProps = _annotationIntrospector.findSerializationInclusion(am, _outputProps); if (methodProps != null) { switch (methodProps) { case NON_DEFAULT: suppValue = getDefaultValue(name, m, f); if (suppValue == null) { suppressNulls = true; } break; case NON_NULL: suppressNulls = true; break; } } return new BeanPropertyWriter(name, ser, typeSer, serializationType, m, f, suppressNulls, suppValue); }
public String nameForField(MapperConfig<?> paramMapperConfig, AnnotatedField paramAnnotatedField, String paramString) { return translate(paramString); }
protected void addBeanProps(DeserializationConfig paramDeserializationConfig, BasicBeanDescription paramBasicBeanDescription, BeanDeserializerBuilder paramBeanDeserializerBuilder) { List localList = paramBasicBeanDescription.findProperties(); AnnotationIntrospector localAnnotationIntrospector = paramDeserializationConfig.getAnnotationIntrospector(); Boolean localBoolean = localAnnotationIntrospector.findIgnoreUnknownProperties(paramBasicBeanDescription.getClassInfo()); if (localBoolean != null) paramBeanDeserializerBuilder.setIgnoreUnknownProperties(localBoolean.booleanValue()); HashSet localHashSet = ArrayBuilders.arrayToSet(localAnnotationIntrospector.findPropertiesToIgnore(paramBasicBeanDescription.getClassInfo())); Iterator localIterator1 = localHashSet.iterator(); while (localIterator1.hasNext()) paramBeanDeserializerBuilder.addIgnorable((String)localIterator1.next()); Set localSet = paramBasicBeanDescription.getIgnoredPropertyNames(); if (localSet != null) { Iterator localIterator4 = localSet.iterator(); while (localIterator4.hasNext()) paramBeanDeserializerBuilder.addIgnorable((String)localIterator4.next()); } HashMap localHashMap = new HashMap(); Iterator localIterator2 = localList.iterator(); while (localIterator2.hasNext()) { BeanPropertyDefinition localBeanPropertyDefinition2 = (BeanPropertyDefinition)localIterator2.next(); String str2 = localBeanPropertyDefinition2.getName(); if (!localHashSet.contains(str2)) if (localBeanPropertyDefinition2.hasConstructorParameter()) { paramBeanDeserializerBuilder.addCreatorProperty(localBeanPropertyDefinition2); } else if (localBeanPropertyDefinition2.hasSetter()) { AnnotatedMethod localAnnotatedMethod3 = localBeanPropertyDefinition2.getSetter(); if (isIgnorableType(paramDeserializationConfig, paramBasicBeanDescription, localAnnotatedMethod3.getParameterClass(0), localHashMap)) { paramBeanDeserializerBuilder.addIgnorable(str2); } else { SettableBeanProperty localSettableBeanProperty2 = constructSettableProperty(paramDeserializationConfig, paramBasicBeanDescription, str2, localAnnotatedMethod3); if (localSettableBeanProperty2 != null) paramBeanDeserializerBuilder.addProperty(localSettableBeanProperty2); } } else if (localBeanPropertyDefinition2.hasField()) { AnnotatedField localAnnotatedField = localBeanPropertyDefinition2.getField(); if (isIgnorableType(paramDeserializationConfig, paramBasicBeanDescription, localAnnotatedField.getRawType(), localHashMap)) { paramBeanDeserializerBuilder.addIgnorable(str2); } else { SettableBeanProperty localSettableBeanProperty1 = constructSettableProperty(paramDeserializationConfig, paramBasicBeanDescription, str2, localAnnotatedField); if (localSettableBeanProperty1 != null) paramBeanDeserializerBuilder.addProperty(localSettableBeanProperty1); } } } AnnotatedMethod localAnnotatedMethod1 = paramBasicBeanDescription.findAnySetter(); if (localAnnotatedMethod1 != null) paramBeanDeserializerBuilder.setAnySetter(constructAnySetter(paramDeserializationConfig, paramBasicBeanDescription, localAnnotatedMethod1)); if (paramDeserializationConfig.isEnabled(DeserializationConfig.Feature.USE_GETTERS_AS_SETTERS)) { Iterator localIterator3 = localList.iterator(); while (localIterator3.hasNext()) { BeanPropertyDefinition localBeanPropertyDefinition1 = (BeanPropertyDefinition)localIterator3.next(); if (localBeanPropertyDefinition1.hasGetter()) { String str1 = localBeanPropertyDefinition1.getName(); if ((!paramBeanDeserializerBuilder.hasProperty(str1)) && (!localHashSet.contains(str1))) { AnnotatedMethod localAnnotatedMethod2 = localBeanPropertyDefinition1.getGetter(); Class localClass = localAnnotatedMethod2.getRawType(); if (((Collection.class.isAssignableFrom(localClass)) || (Map.class.isAssignableFrom(localClass))) && (!localHashSet.contains(str1)) && (!paramBeanDeserializerBuilder.hasProperty(str1))) paramBeanDeserializerBuilder.addProperty(constructSetterlessProperty(paramDeserializationConfig, paramBasicBeanDescription, str1, localAnnotatedMethod2)); } } } } }
public SettableBeanProperty$FieldProperty(String paramString, JavaType paramJavaType, TypeDeserializer paramTypeDeserializer, Annotations paramAnnotations, AnnotatedField paramAnnotatedField) { super(paramString, paramJavaType, paramTypeDeserializer, paramAnnotations); this._annotated = paramAnnotatedField; this._field = paramAnnotatedField.getAnnotated(); }
public abstract String findDeserializablePropertyName(AnnotatedField paramAnnotatedField);
public abstract String findSerializablePropertyName(AnnotatedField paramAnnotatedField);
public abstract boolean isIgnorableField(AnnotatedField paramAnnotatedField);
public abstract AnnotatedField getField();