MethodDeclaration[] methods = CompilerUtils.getClassMethods( jclass, ACTION_TAG_NAME );
for ( int i = 0; i < methods.length; i++ )
{
MethodDeclaration method = methods[i];
AnnotationInstance actionAnnotation = CompilerUtils.getAnnotation( method, ACTION_TAG_NAME );
assert actionAnnotation != null;
addRulesFromActionAnnotation( actionAnnotation, method.getSimpleName() );
ParameterDeclaration[] parameters = method.getParameters();
if ( parameters.length > 0 )
{
TypeInstance type = parameters[0].getType();
if ( type instanceof ClassType )
{
ClassDeclaration classDecl = ( ( ClassType ) type ).getClassTypeDeclaration();
if ( classDecl.getDeclaringType() == null ) addRulesFromBeanClass( classDecl );
}
}
}
Collection simpleActions = mca.getSimpleActions();
if ( simpleActions != null )
{
for ( Iterator ii = simpleActions.iterator(); ii.hasNext(); )
{
AnnotationInstance simpleAction = ( AnnotationInstance ) ii.next();
String actionName = CompilerUtils.getString( simpleAction, NAME_ATTR, true );
assert actionName != null; //checker should enforce this.
addRulesFromActionAnnotation( simpleAction, actionName );
}
}