Returns the conversion type for the method and annotations.
544896
static <T> ConvertibleType<T> of(Method getter, TypedMap<T> annotations) {
        return new ConvertibleType<T>(getter.getGenericReturnType(), annotations, getter);
    }
734024
@SuppressWarnings({ "rawtypes" })
    private <T> List<ValidationCaller> findMethods(Class<T> annotated) {
        ResolvedTypeWithMembers annotatedType = memberResolver.resolve(typeResolver.resolve(annotated), annotationConfiguration, null);
        final List<ValidationCaller> callers = Arrays.stream(annotatedType.getMemberMethods())
            .filter(this::isValidationMethod)
            .filter(this::isMethodCorrect)
            .map(m -> new ProxyValidationCaller<>(annotated, m))
            .collect(Collectors.toList());
        if (callers.isEmpty()) {
            log.warn("The class {} is annotated with @SelfValidating but contains no valid methods that are annotated " +
                "with @SelfValidation", annotated);
        }
        return callers;
    }
485877
public static <T extends Annotation> T getAnnotation(Method method, Class<T> annotationClass) {
        T annotation = method.getAnnotation(annotationClass);
        if (annotation == null) {
            annotation = getAnnotation(method.getDeclaringClass(), annotationClass);
        }

        return annotation;
    }
827959
public SlimAnnotatedType<X> getResultingAnnotatedType() {
        if (isDirty()) {
            return ClassTransformer.instance(manager).getUnbackedAnnotatedType(originalAnnotatedType, annotatedType);
        } else {
            return originalAnnotatedType;
        }
    }
1190399
public static String getNameParameterOfType(ModelMethod method, TypeName parameter) {
		for (Pair<String, TypeName> item : method.getParameters()) {
			if (item.value1.equals(parameter)) {
				return item.value0;
			}
		}

		return null;
	}
889198
public Collection<AnnotatedMethod> getMethods() {
        for (Method method : type.getDeclaredMethods()) {
            // only consider methods which have been explicitly declared in the
            // interface
            if (!method.isSynthetic()) {
                Class<?> returnType = method.getReturnType();
                Type genericReturnType = method.getGenericReturnType();
                Class<?>[] parameterTypes = method.getParameterTypes();
                Type[] genericParameterTypes = method.getGenericParameterTypes();
                if (PropertyMethod.GET.matches(method)) {
                    String name = PropertyMethod.GET.getName(method);
                    getters.put(name, method);
                    addType(type, name, returnType, genericReturnType);
                } else if (PropertyMethod.IS.matches(method)) {
                    String name = PropertyMethod.IS.getName(method);
                    getters.put(name, method);
                    addType(type, name, returnType, genericReturnType);
                } else if (PropertyMethod.SET.matches(method)) {
                    String name = PropertyMethod.SET.getName(method);
                    setters.put(name, method);
                    addType(type, name, parameterTypes[0], genericParameterTypes[0]);
                } else {
                    methods.add(method);
                }
            }
        }
        List<AnnotatedMethod> typeMethods = new ArrayList<>();
        Map<String, GetPropertyMethod> getPropertyMethods = new HashMap<>();
        for (Map.Entry<String, Method> methodEntry : getters.entrySet()) {
            String name = methodEntry.getKey();
            Method getter = methodEntry.getValue();
            Class<?> propertyType = types.get(name);
            Type genericType = genericTypes.get(name);
            GetPropertyMethod getPropertyMethod = new GetPropertyMethod(getter, name, propertyType, genericType);
            typeMethods.add(getPropertyMethod);
            getPropertyMethods.put(name, getPropertyMethod);
        }
        for (Map.Entry<String, Method> methodEntry : setters.entrySet()) {
            String name = methodEntry.getKey();
            Method setter = methodEntry.getValue();
            GetPropertyMethod getPropertyMethod = getPropertyMethods.get(name);
            Class<?> propertyType = types.get(name);
            Type genericType = genericTypes.get(name);
            SetPropertyMethod setPropertyMethod = new SetPropertyMethod(setter, getPropertyMethod, name, propertyType, genericType);
            typeMethods.add(setPropertyMethod);
        }
        for (Method method : methods) {
            typeMethods.add(new UserMethod(method));
        }
        return typeMethods;
    }
784677
public static ConversionType getConversionType(final Field destination, final Field source){
		return getConversionType(destination.getType(),source.getType());
	}
1061527
private String buildHandlingMethodName(final EnumEventType annotationType) {

        final StringBuilder methodName = new StringBuilder();
        if (Arrays.asList(getAnnotationValue()).contains(annotationType)) {

            // Lower case the first letter of the annotation name
            methodName.append(this.annotation.annotationType().getSimpleName().substring(0, 1).toLowerCase());
            // Don't change the case for all other letters
            methodName.append(this.annotation.annotationType().getSimpleName().substring(1));
            // Append if necessary the sub type if not equals to any
            methodName.append(Key.Any.name().equals(annotationType.toString()) || Action.Action.name().equals(annotationType.toString()) ? "" : annotationType.name());

            // Add suffix if handling method is named
            final String uniqueName = getAnnotationName();
            if (uniqueName.length() > 0) {
                methodName.append(uniqueName);
            }
        }
        return methodName.toString();
    }
362105
public static Map<String, Object> convert(Object pojo,
                                              Class<? extends Annotation> annotationType) {
        return convert(pojo, annotationType, true);
    }
69536
@SuppressWarnings("unchecked")
	public <T extends Annotation> T getMethodAnnotation(Class<T> annotationType) {
		return (this.method != null ? this.method.getAnnotation(annotationType) :
				(T) this.constructor.getAnnotation(annotationType));
	}
494039
@Override
  public final ImmutableSet<String> getSupportedAnnotationTypes() {
    ImmutableSet.Builder<String> builder = ImmutableSet.builder();
    for (Class<? extends Annotation> annotationClass : getSupportedAnnotationClasses()) {
      builder.add(annotationClass.getCanonicalName());
    }
    return builder.build();
  }
85197
@SuppressWarnings("unchecked")
    public static <E> TypeConverter<E> typeConverterFor(Class<E> cls) throws NoSuchTypeConverterException {
        TypeConverter<E> typeConverter = TYPE_CONVERTERS.get(cls);
        if (typeConverter == null) {
            throw new NoSuchTypeConverterException(cls);
        }
        return typeConverter;
    }
225520
public <T extends Annotation> T getAnnotation(Class<T> annotationType) {
        Annotation value = annotations.get(annotationType);
        return annotationType.cast(value);
    }
942121
public int getTypeAnnotation() {
        int type = 0;
        if (nodeKind == ATTRIBUTE) {
            type = StandardNames.XS_UNTYPED_ATOMIC;
        } else {
            type = StandardNames.XS_UNTYPED;
        }
        return type;
    }
107646
protected <T> TypeConverter findTypeConverter(Class<?> sourceType, Class<T> targetType, Class<? extends Annotation> formattingAnnotation) {
        TypeConverter typeConverter = null;
        List<Class> sourceHierarchy = ClassUtils.resolveHierarchy(sourceType);
        List<Class> targetHierarchy = ClassUtils.resolveHierarchy(targetType);
        boolean hasFormatting = formattingAnnotation != null;
        for (Class sourceSuperType : sourceHierarchy) {
            for (Class targetSuperType : targetHierarchy) {
                ConvertiblePair pair = new ConvertiblePair(sourceSuperType, targetSuperType, formattingAnnotation);
                typeConverter = typeConverters.get(pair);
                if (typeConverter != null) {
                    converterCache.put(pair, typeConverter);
                    return typeConverter;
                }
            }
        }
        if (hasFormatting) {
            for (Class sourceSuperType : sourceHierarchy) {
                for (Class targetSuperType : targetHierarchy) {
                    ConvertiblePair pair = new ConvertiblePair(sourceSuperType, targetSuperType);
                    typeConverter = typeConverters.get(pair);
                    if (typeConverter != null) {
                        converterCache.put(pair, typeConverter);
                        return typeConverter;
                    }
                }
            }
        }
        return typeConverter;
    }
679369
public List<ConversionMethod> getConversionMethods (Class<?> clazz){
		List<ConversionMethod> conversions = new ArrayList<ConversionMethod>();
		Map<String, List<ConversionMethod>> conversionsMap = this.conversionsLoad();
		for (Class<?> classToCheck : getAllsuperClasses(clazz)){
			List<ConversionMethod> methods = conversionsMap.get(classToCheck.getName());
			if(methods != null)conversions.addAll(methods);
		}
		return conversions;
	}
196211
public static <A extends Annotation> A getAnnotation(Method method, Class<A> annotationClass) {
        A annotation = method.getAnnotation(annotationClass);
        if (annotation == null) {
            for (Annotation metaAnnotation : method.getAnnotations()) {
                annotation = metaAnnotation.annotationType().getAnnotation(annotationClass);
                if (annotation != null) {
                    return annotation;
                }
            }
            Method superclassMethod = getOverriddenMethod(method);
            if (superclassMethod != null) {
                annotation = getAnnotation(superclassMethod, annotationClass);
            }
        }
        return annotation;
    }