use of com.fasterxml.classmate.MemberResolver in project dropwizard by dropwizard.
the class SelfValidatingValidatorTest method getMethod.
private ResolvedMethod getMethod(String name, Class<?>... params) {
AnnotationConfiguration annotationConfiguration = new AnnotationConfiguration.StdConfiguration(AnnotationInclusion.INCLUDE_AND_INHERIT_IF_INHERITED);
TypeResolver typeResolver = new TypeResolver();
MemberResolver memberResolver = new MemberResolver(typeResolver);
ResolvedTypeWithMembers annotatedType = memberResolver.resolve(typeResolver.resolve(InvalidExample.class), annotationConfiguration, null);
for (ResolvedMethod m : annotatedType.getMemberMethods()) {
if (hasSignature(m, name, params)) {
return m;
}
}
throw new IllegalStateException("Could not resolve method " + name + Arrays.toString(params) + " in " + InvalidExample.class);
}
use of com.fasterxml.classmate.MemberResolver in project chassis by Kixeye.
the class CustomAccessorsProvider method constructorsIn.
/**
* Finds the constructors in the given type
*
* @param resolvedType the type to search
*/
public com.google.common.collect.ImmutableList<ResolvedConstructor> constructorsIn(ResolvedType resolvedType) {
MemberResolver resolver = new MemberResolver(typeResolver);
resolver.setIncludeLangObject(false);
if (resolvedType.getErasedType() == Object.class) {
return ImmutableList.of();
}
ResolvedTypeWithMembers typeWithMembers = resolver.resolve(resolvedType, null, null);
return FluentIterable.from(newArrayList(typeWithMembers.getConstructors())).toList();
}
Aggregations