/** * Factory method used when Enum instances are to be deserialized * using a creator (static factory method) * * @return Deserializer based on given factory method * * @since 2.8 */ public static JsonDeserializer<?> deserializerForCreator(DeserializationConfig config, Class<?> enumClass, AnnotatedMethod factory, ValueInstantiator valueInstantiator, SettableBeanProperty[] creatorProps) { if (config.canOverrideAccessModifiers()) { ClassUtil.checkAndFixAccess(factory.getMember(), config.isEnabled(MapperFeature.OVERRIDE_PUBLIC_ACCESS_MODIFIERS)); } return new FactoryBasedEnumDeserializer(enumClass, factory, factory.getParameterType(0), valueInstantiator, creatorProps); }
paramType = setter.getParameterType(0);
keyType = am.getParameterType(0); valueType = am.getParameterType(1); valueType = resolveMemberAndTypeAnnotations(ctxt, mutator, valueType); prop = new BeanProperty.Std(PropertyName.construct(mutator.getName()),
return ((AnnotatedMethod) m).getParameterType(0);
if(propType != null && "void".equals(propType.getRawClass().getName())) { if (member instanceof AnnotatedMethod) { propType = ((AnnotatedMethod)member).getParameterType(0);
new PropertyName("cause")); SettableBeanProperty prop = constructSettableProperty(ctxt, beanDesc, propDef, am.getParameterType(0)); if (prop != null) {
protected JavaType _fullDeserializationType(AnnotatedMember am) { if (am instanceof AnnotatedMethod) { AnnotatedMethod method = (AnnotatedMethod) am; // 27-Nov-2012, tatu: Bit nasty, as we are assuming // things about method signatures here... but has to do if (method.getParameterCount() == 1) { return ((AnnotatedMethod) am).getParameterType(0); } } return am.getType(); }
JavaType propertyType = setter.getParameterType(0); prop = constructSettableProperty(ctxt, beanDesc, propDef, propertyType); } else if (propDef.hasField()) {
protected JavaType _fullDeserializationType(AnnotatedMember am) { if (am instanceof AnnotatedMethod) { AnnotatedMethod method = (AnnotatedMethod) am; // 27-Nov-2012, tatu: Bit nasty, as we are assuming // things about method signatures here... but has to do if (method.getParameterCount() == 1) { return ((AnnotatedMethod) am).getParameterType(0); } } return am.getType(); }
protected JavaType _fullDeserializationType(AnnotatedMember am) { if (am instanceof AnnotatedMethod) { AnnotatedMethod method = (AnnotatedMethod) am; // 27-Nov-2012, tatu: Bit nasty, as we are assuming // things about method signatures here... but has to do if (method.getParameterCount() == 1) { return ((AnnotatedMethod) am).getParameterType(0); } } return am.getType(); }
private JavaType extractType(Annotated annotated) { if (annotated instanceof AnnotatedMethod) { AnnotatedMethod method = (AnnotatedMethod) annotated; if (ClassUtils.isSetter(method.getAnnotated())) { return method.getParameterType(0); } return method.getType(); } return annotated.getType(); }
@Override public Object findDeserializationConverter(Annotated a) { Class<? extends PropertyInterceptor>[] interceptors = getInterceptors(a); if (interceptors == null) { return null; } JavaType javaType = a.getType(); if(a instanceof AnnotatedMethod) { AnnotatedMethod am = (AnnotatedMethod) a; if(am.getParameterCount() == 1) { javaType = am.getParameterType(0); } else { throw new RuntimeException("Invalid property setter: " + am.getAnnotated()); } } return new KvInterceptorsDeserializationConverter(interceptors, new KvPropertyContextImpl(a, javaType)); }
@Override public Object findDeserializationConverter(Annotated a) { JtToMap ann = a.getAnnotation(JtToMap.class); if (ann == null) { return null; } JavaType javaType = a.getType(); if(a instanceof AnnotatedMethod) { AnnotatedMethod am = (AnnotatedMethod) a; if(am.getParameterCount() == 1) { javaType = am.getParameterType(0); } else { throw new RuntimeException("Invalid property setter: " + am.getAnnotated()); } } return new DeserializationConverterImpl(ann, new Ctx(a, javaType)); } }
/** * Factory method used when Enum instances are to be deserialized * using a creator (static factory method) * * @return Deserializer based on given factory method * * @since 2.8 */ public static JsonDeserializer<?> deserializerForCreator(DeserializationConfig config, Class<?> enumClass, AnnotatedMethod factory, ValueInstantiator valueInstantiator, SettableBeanProperty[] creatorProps) { if (config.canOverrideAccessModifiers()) { ClassUtil.checkAndFixAccess(factory.getMember(), config.isEnabled(MapperFeature.OVERRIDE_PUBLIC_ACCESS_MODIFIERS)); } return new FactoryBasedEnumDeserializer(enumClass, factory, factory.getParameterType(0), valueInstantiator, creatorProps); }
/** * Factory method used when Enum instances are to be deserialized * using a creator (static factory method) * * @return Deserializer based on given factory method * * @since 2.8 */ public static JsonDeserializer<?> deserializerForCreator(DeserializationConfig config, Class<?> enumClass, AnnotatedMethod factory, ValueInstantiator valueInstantiator, SettableBeanProperty[] creatorProps) { if (config.canOverrideAccessModifiers()) { ClassUtil.checkAndFixAccess(factory.getMember(), config.isEnabled(MapperFeature.OVERRIDE_PUBLIC_ACCESS_MODIFIERS)); } return new FactoryBasedEnumDeserializer(enumClass, factory, factory.getParameterType(0), valueInstantiator, creatorProps); }
JavaType type; if (m instanceof AnnotatedMethod) { type = ((AnnotatedMethod) m).getParameterType(0); } else { type = m.getType();
return ((AnnotatedMethod) m).getParameterType(0);
if (mutator instanceof AnnotatedMethod) { type = ((AnnotatedMethod) mutator).getParameterType(1); } else if (mutator instanceof AnnotatedField) {
new PropertyName("cause")); SettableBeanProperty prop = constructSettableProperty(ctxt, beanDesc, propDef, am.getParameterType(0)); if (prop != null) {
new PropertyName("cause")); SettableBeanProperty prop = constructSettableProperty(ctxt, beanDesc, propDef, am.getParameterType(0)); if (prop != null) {