if (log.isTraceEnabled())
log.trace("Method with signature " + signature + " does not exist on class " + clazz.getName());
return null;
}
Annotation[][] paramAnnotations = method.getParameterAnnotations();
return new SimpleMetaDataLoader(paramAnnotations[methodParametersSignature.getParam()]);
}
else if (signature instanceof ConstructorParametersSignature)
{
ConstructorParametersSignature constructorParametersSignature = (ConstructorParametersSignature) signature;
Constructor<?> constructor = constructorParametersSignature.getConstructor();
if (constructor == null)
constructor = SecurityActions.findConstructor(clazz, signature.getParametersTypes(clazz));
if (constructor == null)
{
if (log.isTraceEnabled())
log.trace("Constructor with signature " + signature + " does not exist on class " + clazz.getName());
return null;
}
Annotation[][] paramAnnotations = constructor.getParameterAnnotations();
return new SimpleMetaDataLoader(paramAnnotations[constructorParametersSignature.getParam()]);
}
else if (signature instanceof FieldSignature)
{
FieldSignature fieldSignature = (FieldSignature) signature;
Field field = fieldSignature.getField();
if (field == null)
field = SecurityActions.findField(clazz, signature.getName());
if (field == null)
{
if (log.isTraceEnabled())
log.trace("Field " + signature.getName() + " does not exist on class " + clazz.getName());
return null;
}
return new AnnotatedElementMetaDataLoader(field);
}
}
if (annotated instanceof Method)
{
if (signature instanceof MethodParametersSignature)
{
Method method = (Method)annotated;
Annotation[][] paramAnnotations = method.getParameterAnnotations();
MethodParametersSignature sig = (MethodParametersSignature) signature;
return new SimpleMetaDataLoader(paramAnnotations[sig.getParam()]);
}
}
if (annotated instanceof Constructor)
{
if (signature instanceof ConstructorParametersSignature)
{
Constructor<?> constructor = Constructor.class.cast(annotated);
Annotation[][] paramAnnotations = constructor.getParameterAnnotations();
ConstructorParametersSignature sig = (ConstructorParametersSignature) signature;
return new SimpleMetaDataLoader(paramAnnotations[sig.getParam()]);
}
}
return null;
}