private Type getTypeForAnnotated(Annotated a) { if (a instanceof AnnotatedMethod) { return ((AnnotatedMethod) a).getGenericParameterType(0); } else { return a.getGenericType(); } }
/** * Method that will find if bean has any managed- or back-reference properties, * and if so add them to bean, to be linked during resolution phase. */ protected void addReferenceProperties(DeserializationContext ctxt, BeanDescription beanDesc, BeanDeserializerBuilder builder) throws JsonMappingException { // and then back references, not necessarily found as regular properties Map<String,AnnotatedMember> refs = beanDesc.findBackReferenceProperties(); if (refs != null) { for (Map.Entry<String, AnnotatedMember> en : refs.entrySet()) { String name = en.getKey(); AnnotatedMember m = en.getValue(); Type genericType; if (m instanceof AnnotatedMethod) { genericType = ((AnnotatedMethod) m).getGenericParameterType(0); } else { genericType = m.getRawType(); } SimpleBeanPropertyDefinition propDef = new SimpleBeanPropertyDefinition(m); builder.addBackReferenceProperty(name, constructSettableProperty( ctxt, beanDesc, propDef, genericType)); } } }
/** * Method that will find if bean has any managed- or back-reference properties, * and if so add them to bean, to be linked during resolution phase. */ protected void addReferenceProperties(DeserializationContext ctxt, BeanDescription beanDesc, BeanDeserializerBuilder builder) throws JsonMappingException { // and then back references, not necessarily found as regular properties Map<String,AnnotatedMember> refs = beanDesc.findBackReferenceProperties(); if (refs != null) { for (Map.Entry<String, AnnotatedMember> en : refs.entrySet()) { String name = en.getKey(); AnnotatedMember m = en.getValue(); Type genericType; if (m instanceof AnnotatedMethod) { genericType = ((AnnotatedMethod) m).getGenericParameterType(0); } else { genericType = m.getRawType(); } SimpleBeanPropertyDefinition propDef = new SimpleBeanPropertyDefinition(m); builder.addBackReferenceProperty(name, constructSettableProperty( ctxt, beanDesc, propDef, genericType)); } } }
/** * @since 2.1.2 */ 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 getTypeFactory().constructType(((AnnotatedMethod) am).getGenericParameterType(0), am.getDeclaringClass()); } } return getTypeFactory().constructType(am.getGenericType(), am.getDeclaringClass()); }
/** * @since 2.1.2 */ 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 getTypeFactory().constructType(((AnnotatedMethod) am).getGenericParameterType(0), am.getDeclaringClass()); } } return getTypeFactory().constructType(am.getGenericType(), am.getDeclaringClass()); }
/** * Method that will find if bean has any managed- or back-reference properties, * and if so add them to bean, to be linked during resolution phase. */ protected void addReferenceProperties(DeserializationContext ctxt, BeanDescription beanDesc, BeanDeserializerBuilder builder) throws JsonMappingException { // and then back references, not necessarily found as regular properties Map<String,AnnotatedMember> refs = beanDesc.findBackReferenceProperties(); if (refs != null) { for (Map.Entry<String, AnnotatedMember> en : refs.entrySet()) { String name = en.getKey(); AnnotatedMember m = en.getValue(); Type genericType; if (m instanceof AnnotatedMethod) { genericType = ((AnnotatedMethod) m).getGenericParameterType(0); } else { genericType = m.getRawType(); } SimpleBeanPropertyDefinition propDef = SimpleBeanPropertyDefinition.construct( ctxt.getConfig(), m); builder.addBackReferenceProperty(name, constructSettableProperty( ctxt, beanDesc, propDef, genericType)); } } }
/** * Method that will find if bean has any managed- or back-reference properties, * and if so add them to bean, to be linked during resolution phase. */ protected void addReferenceProperties(DeserializationContext ctxt, BeanDescription beanDesc, BeanDeserializerBuilder builder) throws JsonMappingException { // and then back references, not necessarily found as regular properties Map<String,AnnotatedMember> refs = beanDesc.findBackReferenceProperties(); if (refs != null) { for (Map.Entry<String, AnnotatedMember> en : refs.entrySet()) { String name = en.getKey(); AnnotatedMember m = en.getValue(); Type genericType; if (m instanceof AnnotatedMethod) { genericType = ((AnnotatedMethod) m).getGenericParameterType(0); } else { genericType = m.getRawType(); } SimpleBeanPropertyDefinition propDef = SimpleBeanPropertyDefinition.construct( ctxt.getConfig(), m); builder.addBackReferenceProperty(name, constructSettableProperty( ctxt, beanDesc, propDef, genericType)); } } }
if (factory.getGenericParameterType(0) != String.class) { throw new IllegalArgumentException("Parameter #0 type for factory method ("+factory+") not suitable, must be java.lang.String");
if (factory.getGenericParameterType(0) != String.class) { throw new IllegalArgumentException("Parameter #0 type for factory method ("+factory+") not suitable, must be java.lang.String");
if (factory.getGenericParameterType(0) != String.class) { throw new IllegalArgumentException("Parameter #0 type for factory method ("+factory+") not suitable, must be java.lang.String");
if (factory.getGenericParameterType(0) != String.class) { throw new IllegalArgumentException("Parameter #0 type for factory method ("+factory+") not suitable, must be java.lang.String");
JavaType type = beanDesc.bindingsForBeanType().resolveType(setter.getGenericParameterType(1)); BeanProperty.Std property = new BeanProperty.Std(setter.getName(), type, beanDesc.getClassAnnotations(), setter); type = resolveType(ctxt, beanDesc, type, setter);
JavaType type = beanDesc.bindingsForBeanType().resolveType(setter.getGenericParameterType(1)); BeanProperty.Std property = new BeanProperty.Std(setter.getName(), type, beanDesc.getClassAnnotations(), setter); type = resolveType(ctxt, beanDesc, type, setter);
JavaType type = beanDesc.bindingsForBeanType().resolveType(setter.getGenericParameterType(1)); BeanProperty.Std property = new BeanProperty.Std(new PropertyName(setter.getName()), type, null, beanDesc.getClassAnnotations(), setter,
JavaType type = beanDesc.bindingsForBeanType().resolveType(setter.getGenericParameterType(1)); BeanProperty.Std property = new BeanProperty.Std(new PropertyName(setter.getName()), type, null, beanDesc.getClassAnnotations(), setter,
Type propertyType = propDef.getSetter().getGenericParameterType(0); prop = constructSettableProperty(ctxt, beanDesc, propDef, propertyType);
SimpleBeanPropertyDefinition propDef = new SimpleBeanPropertyDefinition(am, "cause"); SettableBeanProperty prop = constructSettableProperty(ctxt, beanDesc, propDef, am.getGenericParameterType(0)); if (prop != null) {
SimpleBeanPropertyDefinition propDef = new SimpleBeanPropertyDefinition(am, "cause"); SettableBeanProperty prop = constructSettableProperty(ctxt, beanDesc, propDef, am.getGenericParameterType(0)); if (prop != null) {
new PropertyName("cause")); SettableBeanProperty prop = constructSettableProperty(ctxt, beanDesc, propDef, am.getGenericParameterType(0)); if (prop != null) {
new PropertyName("cause")); SettableBeanProperty prop = constructSettableProperty(ctxt, beanDesc, propDef, am.getGenericParameterType(0)); if (prop != null) {