Set<ConstructorInfo> constructors = info.getConstructors();
if (constructors != null && constructors.isEmpty() == false)
{
for(ConstructorInfo ci : constructors)
{
Signature cis = new ConstructorSignature(ci);
MetaData cmdr = retrieval.getComponentMetaData(cis);
if (cmdr != null)
{
for(T plugin : getPlugins(ElementType.CONSTRUCTOR, null, annotationClasses))
{
if (isApplyPhase)
applyPlugin(plugin, ci, cmdr, handle);
else
cleanPlugin(plugin, ci, cmdr, handle);
}
}
else if (trace)
log.trace("No annotations for " + ci);
}
}
else if (trace)
log.trace("No constructors");
// properties
Set<MethodInfo> visitedMethods = new HashSet<MethodInfo>();
Set<PropertyInfo> properties = info.getProperties();
if (properties != null && properties.isEmpty() == false)
{
for(PropertyInfo pi : properties)
{
FieldInfo field = pi.getFieldInfo();
if (field != null)
{
Signature sis = new FieldSignature(field);
MetaData cmdr = retrieval.getComponentMetaData(sis);
if (cmdr != null)
{
for(T plugin : getPlugins(ElementType.FIELD, null, annotationClasses))
{
if (isApplyPhase)
applyPlugin(plugin, field, cmdr, handle);
else
cleanPlugin(plugin, field, cmdr, handle);
}
}
else if (trace)
log.trace("No annotations for field " + field.getName());
}
// apply setter and getter as well - if they exist
handleMethod(retrieval, handle, isApplyPhase, trace, visitedMethods, pi, pi.getSetter(), "setter", annotationClasses);
handleMethod(retrieval, handle, isApplyPhase, trace, visitedMethods, pi, pi.getGetter(), "getter", annotationClasses);
}
}
else if (trace)
log.trace("No properties");
// get Object's class info - it's cached so it shouldn't take much
TypeInfoFactory tif = classInfo.getTypeInfoFactory();
TypeInfo objectTI = tif.getTypeInfo(Object.class);
// method plugins
Iterable<T> methodPlugins = null;
// methods
Set<MethodInfo> methods = info.getMethods();
if (methods != null && methods.isEmpty() == false)
{
for(MethodInfo mi : methods)
{
ClassInfo declaringCI = mi.getDeclaringClass();
// direct == check is OK
if (declaringCI != objectTI && visitedMethods.contains(mi) == false)
{
Signature mis = new DeclaredMethodSignature(mi);
MetaData cmdr = retrieval.getComponentMetaData(mis);
if (cmdr != null)
{
if (methodPlugins == null)
methodPlugins = getPlugins(ElementType.METHOD, METHOD_FILTER, annotationClasses);
for(T plugin : methodPlugins)
{
if (isApplyPhase)
applyPlugin(plugin, mi, cmdr, handle);
else
cleanPlugin(plugin, mi, cmdr, handle);
}
}
else if (trace)
log.trace("No annotations for " + mi);
}
}
}
else if (trace)
log.trace("No methods");
// static methods
MethodInfo[] staticMethods = getStaticMethods(classInfo);
if (staticMethods != null && staticMethods.length != 0)
{
for(MethodInfo smi : staticMethods)
{
if (smi.isStatic() && smi.isPublic())
{
Signature mis = new DeclaredMethodSignature(smi);
MetaData cmdr = retrieval.getComponentMetaData(mis);
if (cmdr != null)
{
if (methodPlugins == null)
methodPlugins = getPlugins(ElementType.METHOD, METHOD_FILTER, annotationClasses);