Groovy Documentation

org.codehaus.groovy.grails.compiler.web
[Java] Class ControllerActionTransformer

java.lang.Object
  org.codehaus.groovy.grails.compiler.web.ControllerActionTransformer
All Implemented Interfaces:
GrailsArtefactClassInjector

@AstTransformer
public class ControllerActionTransformer
extends java.lang.Object

Enhances controller classes by converting closures actions to method actions and binding request parameters to action arguments.


Field Summary
static java.lang.String VOID_TYPE

 
Constructor Summary
ControllerActionTransformer()

 
Method Summary
protected void addMethodToInvokeClosure(org.codehaus.groovy.ast.ClassNode controllerClassNode, org.codehaus.groovy.ast.PropertyNode closureProperty, org.codehaus.groovy.control.SourceUnit source, org.codehaus.groovy.classgen.GeneratorContext context)

protected void annotateActionMethod(org.codehaus.groovy.ast.Parameter[] parameters, org.codehaus.groovy.ast.MethodNode methodNode)

protected void enhanceCommandObjectClass(org.codehaus.groovy.ast.ClassNode commandObjectTypeClassNode, java.lang.String actionName, org.codehaus.groovy.control.SourceUnit source, org.codehaus.groovy.classgen.GeneratorContext context)

protected void error(org.codehaus.groovy.control.SourceUnit source, java.lang.String me)

java.lang.String[] getArtefactTypes()

protected org.codehaus.groovy.ast.stmt.Statement getAutoWireCommandObjectStatement(java.lang.String paramName)

protected org.codehaus.groovy.ast.stmt.Statement getCommandObjectDataBindingStatement(org.codehaus.groovy.ast.ClassNode controllerClassNode, java.lang.String paramName, org.codehaus.groovy.ast.ClassNode commandObjectClassNode)

protected org.codehaus.groovy.ast.expr.Expression getRejectValueExpression(java.lang.String methodParamName)

protected org.codehaus.groovy.ast.stmt.BlockStatement initializeActionParameters(org.codehaus.groovy.ast.ClassNode classNode, org.codehaus.groovy.ast.ASTNode actionNode, java.lang.String actionName, org.codehaus.groovy.ast.Parameter[] actionParameters, org.codehaus.groovy.control.SourceUnit source, org.codehaus.groovy.classgen.GeneratorContext context)

protected void initializeCommandObjectParameter(org.codehaus.groovy.ast.stmt.BlockStatement wrapper, org.codehaus.groovy.ast.ClassNode classNode, org.codehaus.groovy.ast.ClassNode commandObjectTypeClassNode, org.codehaus.groovy.ast.ASTNode actionNode, java.lang.String actionName, java.lang.String paramName, org.codehaus.groovy.control.SourceUnit source, org.codehaus.groovy.classgen.GeneratorContext context)

protected void initializeMethodParameter(org.codehaus.groovy.ast.ClassNode classNode, org.codehaus.groovy.ast.stmt.BlockStatement wrapper, org.codehaus.groovy.ast.ASTNode actionNode, java.lang.String actionName, org.codehaus.groovy.ast.Parameter param, org.codehaus.groovy.control.SourceUnit source, org.codehaus.groovy.classgen.GeneratorContext context)

protected void initializePrimitiveOrTypeWrapperParameter(org.codehaus.groovy.ast.stmt.BlockStatement wrapper, org.codehaus.groovy.ast.Parameter param, java.lang.String requestParameterName)

protected void initializeStringParameter(org.codehaus.groovy.ast.stmt.BlockStatement wrapper, org.codehaus.groovy.ast.Parameter param, java.lang.String requestParameterName)

void performInjection(org.codehaus.groovy.control.SourceUnit source, org.codehaus.groovy.classgen.GeneratorContext context, org.codehaus.groovy.ast.ClassNode classNode)

void performInjection(org.codehaus.groovy.control.SourceUnit source, org.codehaus.groovy.ast.ClassNode classNode)

boolean shouldInject(java.net.URL url)

protected void transformClosureToMethod(org.codehaus.groovy.ast.ClassNode classNode, ClosureExpression closureAction, org.codehaus.groovy.ast.PropertyNode property, org.codehaus.groovy.control.SourceUnit source, org.codehaus.groovy.classgen.GeneratorContext context)

protected void warning(org.codehaus.groovy.control.SourceUnit sourceUnit, org.codehaus.groovy.ast.ASTNode node, java.lang.String warningMessage)

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Field Detail

VOID_TYPE

public static final java.lang.String VOID_TYPE


 
Constructor Detail

ControllerActionTransformer

public ControllerActionTransformer()


 
Method Detail

addMethodToInvokeClosure

protected void addMethodToInvokeClosure(org.codehaus.groovy.ast.ClassNode controllerClassNode, org.codehaus.groovy.ast.PropertyNode closureProperty, org.codehaus.groovy.control.SourceUnit source, org.codehaus.groovy.classgen.GeneratorContext context)


annotateActionMethod

protected void annotateActionMethod(org.codehaus.groovy.ast.Parameter[] parameters, org.codehaus.groovy.ast.MethodNode methodNode)


enhanceCommandObjectClass

protected void enhanceCommandObjectClass(org.codehaus.groovy.ast.ClassNode commandObjectTypeClassNode, java.lang.String actionName, org.codehaus.groovy.control.SourceUnit source, org.codehaus.groovy.classgen.GeneratorContext context)


error

protected void error(org.codehaus.groovy.control.SourceUnit source, java.lang.String me)


getArtefactTypes

public java.lang.String[] getArtefactTypes()


getAutoWireCommandObjectStatement

protected org.codehaus.groovy.ast.stmt.Statement getAutoWireCommandObjectStatement(java.lang.String paramName)


getCommandObjectDataBindingStatement

protected org.codehaus.groovy.ast.stmt.Statement getCommandObjectDataBindingStatement(@SuppressWarnings("unused") org.codehaus.groovy.ast.ClassNode controllerClassNode, java.lang.String paramName, @SuppressWarnings("unused") org.codehaus.groovy.ast.ClassNode commandObjectClassNode)


getRejectValueExpression

protected org.codehaus.groovy.ast.expr.Expression getRejectValueExpression(java.lang.String methodParamName)


initializeActionParameters

protected org.codehaus.groovy.ast.stmt.BlockStatement initializeActionParameters(org.codehaus.groovy.ast.ClassNode classNode, org.codehaus.groovy.ast.ASTNode actionNode, java.lang.String actionName, org.codehaus.groovy.ast.Parameter[] actionParameters, org.codehaus.groovy.control.SourceUnit source, org.codehaus.groovy.classgen.GeneratorContext context)


initializeCommandObjectParameter

protected void initializeCommandObjectParameter(org.codehaus.groovy.ast.stmt.BlockStatement wrapper, org.codehaus.groovy.ast.ClassNode classNode, org.codehaus.groovy.ast.ClassNode commandObjectTypeClassNode, org.codehaus.groovy.ast.ASTNode actionNode, java.lang.String actionName, java.lang.String paramName, org.codehaus.groovy.control.SourceUnit source, org.codehaus.groovy.classgen.GeneratorContext context)


initializeMethodParameter

protected void initializeMethodParameter(org.codehaus.groovy.ast.ClassNode classNode, org.codehaus.groovy.ast.stmt.BlockStatement wrapper, org.codehaus.groovy.ast.ASTNode actionNode, java.lang.String actionName, org.codehaus.groovy.ast.Parameter param, org.codehaus.groovy.control.SourceUnit source, org.codehaus.groovy.classgen.GeneratorContext context)


initializePrimitiveOrTypeWrapperParameter

protected void initializePrimitiveOrTypeWrapperParameter(org.codehaus.groovy.ast.stmt.BlockStatement wrapper, org.codehaus.groovy.ast.Parameter param, java.lang.String requestParameterName)


initializeStringParameter

protected void initializeStringParameter(org.codehaus.groovy.ast.stmt.BlockStatement wrapper, org.codehaus.groovy.ast.Parameter param, java.lang.String requestParameterName)


performInjection

public void performInjection(org.codehaus.groovy.control.SourceUnit source, org.codehaus.groovy.classgen.GeneratorContext context, org.codehaus.groovy.ast.ClassNode classNode)


performInjection

public void performInjection(org.codehaus.groovy.control.SourceUnit source, org.codehaus.groovy.ast.ClassNode classNode)


shouldInject

public boolean shouldInject(java.net.URL url)


transformClosureToMethod

protected void transformClosureToMethod(org.codehaus.groovy.ast.ClassNode classNode, ClosureExpression closureAction, org.codehaus.groovy.ast.PropertyNode property, org.codehaus.groovy.control.SourceUnit source, org.codehaus.groovy.classgen.GeneratorContext context)


warning

protected void warning(org.codehaus.groovy.control.SourceUnit sourceUnit, org.codehaus.groovy.ast.ASTNode node, java.lang.String warningMessage)


 

Groovy Documentation