public void addPropertyConstructor(AnnotatedConstructor paramAnnotatedConstructor, SettableBeanProperty[] paramArrayOfSettableBeanProperty) { this._propertyBasedConstructor = verifyNonDup(paramAnnotatedConstructor, this._propertyBasedConstructor, "property-based"); if (paramArrayOfSettableBeanProperty.length > 1) { HashMap localHashMap = new HashMap(); int i = 0; int j = paramArrayOfSettableBeanProperty.length; while (i < j) { String str = paramArrayOfSettableBeanProperty[i].getName(); Integer localInteger = (Integer)localHashMap.put(str, Integer.valueOf(i)); if (localInteger != null) throw new IllegalArgumentException("Duplicate creator property \"" + str + "\" (index " + localInteger + " vs " + i + ")"); i++; } } this._propertyBasedConstructorProperties = paramArrayOfSettableBeanProperty; }
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"); }
public StringBased(Class<?> paramClass, AnnotatedConstructor paramAnnotatedConstructor, AnnotatedMethod paramAnnotatedMethod) { this._valueClass = paramClass; Constructor localConstructor; Method localMethod; if (paramAnnotatedConstructor == null) { localConstructor = null; this._ctor = localConstructor; localMethod = null; if (paramAnnotatedMethod != null) break label45; } while (true) { this._factoryMethod = localMethod; return; localConstructor = paramAnnotatedConstructor.getAnnotated(); break; label45: localMethod = paramAnnotatedMethod.getAnnotated(); } }
public PropertyBased(AnnotatedConstructor ctor, SettableBeanProperty[] ctorProps, AnnotatedMethod factory, SettableBeanProperty[] factoryProps) { // We will only use one: and constructor has precedence over factory SettableBeanProperty[] props; if (ctor != null) { _ctor = ctor.getAnnotated(); _factoryMethod = null; props = ctorProps; } else if (factory != null) { _ctor = null; _factoryMethod = factory.getAnnotated(); props = factoryProps; } else { throw new IllegalArgumentException("Internal error: neither delegating constructor nor factory method passed"); } _properties = new HashMap<String, SettableBeanProperty>(); for (SettableBeanProperty prop : props) { _properties.put(prop.getPropertyName(), prop); } }
protected ValueInstantiator constructDefaultValueInstantiator(DeserializationConfig paramDeserializationConfig, BasicBeanDescription paramBasicBeanDescription) { boolean bool = paramDeserializationConfig.isEnabled(DeserializationConfig.Feature.CAN_OVERRIDE_ACCESS_MODIFIERS); CreatorCollector localCreatorCollector = new CreatorCollector(paramBasicBeanDescription, bool); AnnotationIntrospector localAnnotationIntrospector = paramDeserializationConfig.getAnnotationIntrospector(); if (paramBasicBeanDescription.getType().isConcrete()) { AnnotatedConstructor localAnnotatedConstructor = paramBasicBeanDescription.findDefaultConstructor(); if (localAnnotatedConstructor != null) { if (bool) ClassUtil.checkAndFixAccess(localAnnotatedConstructor.getAnnotated()); localCreatorCollector.setDefaultConstructor(localAnnotatedConstructor); } } VisibilityChecker localVisibilityChecker1 = paramDeserializationConfig.getDefaultVisibilityChecker(); VisibilityChecker localVisibilityChecker2 = paramDeserializationConfig.getAnnotationIntrospector().findAutoDetectVisibility(paramBasicBeanDescription.getClassInfo(), localVisibilityChecker1); _addDeserializerFactoryMethods(paramDeserializationConfig, paramBasicBeanDescription, localVisibilityChecker2, localAnnotationIntrospector, localCreatorCollector); _addDeserializerConstructors(paramDeserializationConfig, paramBasicBeanDescription, localVisibilityChecker2, localAnnotationIntrospector, localCreatorCollector); return localCreatorCollector.constructValueInstantiator(paramDeserializationConfig); }
protected AnnotatedConstructor verifyNonDup(AnnotatedConstructor paramAnnotatedConstructor1, AnnotatedConstructor paramAnnotatedConstructor2, String paramString) { if (paramAnnotatedConstructor2 != null) throw new IllegalArgumentException("Conflicting " + paramString + " constructors: already had " + paramAnnotatedConstructor2 + ", encountered " + paramAnnotatedConstructor1); if (this._canFixAccess) ClassUtil.checkAndFixAccess(paramAnnotatedConstructor1.getAnnotated()); return paramAnnotatedConstructor1; }
public NumberBased(Class<?> paramClass, AnnotatedConstructor paramAnnotatedConstructor1, AnnotatedMethod paramAnnotatedMethod1, AnnotatedConstructor paramAnnotatedConstructor2, AnnotatedMethod paramAnnotatedMethod2) { this._valueClass = paramClass; Constructor localConstructor1; Constructor localConstructor2; label30: Method localMethod1; label43: Method localMethod2; if (paramAnnotatedConstructor1 == null) { localConstructor1 = null; this._intCtor = localConstructor1; if (paramAnnotatedConstructor2 != null) break label73; localConstructor2 = null; this._longCtor = localConstructor2; if (paramAnnotatedMethod1 != null) break label83; localMethod1 = null; this._intFactoryMethod = localMethod1; localMethod2 = null; if (paramAnnotatedMethod2 != null) break label92; } while (true) { this._longFactoryMethod = localMethod2; return; localConstructor1 = paramAnnotatedConstructor1.getAnnotated(); break; label73: localConstructor2 = paramAnnotatedConstructor2.getAnnotated(); break label30; label83: localMethod1 = paramAnnotatedMethod1.getAnnotated(); break label43; label92: localMethod2 = paramAnnotatedMethod2.getAnnotated(); } }
protected AnnotatedConstructor verifyNonDup(AnnotatedConstructor newOne, AnnotatedConstructor oldOne, String type) { if (oldOne != null) { throw new IllegalArgumentException("Conflicting "+type+" constructors: already had "+oldOne+", encountered "+newOne); } if (_canFixAccess) { ClassUtil.checkAndFixAccess(newOne.getAnnotated()); } return newOne; }
public StringBased(Class<?> valueClass, AnnotatedConstructor ctor, AnnotatedMethod factoryMethod) { _valueClass = valueClass; _ctor = (ctor == null) ? null : ctor.getAnnotated(); _factoryMethod = (factoryMethod == null) ? null : factoryMethod.getAnnotated(); }
public NumberBased(Class<?> valueClass, AnnotatedConstructor intCtor, AnnotatedMethod ifm, AnnotatedConstructor longCtor, AnnotatedMethod lfm) { _valueClass = valueClass; _intCtor = (intCtor == null) ? null : intCtor.getAnnotated(); _longCtor = (longCtor == null) ? null : longCtor.getAnnotated(); _intFactoryMethod = (ifm == null) ? null : ifm.getAnnotated(); _longFactoryMethod = (lfm == null) ? null : lfm.getAnnotated(); }
public Delegating(AnnotatedConstructor ctor, AnnotatedMethod factory) { if (ctor != null) { _ctor = ctor.getAnnotated(); _factoryMethod = null; _valueType = TypeFactory.type(ctor.getParameterType(0)); } else if (factory != null) { _ctor = null; _factoryMethod = factory.getAnnotated(); _valueType = TypeFactory.type(factory.getParameterType(0)); } else { throw new IllegalArgumentException("Internal error: neither delegating constructor nor factory method passed"); } }
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; }
protected CreatorContainer findMapCreators(DeserializationConfig paramDeserializationConfig, BasicBeanDescription paramBasicBeanDescription) throws JsonMappingException { AnnotationIntrospector localAnnotationIntrospector = paramDeserializationConfig.getAnnotationIntrospector(); CreatorContainer localCreatorContainer = new CreatorContainer(paramBasicBeanDescription, paramDeserializationConfig.isEnabled(DeserializationConfig.Feature.CAN_OVERRIDE_ACCESS_MODIFIERS)); Iterator localIterator1 = paramBasicBeanDescription.getConstructors().iterator(); while (localIterator1.hasNext()) { AnnotatedConstructor localAnnotatedConstructor = (AnnotatedConstructor)localIterator1.next(); int m = localAnnotatedConstructor.getParameterCount(); if ((m < 1) || (!localAnnotationIntrospector.hasCreatorAnnotation(localAnnotatedConstructor))) continue; SettableBeanProperty[] arrayOfSettableBeanProperty2 = new SettableBeanProperty[m]; int n = 0; for (int i1 = 0; i1 < m; i1++) { AnnotatedParameter localAnnotatedParameter2 = localAnnotatedConstructor.getParameter(i1); if (localAnnotatedParameter2 == null); for (String str2 = null; (str2 == null) || (str2.length() == 0); str2 = localAnnotationIntrospector.findPropertyNameForParam(localAnnotatedParameter2)) throw new IllegalArgumentException("Parameter #" + i1 + " of constructor " + localAnnotatedConstructor + " has no property name annotation: must have for @JsonCreator for a Map type"); n++; arrayOfSettableBeanProperty2[i1] = constructCreatorProperty(paramDeserializationConfig, paramBasicBeanDescription, str2, i1, localAnnotatedParameter2); } localCreatorContainer.addPropertyConstructor(localAnnotatedConstructor, arrayOfSettableBeanProperty2); } Iterator localIterator2 = paramBasicBeanDescription.getFactoryMethods().iterator(); while (localIterator2.hasNext()) { AnnotatedMethod localAnnotatedMethod = (AnnotatedMethod)localIterator2.next(); int i = localAnnotatedMethod.getParameterCount(); if ((i < 1) || (!localAnnotationIntrospector.hasCreatorAnnotation(localAnnotatedMethod))) continue; SettableBeanProperty[] arrayOfSettableBeanProperty1 = new SettableBeanProperty[i]; int j = 0; for (int k = 0; k < i; k++) { AnnotatedParameter localAnnotatedParameter1 = localAnnotatedMethod.getParameter(k); if (localAnnotatedParameter1 == null); for (String str1 = null; (str1 == null) || (str1.length() == 0); str1 = localAnnotationIntrospector.findPropertyNameForParam(localAnnotatedParameter1)) throw new IllegalArgumentException("Parameter #" + k + " of factory method " + localAnnotatedMethod + " has no property name annotation: must have for @JsonCreator for a Map type"); j++; arrayOfSettableBeanProperty1[k] = constructCreatorProperty(paramDeserializationConfig, paramBasicBeanDescription, str1, k, localAnnotatedParameter1); } localCreatorContainer.addPropertyFactory(localAnnotatedMethod, arrayOfSettableBeanProperty1); } return localCreatorContainer; }
public void addDelegatingConstructor(AnnotatedConstructor paramAnnotatedConstructor) { this._delegatingConstructor = verifyNonDup(paramAnnotatedConstructor, this._delegatingConstructor, "long"); }
public void addIntConstructor(AnnotatedConstructor paramAnnotatedConstructor) { this._intConstructor = verifyNonDup(paramAnnotatedConstructor, this._intConstructor, "int"); }
public void addLongConstructor(AnnotatedConstructor paramAnnotatedConstructor) { this._longConstructor = verifyNonDup(paramAnnotatedConstructor, this._longConstructor, "long"); }
public void addStringConstructor(AnnotatedConstructor paramAnnotatedConstructor) { this._strConstructor = verifyNonDup(paramAnnotatedConstructor, this._strConstructor, "String"); }
public PropertyBased(AnnotatedConstructor paramAnnotatedConstructor, SettableBeanProperty[] paramArrayOfSettableBeanProperty1, AnnotatedMethod paramAnnotatedMethod, SettableBeanProperty[] paramArrayOfSettableBeanProperty2) { SettableBeanProperty[] arrayOfSettableBeanProperty; if (paramAnnotatedConstructor != null) { this._ctor = paramAnnotatedConstructor.getAnnotated(); this._factoryMethod = null; arrayOfSettableBeanProperty = paramArrayOfSettableBeanProperty1; } Object[] arrayOfObject; while (true) { this._properties = new HashMap(); arrayOfObject = null; int i = 0; int j = arrayOfSettableBeanProperty.length; while (true) if (i < j) { SettableBeanProperty localSettableBeanProperty = arrayOfSettableBeanProperty[i]; this._properties.put(localSettableBeanProperty.getName(), localSettableBeanProperty); if (localSettableBeanProperty.getType().isPrimitive()) { if (arrayOfObject == null) arrayOfObject = new Object[j]; arrayOfObject[i] = ClassUtil.defaultValue(localSettableBeanProperty.getType().getRawClass()); } i++; continue; if (paramAnnotatedMethod != null) { this._ctor = null; this._factoryMethod = paramAnnotatedMethod.getAnnotated(); arrayOfSettableBeanProperty = paramArrayOfSettableBeanProperty2; break; } throw new IllegalArgumentException("Internal error: neither delegating constructor nor factory method passed"); } } this._defaultValues = arrayOfObject; }
public boolean isIgnorableConstructor(AnnotatedConstructor paramAnnotatedConstructor) { return (this._primary.isIgnorableConstructor(paramAnnotatedConstructor)) || (this._secondary.isIgnorableConstructor(paramAnnotatedConstructor)); }
public void addStringConstructor(AnnotatedConstructor ctor) { _strConstructor = verifyNonDup(ctor, _strConstructor, "String"); }
public void addIntConstructor(AnnotatedConstructor ctor) { _intConstructor = verifyNonDup(ctor, _intConstructor, "int"); }
public void addLongConstructor(AnnotatedConstructor ctor) { _longConstructor = verifyNonDup(ctor, _longConstructor, "long"); }
public void addDelegatingConstructor(AnnotatedConstructor ctor) { _delegatingConstructor = verifyNonDup(ctor, _delegatingConstructor, "long"); }
public void addPropertyConstructor(AnnotatedConstructor ctor, SettableBeanProperty[] properties) { _propertyBasedConstructor = verifyNonDup(ctor, _propertyBasedConstructor, "property-based"); _propertyBasedConstructorProperties = properties; }
public void setDefaultConstructor(AnnotatedConstructor paramAnnotatedConstructor) { this._defaultConstructor = paramAnnotatedConstructor; }
protected boolean _handleSingleArgumentConstructor(DeserializationConfig paramDeserializationConfig, BasicBeanDescription paramBasicBeanDescription, VisibilityChecker<?> paramVisibilityChecker, AnnotationIntrospector paramAnnotationIntrospector, CreatorCollector paramCreatorCollector, AnnotatedConstructor paramAnnotatedConstructor, boolean paramBoolean1, boolean paramBoolean2) { AnnotatedParameter localAnnotatedParameter = paramAnnotatedConstructor.getParameter(0); String str = paramAnnotationIntrospector.findPropertyNameForParam(localAnnotatedParameter); Object localObject = paramAnnotationIntrospector.findInjectableValueId(localAnnotatedParameter); if ((localObject != null) || ((str != null) && (str.length() > 0))) { CreatorProperty[] arrayOfCreatorProperty = new CreatorProperty[1]; arrayOfCreatorProperty[0] = constructCreatorProperty(paramDeserializationConfig, paramBasicBeanDescription, str, 0, localAnnotatedParameter, localObject); paramCreatorCollector.addPropertyCreator(paramAnnotatedConstructor, arrayOfCreatorProperty); return true; } Class localClass = paramAnnotatedConstructor.getParameterClass(0); if (localClass == String.class) { if ((paramBoolean1) || (paramBoolean2)) paramCreatorCollector.addStringCreator(paramAnnotatedConstructor); return true; } if ((localClass == Integer.TYPE) || (localClass == Integer.class)) { if ((paramBoolean1) || (paramBoolean2)) paramCreatorCollector.addIntCreator(paramAnnotatedConstructor); return true; } if ((localClass == Long.TYPE) || (localClass == Long.class)) { if ((paramBoolean1) || (paramBoolean2)) paramCreatorCollector.addLongCreator(paramAnnotatedConstructor); return true; } if ((localClass == Double.TYPE) || (localClass == Double.class)) { if ((paramBoolean1) || (paramBoolean2)) paramCreatorCollector.addDoubleCreator(paramAnnotatedConstructor); return true; } if (paramBoolean1) { paramCreatorCollector.addDelegatingCreator(paramAnnotatedConstructor); return true; } return false; }
public abstract boolean isIgnorableConstructor(AnnotatedConstructor paramAnnotatedConstructor);