use of jodd.petite.MethodInjectionPoint in project jodd by oblac.
the class MethodResolver method resolve.
public MethodInjectionPoint[] resolve(Class type) {
// lookup methods
ClassDescriptor cd = ClassIntrospector.lookup(type);
List<MethodInjectionPoint> list = new ArrayList<>();
MethodDescriptor[] allMethods = cd.getAllMethodDescriptors();
for (MethodDescriptor methodDescriptor : allMethods) {
Method method = methodDescriptor.getMethod();
if (ReflectUtil.isBeanPropertySetter(method)) {
// ignore setters
continue;
}
if (method.getParameterTypes().length == 0) {
// ignore methods with no argument
continue;
}
PetiteInject ref = method.getAnnotation(PetiteInject.class);
if (ref == null) {
continue;
}
String[][] references = PetiteUtil.convertAnnValueToReferences(ref.value());
list.add(injectionPointFactory.createMethodInjectionPoint(method, references));
}
MethodInjectionPoint[] methods;
if (list.isEmpty()) {
methods = MethodInjectionPoint.EMPTY;
} else {
methods = list.toArray(new MethodInjectionPoint[list.size()]);
}
return methods;
}
Aggregations