protected BeanPropertyWriter _constructWriter(SerializationConfig paramSerializationConfig, TypeBindings paramTypeBindings, PropertyBuilder paramPropertyBuilder, boolean paramBoolean, String paramString, AnnotatedMember paramAnnotatedMember) throws JsonMappingException { if (paramSerializationConfig.isEnabled(SerializationConfig.Feature.CAN_OVERRIDE_ACCESS_MODIFIERS)) paramAnnotatedMember.fixAccess(); JavaType localJavaType = paramAnnotatedMember.getType(paramTypeBindings); BeanProperty.Std localStd = new BeanProperty.Std(paramString, localJavaType, paramPropertyBuilder.getClassAnnotations(), paramAnnotatedMember); JsonSerializer localJsonSerializer = findSerializerFromAnnotation(paramSerializationConfig, paramAnnotatedMember, localStd); boolean bool = ClassUtil.isCollectionMapOrArray(localJavaType.getRawClass()); TypeSerializer localTypeSerializer = null; if (bool) localTypeSerializer = findPropertyContentTypeSerializer(localJavaType, paramSerializationConfig, paramAnnotatedMember, localStd); BeanPropertyWriter localBeanPropertyWriter = paramPropertyBuilder.buildWriter(paramString, localJavaType, localJsonSerializer, findPropertyTypeSerializer(localJavaType, paramSerializationConfig, paramAnnotatedMember, localStd), localTypeSerializer, paramAnnotatedMember, paramBoolean); localBeanPropertyWriter.setViews(paramSerializationConfig.getAnnotationIntrospector().findSerializationViews(paramAnnotatedMember)); return localBeanPropertyWriter; }
protected JavaType getType(TypeBindings paramTypeBindings, TypeVariable<?>[] paramArrayOfTypeVariable) { if ((paramArrayOfTypeVariable != null) && (paramArrayOfTypeVariable.length > 0)) { paramTypeBindings = paramTypeBindings.childInstance(); int i = paramArrayOfTypeVariable.length; int j = 0; if (j < i) { TypeVariable<?> localTypeVariable = paramArrayOfTypeVariable[j]; paramTypeBindings._addPlaceholder(localTypeVariable.getName()); Type localType = localTypeVariable.getBounds()[0]; if (localType == null); for (JavaType localJavaType = TypeFactory.unknownType(); ; localJavaType = paramTypeBindings.resolveType(localType)) { paramTypeBindings.addBinding(localTypeVariable.getName(), localJavaType); j++; break; } } } return paramTypeBindings.resolveType(getGenericType()); }
public Delegating(BasicBeanDescription paramBasicBeanDescription, AnnotatedConstructor paramAnnotatedConstructor, AnnotatedMethod paramAnnotatedMethod) { TypeBindings localTypeBindings = paramBasicBeanDescription.bindingsForBeanType(); if (paramAnnotatedConstructor != null) { this._creator = paramAnnotatedConstructor; this._ctor = paramAnnotatedConstructor.getAnnotated(); this._factoryMethod = null; this._valueType = localTypeBindings.resolveType(paramAnnotatedConstructor.getParameterType(0)); return; } if (paramAnnotatedMethod != null) { this._creator = paramAnnotatedMethod; this._ctor = null; this._factoryMethod = paramAnnotatedMethod.getAnnotated(); this._valueType = localTypeBindings.resolveType(paramAnnotatedMethod.getParameterType(0)); return; } throw new IllegalArgumentException("Internal error: neither delegating constructor nor factory method passed"); }
/** * Secondary helper method for constructing {@link BeanPropertyWriter} for * given member (field or method). */ protected BeanPropertyWriter _constructWriter(SerializationConfig config, TypeBindings typeContext, PropertyBuilder pb, boolean staticTyping, String name, AnnotatedMember propertyMember) { if (config.isEnabled(SerializationConfig.Feature.CAN_OVERRIDE_ACCESS_MODIFIERS)) { propertyMember.fixAccess(); } // Does member specify a serializer? If so, let's use it. JsonSerializer<Object> annotatedSerializer = findSerializerFromAnnotation(config, propertyMember); // And how about polymorphic typing? First special to cover JAXB per-field settings: TypeSerializer contentTypeSer = null; JavaType type = propertyMember.getType(typeContext); if (ClassUtil.isCollectionMapOrArray(type.getRawClass())) { contentTypeSer = findPropertyContentTypeSerializer(type, config, propertyMember); } // and if not JAXB collection/array with annotations, maybe regular type info? TypeSerializer typeSer = findPropertyTypeSerializer(type, config, propertyMember); BeanPropertyWriter pbw = pb.buildProperty(name, annotatedSerializer, typeSer, contentTypeSer, propertyMember, staticTyping); // how about views? (1.4+) AnnotationIntrospector intr = config.getAnnotationIntrospector(); pbw.setViews(intr.findSerializationViews(propertyMember)); return pbw; }
protected BeanPropertyWriter _constructWriter(SerializationConfig paramSerializationConfig, TypeBindings paramTypeBindings, PropertyBuilder paramPropertyBuilder, boolean paramBoolean, String paramString, AnnotatedMember paramAnnotatedMember) { if (paramSerializationConfig.isEnabled(SerializationConfig.Feature.CAN_OVERRIDE_ACCESS_MODIFIERS)) paramAnnotatedMember.fixAccess(); JavaType localJavaType = paramAnnotatedMember.getType(paramTypeBindings); BeanProperty.Std localStd = new BeanProperty.Std(paramString, localJavaType, paramPropertyBuilder.getClassAnnotations(), paramAnnotatedMember); JsonSerializer localJsonSerializer = findSerializerFromAnnotation(paramSerializationConfig, paramAnnotatedMember, localStd); boolean bool = ClassUtil.isCollectionMapOrArray(localJavaType.getRawClass()); TypeSerializer localTypeSerializer = null; if (bool) localTypeSerializer = findPropertyContentTypeSerializer(localJavaType, paramSerializationConfig, paramAnnotatedMember, localStd); BeanPropertyWriter localBeanPropertyWriter = paramPropertyBuilder.buildWriter(paramString, localJavaType, localJsonSerializer, findPropertyTypeSerializer(localJavaType, paramSerializationConfig, paramAnnotatedMember, localStd), localTypeSerializer, paramAnnotatedMember, paramBoolean); localBeanPropertyWriter.setViews(paramSerializationConfig.getAnnotationIntrospector().findSerializationViews(paramAnnotatedMember)); return localBeanPropertyWriter; }
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; }
protected List<BeanPropertyWriter> findBeanProperties(SerializationConfig paramSerializationConfig, BasicBeanDescription paramBasicBeanDescription) throws JsonMappingException { VisibilityChecker localVisibilityChecker1 = paramSerializationConfig.getDefaultVisibilityChecker(); if (!paramSerializationConfig.isEnabled(SerializationConfig.Feature.AUTO_DETECT_GETTERS)) { JsonAutoDetect.Visibility localVisibility3 = JsonAutoDetect.Visibility.NONE; localVisibilityChecker1 = localVisibilityChecker1.withGetterVisibility(localVisibility3); } if (!paramSerializationConfig.isEnabled(SerializationConfig.Feature.AUTO_DETECT_IS_GETTERS)) { JsonAutoDetect.Visibility localVisibility2 = JsonAutoDetect.Visibility.NONE; localVisibilityChecker1 = localVisibilityChecker1.withIsGetterVisibility(localVisibility2); } if (!paramSerializationConfig.isEnabled(SerializationConfig.Feature.AUTO_DETECT_FIELDS)) { JsonAutoDetect.Visibility localVisibility1 = JsonAutoDetect.Visibility.NONE; localVisibilityChecker1 = localVisibilityChecker1.withFieldVisibility(localVisibility1); } AnnotationIntrospector localAnnotationIntrospector = paramSerializationConfig.getAnnotationIntrospector(); VisibilityChecker localVisibilityChecker2 = localAnnotationIntrospector.findAutoDetectVisibility(paramBasicBeanDescription.getClassInfo(), localVisibilityChecker1); LinkedHashMap localLinkedHashMap1 = paramBasicBeanDescription.findGetters(localVisibilityChecker2, null); LinkedHashMap localLinkedHashMap2 = paramBasicBeanDescription.findSerializableFields(localVisibilityChecker2, localLinkedHashMap1.keySet()); removeIgnorableTypes(paramSerializationConfig, paramBasicBeanDescription, localLinkedHashMap1); removeIgnorableTypes(paramSerializationConfig, paramBasicBeanDescription, localLinkedHashMap2); ArrayList localArrayList; if ((localLinkedHashMap1.isEmpty()) && (localLinkedHashMap2.isEmpty())) localArrayList = null; while (true) { return localArrayList; boolean bool = usesStaticTyping(paramSerializationConfig, paramBasicBeanDescription, null, null); PropertyBuilder localPropertyBuilder = constructPropertyBuilder(paramSerializationConfig, paramBasicBeanDescription); int i = localLinkedHashMap1.size(); localArrayList = new ArrayList(i); TypeBindings localTypeBindings = paramBasicBeanDescription.bindingsForBeanType(); Iterator localIterator1 = localLinkedHashMap2.entrySet().iterator(); while (localIterator1.hasNext()) { Map.Entry localEntry2 = (Map.Entry)localIterator1.next(); AnnotationIntrospector.ReferenceProperty localReferenceProperty2 = localAnnotationIntrospector.findReferenceType((AnnotatedMember)localEntry2.getValue()); if ((localReferenceProperty2 != null) && (localReferenceProperty2.isBackReference())) continue; BeanPropertyWriter localBeanPropertyWriter2 = _constructWriter(paramSerializationConfig, localTypeBindings, localPropertyBuilder, bool, (String)localEntry2.getKey(), (AnnotatedMember)localEntry2.getValue()); localArrayList.add(localBeanPropertyWriter2); } Iterator localIterator2 = localLinkedHashMap1.entrySet().iterator(); while (localIterator2.hasNext()) { Map.Entry localEntry1 = (Map.Entry)localIterator2.next(); AnnotationIntrospector.ReferenceProperty localReferenceProperty1 = localAnnotationIntrospector.findReferenceType((AnnotatedMember)localEntry1.getValue()); if ((localReferenceProperty1 != null) && (localReferenceProperty1.isBackReference())) continue; BeanPropertyWriter localBeanPropertyWriter1 = _constructWriter(paramSerializationConfig, localTypeBindings, localPropertyBuilder, bool, (String)localEntry1.getKey(), (AnnotatedMember)localEntry1.getValue()); localArrayList.add(localBeanPropertyWriter1); } } }
public TypeBindings bindingsForBeanType() { if (this._bindings == null) this._bindings = new TypeBindings(this._config.getTypeFactory(), this._type); return this._bindings; }
public JavaType getType(TypeBindings paramTypeBindings) { return getType(paramTypeBindings, this._method.getTypeParameters()); }
public final JavaType resolveParameterType(int paramInt, TypeBindings paramTypeBindings) { return paramTypeBindings.resolveType(getParameterType(paramInt)); }
public JavaType getType(TypeBindings paramTypeBindings) { return paramTypeBindings.resolveType(getGenericType()); }
public JavaType getType(TypeBindings paramTypeBindings) { return getType(paramTypeBindings, this._constructor.getTypeParameters()); }
public final JavaType getType(TypeBindings paramTypeBindings) { return getType(paramTypeBindings, this._method.getTypeParameters()); }
public final JavaType getType(TypeBindings paramTypeBindings) { return getType(paramTypeBindings, this._constructor.getTypeParameters()); }
/** * Full generic type of the annotated element; definition * of what exactly this means depends on sub-class. */ public JavaType getType(TypeBindings context) { return TypeFactory.type(getGenericType(), context); }
public abstract TypeBindings bindingsForBeanType();