Java Code Examples for com.fasterxml.jackson.databind.introspect.AnnotatedMethod#getAnnotated()

The following examples show how to use com.fasterxml.jackson.databind.introspect.AnnotatedMethod#getAnnotated() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JtModule.java    From haven-platform with Apache License 2.0 6 votes vote down vote up
@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));
}
 
Example 2
Source File: KvSupportModule.java    From haven-platform with Apache License 2.0 6 votes vote down vote up
@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));
}
 
Example 3
Source File: SetterlessProperty.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
public SetterlessProperty(BeanPropertyDefinition propDef, JavaType type,
        TypeDeserializer typeDeser, Annotations contextAnnotations, AnnotatedMethod method)
{
    super(propDef, type, typeDeser, contextAnnotations);
    _annotated = method;
    _getter = method.getAnnotated();
}
 
Example 4
Source File: JacksonValueMapper.java    From graphql-spqr with Apache License 2.0 4 votes vote down vote up
TypedElement fromSetter(AnnotatedMethod setterMethod) {
    Method setter = setterMethod.getAnnotated();
    AnnotatedType fieldType = transform(ClassUtils.getParameterTypes(setter, type)[0], setter, type);
    return new TypedElement(fieldType, setter);
}
 
Example 5
Source File: JacksonValueMapper.java    From graphql-spqr with Apache License 2.0 4 votes vote down vote up
TypedElement fromGetter(AnnotatedMethod getterMethod) {
    Method getter = getterMethod.getAnnotated();
    AnnotatedType fieldType = transform(ClassUtils.getReturnType(getter, type), getter, type);
    return new TypedElement(fieldType, getter);
}
 
Example 6
Source File: JacksonResourceSchemaProvider.java    From endpoints-java with Apache License 2.0 4 votes vote down vote up
private static Method toMethod(AnnotatedMethod am) {
  if (am != null) {
    return am.getAnnotated();
  }
  return null;
}