@Override public PropertyName findNameForSerialization(Annotated a) { if (!(a instanceof AnnotatedField) && !(a instanceof AnnotatedMethod)) { return super.findNameForSerialization(a); } IndexableProperty property = a.getAnnotation(IndexableProperty.class); if (property != null && !property.name().isEmpty()) { return new PropertyName(property.name()); } IndexableComponent component = a.getAnnotation(IndexableComponent.class); if (component != null && !component.name().isEmpty()) { return new PropertyName(component.name()); } IndexableProperties properties = a.getAnnotation(IndexableProperties.class); if (properties != null && !properties.name().isEmpty()) { return new PropertyName(properties.name()); } return PropertyName.USE_DEFAULT; }
@Override public PropertyName findNameForDeserialization(Annotated a) { if (!(a instanceof AnnotatedField) && !(a instanceof AnnotatedMethod)) { return super.findNameForDeserialization(a); } IndexableProperty property = a.getAnnotation(IndexableProperty.class); if (property != null && !property.name().isEmpty()) { return new PropertyName(property.name()); } IndexableComponent component = a.getAnnotation(IndexableComponent.class); if (component != null && !component.name().isEmpty()) { return new PropertyName(component.name()); } IndexableProperties properties = a.getAnnotation(IndexableProperties.class); if (properties != null && !properties.name().isEmpty()) { return new PropertyName(properties.name()); } return PropertyName.USE_DEFAULT; }
private PropertyName getPropertyName( Annotated annotated ) { Column column = annotated.getAnnotation( Column.class ); if ( column != null && StringUtil.isNotEmpty(annotated.getName()) ) { String name = column.name(); name = StringUtil.toUncamel( name ); name = StringUtil.toCamel( name ); return new PropertyName( name ); } JsonProperty jsonProperty = annotated.getAnnotation( JsonProperty.class ); if( jsonProperty != null ) { if( StringUtil.isNotEmpty(jsonProperty.value()) ) { return new PropertyName( jsonProperty.value() ); } else { return PropertyName.USE_DEFAULT; } } return null; }
public PropertyName findNameForDeserialization(Annotated paramAnnotated) { String str; if ((paramAnnotated instanceof AnnotatedField)) str = findDeserializationName((AnnotatedField)paramAnnotated); else if ((paramAnnotated instanceof AnnotatedMethod)) str = findDeserializationName((AnnotatedMethod)paramAnnotated); else if ((paramAnnotated instanceof AnnotatedParameter)) str = findDeserializationName((AnnotatedParameter)paramAnnotated); else str = null; if (str != null) { if (str.length() == 0) return PropertyName.USE_DEFAULT; return new PropertyName(str); } return null; }
public PropertyName findNameForSerialization(Annotated paramAnnotated) { String str; if ((paramAnnotated instanceof AnnotatedField)) str = findSerializationName((AnnotatedField)paramAnnotated); else if ((paramAnnotated instanceof AnnotatedMethod)) str = findSerializationName((AnnotatedMethod)paramAnnotated); else str = null; if (str != null) { if (str.length() == 0) return PropertyName.USE_DEFAULT; return new PropertyName(str); } return null; }
public SettableBeanProperty(String paramString, JavaType paramJavaType, PropertyName paramPropertyName, TypeDeserializer paramTypeDeserializer, Annotations paramAnnotations, boolean paramBoolean) { if ((paramString == null) || (paramString.length() == 0)) this._propName = ""; else this._propName = InternCache.instance.intern(paramString); this._type = paramJavaType; this._wrapperName = paramPropertyName; this._isRequired = paramBoolean; this._contextAnnotations = paramAnnotations; this._viewMatcher = null; this._nullProvider = null; if (paramTypeDeserializer != null) paramTypeDeserializer = paramTypeDeserializer.forProperty(this); this._valueTypeDeserializer = paramTypeDeserializer; this._valueDeserializer = MISSING_VALUE_DESERIALIZER; }
@Override public PropertyName findRootName(AnnotatedClass ac) { ApiModel model = ac.getAnnotation(ApiModel.class); if (model != null) { return new PropertyName(model.value()); } else { return super.findRootName(ac); } }
@Override public PropertyName findNameForDeserialization(Annotated annotated) { List<AnnotatedElement> namedCandidates = getNamedCandidates(annotated); return Stream.concat( namedCandidates.stream() .map(member -> Optional.ofNullable(member.getAnnotation(GraphQLInputField.class)) .map(GraphQLInputField::name)), namedCandidates.stream() .map(member -> Optional.ofNullable(member.getAnnotation(GraphQLQuery.class)) .map(GraphQLQuery::name))) .map(opt -> opt.filter(Utils::notEmpty)) .reduce(Utils::or) .flatMap(optName -> optName.map(PropertyName::new)) .orElse(super.findNameForDeserialization(annotated)); }
@Override public PropertyName findNameForSerialization(Annotated a) { ApiResourceProperty apiName = a.getAnnotation(ApiResourceProperty.class); if (apiName != null && apiName.ignored() != AnnotationBoolean.TRUE) { return PropertyName.construct(apiName.name()); } return null; }
@Override public PropertyName findNameForDeserialization(Annotated a) { ApiResourceProperty apiName = a.getAnnotation(ApiResourceProperty.class); if (apiName != null && apiName.ignored() != AnnotationBoolean.TRUE) { return PropertyName.construct(apiName.name()); } return null; }
@Override public ObjectIdInfo findObjectIdInfo(Annotated annotated) { Class<?> rawClass = annotated.getType().getRawClass(); for (Type<?> type : model.getTypes()) { if (type.getClassType() == rawClass && type.getSingleKeyAttribute() != null) { Attribute<?, ?> attribute = type.getSingleKeyAttribute(); String name = removePrefix(attribute.getPropertyName()); if (useTableNames) { name = attribute.getName(); } // if the name is overridden use that Class<?> superClass = rawClass.getSuperclass(); while (superClass != Object.class && superClass != null) { try { Field field = superClass.getDeclaredField(attribute.getPropertyName()); JsonProperty jsonProperty = field.getAnnotation(JsonProperty.class); if (jsonProperty != null) { name = jsonProperty.value(); break; } } catch (NoSuchFieldException ignored) { } superClass = superClass.getSuperclass(); } return new ObjectIdInfo(new PropertyName(name), rawClass, ObjectIdGenerators.PropertyGenerator.class, EntityStoreResolver.class); } } return super.findObjectIdInfo(annotated); }
@Override public PropertyName findNameForDeserialization(Annotated annotated) { if (useTableNames) { return getMappedName(annotated); } else { return super.findNameForDeserialization(annotated); } }
@Override public PropertyName findNameForSerialization(Annotated annotated) { if (useTableNames) { return getMappedName(annotated); } else { return super.findNameForSerialization(annotated); } }
private PropertyName getMappedName(Annotated annotated) { if (annotated.hasAnnotation(Table.class)) { Table table = annotated.getAnnotation(Table.class); return new PropertyName(table.name()); } if (annotated.hasAnnotation(View.class)) { View view = annotated.getAnnotation(View.class); return new PropertyName(view.name()); } else if (annotated.hasAnnotation(Column.class)) { Column column = annotated.getAnnotation(Column.class); return new PropertyName(column.name()); } else { return null; } }
private PropertyName propertyName(Annotated annotated) { Property element = annotated.getAnnotation(Property.class); if (element != null) { return new PropertyName(element.name(), null); } return null; }
@Override public PropertyName findNameForSerialization(Annotated a) { ApiParam model = a.getAnnotation(ApiParam.class); if (model != null && !"".equals(model.value())) { return new PropertyName(model.value()); } return null; }
@Override public PropertyName findNameForDeserialization(Annotated a) { ApiParam model = a.getAnnotation(ApiParam.class); if (model != null && !"".equals(model.value())) { return new PropertyName(model.value()); } return null; }
protected void _renameWithWrappers() { Iterator localIterator1 = this._properties.entrySet().iterator(); LinkedList localLinkedList = null; while (localIterator1.hasNext()) { POJOPropertyBuilder localPOJOPropertyBuilder3 = (POJOPropertyBuilder)((Map.Entry)localIterator1.next()).getValue(); AnnotatedMember localAnnotatedMember = localPOJOPropertyBuilder3.getPrimaryMember(); if (localAnnotatedMember != null) { PropertyName localPropertyName = this._annotationIntrospector.findWrapperName(localAnnotatedMember); if ((localPropertyName != null) && (localPropertyName.hasSimpleName())) { String str2 = localPropertyName.getSimpleName(); if (!str2.equals(localPOJOPropertyBuilder3.getName())) { if (localLinkedList == null) localLinkedList = new LinkedList(); localLinkedList.add(localPOJOPropertyBuilder3.withName(str2)); localIterator1.remove(); } } } } if (localLinkedList != null) { Iterator localIterator2 = localLinkedList.iterator(); while (localIterator2.hasNext()) { POJOPropertyBuilder localPOJOPropertyBuilder1 = (POJOPropertyBuilder)localIterator2.next(); String str1 = localPOJOPropertyBuilder1.getName(); POJOPropertyBuilder localPOJOPropertyBuilder2 = (POJOPropertyBuilder)this._properties.get(str1); if (localPOJOPropertyBuilder2 == null) this._properties.put(str1, localPOJOPropertyBuilder1); else localPOJOPropertyBuilder2.addAll(localPOJOPropertyBuilder1); } } }
public PropertyName findNameForDeserialization(Annotated paramAnnotated) { PropertyName localPropertyName1 = this._primary.findNameForDeserialization(paramAnnotated); Object localObject = localPropertyName1; if (localPropertyName1 == null) return this._secondary.findNameForDeserialization(paramAnnotated); if (localObject == PropertyName.USE_DEFAULT) { PropertyName localPropertyName2 = this._secondary.findNameForDeserialization(paramAnnotated); if (localPropertyName2 != null) localObject = localPropertyName2; } return localObject; }
public PropertyName findNameForSerialization(Annotated paramAnnotated) { PropertyName localPropertyName1 = this._primary.findNameForSerialization(paramAnnotated); Object localObject = localPropertyName1; if (localPropertyName1 == null) return this._secondary.findNameForSerialization(paramAnnotated); if (localObject == PropertyName.USE_DEFAULT) { PropertyName localPropertyName2 = this._secondary.findNameForSerialization(paramAnnotated); if (localPropertyName2 != null) localObject = localPropertyName2; } return localObject; }
public PropertyName findRootName(AnnotatedClass paramAnnotatedClass) { PropertyName localPropertyName1 = this._primary.findRootName(paramAnnotatedClass); if (localPropertyName1 == null) return this._secondary.findRootName(paramAnnotatedClass); if (localPropertyName1.hasSimpleName()) return localPropertyName1; PropertyName localPropertyName2 = this._secondary.findRootName(paramAnnotatedClass); if (localPropertyName2 == null) return localPropertyName1; return localPropertyName2; }
public PropertyName findWrapperName(Annotated paramAnnotated) { PropertyName localPropertyName1 = this._primary.findWrapperName(paramAnnotated); Object localObject = localPropertyName1; if (localPropertyName1 == null) return this._secondary.findWrapperName(paramAnnotated); if (localObject == PropertyName.USE_DEFAULT) { PropertyName localPropertyName2 = this._secondary.findWrapperName(paramAnnotated); if (localPropertyName2 != null) localObject = localPropertyName2; } return localObject; }
public PropertyName findRootName(AnnotatedClass paramAnnotatedClass) { JsonRootName localJsonRootName = (JsonRootName)paramAnnotatedClass.getAnnotation(JsonRootName.class); if (localJsonRootName == null) return null; return new PropertyName(localJsonRootName.value()); }
public PropertyName getWrapperName() { AnnotatedMember localAnnotatedMember = getPrimaryMember(); if ((localAnnotatedMember == null) || (this._annotationIntrospector == null)) return null; return this._annotationIntrospector.findWrapperName(localAnnotatedMember); }
protected CreatorProperty constructCreatorProperty(DeserializationContext paramDeserializationContext, BeanDescription paramBeanDescription, String paramString, int paramInt, AnnotatedParameter paramAnnotatedParameter, Object paramObject) { DeserializationConfig localDeserializationConfig = paramDeserializationContext.getConfig(); AnnotationIntrospector localAnnotationIntrospector = paramDeserializationContext.getAnnotationIntrospector(); Boolean localBoolean1; if (localAnnotationIntrospector == null) localBoolean1 = null; else localBoolean1 = localAnnotationIntrospector.hasRequiredMarker(paramAnnotatedParameter); Boolean localBoolean2 = localBoolean1; boolean bool1; if (localBoolean1 == null) bool1 = false; else bool1 = localBoolean2.booleanValue(); JavaType localJavaType1 = localDeserializationConfig.getTypeFactory().constructType(paramAnnotatedParameter.getParameterType(), paramBeanDescription.bindingsForBeanType()); BeanProperty.Std localStd = new BeanProperty.Std(paramString, localJavaType1, localAnnotationIntrospector.findWrapperName(paramAnnotatedParameter), paramBeanDescription.getClassAnnotations(), paramAnnotatedParameter, bool1); JavaType localJavaType2 = resolveType(paramDeserializationContext, paramBeanDescription, localJavaType1, paramAnnotatedParameter); if (localJavaType2 != localJavaType1) localStd = localStd.withType(localJavaType2); JsonDeserializer localJsonDeserializer = findDeserializerFromAnnotation(paramDeserializationContext, paramAnnotatedParameter); JavaType localJavaType3 = modifyTypeByAnnotation(paramDeserializationContext, paramAnnotatedParameter, localJavaType2); TypeDeserializer localTypeDeserializer1 = (TypeDeserializer)localJavaType3.getTypeHandler(); TypeDeserializer localTypeDeserializer2 = localTypeDeserializer1; if (localTypeDeserializer1 == null) localTypeDeserializer2 = findTypeDeserializer(localDeserializationConfig, localJavaType3); PropertyName localPropertyName = localStd.getWrapperName(); Annotations localAnnotations = paramBeanDescription.getClassAnnotations(); boolean bool2 = localStd.isRequired(); CreatorProperty localCreatorProperty = new CreatorProperty(paramString, localJavaType3, localPropertyName, localTypeDeserializer2, localAnnotations, paramAnnotatedParameter, paramInt, paramObject, bool2); if (localJsonDeserializer != null) localCreatorProperty = localCreatorProperty.withValueDeserializer(localJsonDeserializer); return localCreatorProperty; }
public CreatorProperty(String paramString, JavaType paramJavaType, PropertyName paramPropertyName, TypeDeserializer paramTypeDeserializer, Annotations paramAnnotations, AnnotatedParameter paramAnnotatedParameter, int paramInt, Object paramObject, boolean paramBoolean) { super(paramString, paramJavaType, paramPropertyName, paramTypeDeserializer, paramAnnotations, paramBoolean); this._annotated = paramAnnotatedParameter; this._creatorIndex = paramInt; this._injectableValueId = paramObject; }
public SerializedString findRootName(Class<?> paramClass, MapperConfig<?> paramMapperConfig) { try { ClassKey localClassKey = new ClassKey(paramClass); if (this._rootNames == null) { this._rootNames = new LRUMap(20, 200); } else { SerializedString localSerializedString1 = (SerializedString)this._rootNames.get(localClassKey); if (localSerializedString1 != null) return localSerializedString1; } BeanDescription localBeanDescription = paramMapperConfig.introspectClassAnnotations(paramClass); PropertyName localPropertyName = paramMapperConfig.getAnnotationIntrospector().findRootName(localBeanDescription.getClassInfo()); String str; if ((localPropertyName == null) || (!localPropertyName.hasSimpleName())) str = paramClass.getSimpleName(); else str = localPropertyName.getSimpleName(); SerializedString localSerializedString2 = new SerializedString(str); this._rootNames.put(localClassKey, localSerializedString2); return localSerializedString2; } finally { } }
@Override public PropertyName findNameForDeserialization(Annotated a) { FieldConfig fieldConfig = a.getAnnotation(FieldConfig.class); if ((fieldConfig != null) && !fieldConfig.writeonly() && fieldConfig.codable()) { return PropertyName.USE_DEFAULT; } return null; }
@Override public PropertyName findNameForSerialization(Annotated a) { FieldConfig fieldConfig = a.getAnnotation(FieldConfig.class); if ((fieldConfig != null) && !fieldConfig.readonly() && fieldConfig.codable()) { return PropertyName.USE_DEFAULT; } return null; }
@Override public PropertyName findNameForSerialization(Annotated ann) { if ("children".equals(getName(ann))) return new PropertyName("child"); if ("coverages".equals(getName(ann))) return new PropertyName("coverage"); return super.findNameForSerialization(ann); }
@Override public SettableBeanProperty withName(PropertyName newName) { return new ErrorReportingSettableBeanProperty( delegate.withName(newName), jsonErrorConsumer); }
@Override public PropertyName findNameForSerialization(Annotated annotated) { return propertyName(annotated); }
@Override public PropertyName findNameForDeserialization(Annotated annotated) { return propertyName(annotated); }
@Override public PropertyName findNameForSerialization( Annotated annotated ) { return getPropertyName( annotated ); }
@Override public PropertyName findNameForDeserialization( Annotated annotated ) { return getPropertyName( annotated ); }
public PropertyName getWrapperName() { return this._wrapperName; }
public List<String> findCreatorPropertyNames() { ArrayList localArrayList = null; for (int i = 0; i < 2; i++) { List localList; if (i == 0) localList = getConstructors(); else localList = getFactoryMethods(); Iterator localIterator = localList.iterator(); while (localIterator.hasNext()) { AnnotatedWithParams localAnnotatedWithParams = (AnnotatedWithParams)localIterator.next(); int j = localAnnotatedWithParams.getParameterCount(); if (j > 0) { PropertyName localPropertyName1 = this._annotationIntrospector.findNameForDeserialization(localAnnotatedWithParams.getParameter(0)); if (localPropertyName1 != null) { if (localArrayList == null) localArrayList = new ArrayList(); localArrayList.add(localPropertyName1.getSimpleName()); for (int k = 1; k < j; k++) { PropertyName localPropertyName2 = this._annotationIntrospector.findNameForDeserialization(localAnnotatedWithParams.getParameter(k)); String str; if (localPropertyName2 == null) str = null; else str = localPropertyName2.getSimpleName(); localArrayList.add(str); } } } } } if (localArrayList == null) return Collections.emptyList(); return localArrayList; }
protected void _addCreators() { AnnotationIntrospector localAnnotationIntrospector = this._annotationIntrospector; if (localAnnotationIntrospector == null) return; Iterator localIterator1 = this._classDef.getConstructors().iterator(); while (localIterator1.hasNext()) { AnnotatedConstructor localAnnotatedConstructor = (AnnotatedConstructor)localIterator1.next(); if (this._creatorProperties == null) this._creatorProperties = new LinkedList(); int k = 0; int m = localAnnotatedConstructor.getParameterCount(); while (k < m) { AnnotatedParameter localAnnotatedParameter2 = localAnnotatedConstructor.getParameter(k); PropertyName localPropertyName2 = localAnnotationIntrospector.findNameForDeserialization(localAnnotatedParameter2); String str3; if (localPropertyName2 == null) str3 = null; else str3 = localPropertyName2.getSimpleName(); String str4 = str3; if (str3 != null) { POJOPropertyBuilder localPOJOPropertyBuilder2 = _property(str4); localPOJOPropertyBuilder2.addCtor(localAnnotatedParameter2, str4, true, false); this._creatorProperties.add(localPOJOPropertyBuilder2); } k++; } } Iterator localIterator2 = this._classDef.getStaticMethods().iterator(); while (localIterator2.hasNext()) { AnnotatedMethod localAnnotatedMethod = (AnnotatedMethod)localIterator2.next(); if (this._creatorProperties == null) this._creatorProperties = new LinkedList(); int i = 0; int j = localAnnotatedMethod.getParameterCount(); while (i < j) { AnnotatedParameter localAnnotatedParameter1 = localAnnotatedMethod.getParameter(i); PropertyName localPropertyName1 = localAnnotationIntrospector.findNameForDeserialization(localAnnotatedParameter1); String str1; if (localPropertyName1 == null) str1 = null; else str1 = localPropertyName1.getSimpleName(); String str2 = str1; if (str1 != null) { POJOPropertyBuilder localPOJOPropertyBuilder1 = _property(str2); localPOJOPropertyBuilder1.addCtor(localAnnotatedParameter1, str2, true, false); this._creatorProperties.add(localPOJOPropertyBuilder1); } i++; } } }