|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.codehaus.groovy.grails.compiler.web.ControllerActionTransformer
@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 |
---|
public static final java.lang.String VOID_TYPE
Constructor Detail |
---|
public ControllerActionTransformer()
Method Detail |
---|
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)
public java.lang.String[] getArtefactTypes()
protected org.codehaus.groovy.ast.stmt.Statement getAutoWireCommandObjectStatement(java.lang.String paramName)
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)
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)
public void performInjection(org.codehaus.groovy.control.SourceUnit source, org.codehaus.groovy.classgen.GeneratorContext context, org.codehaus.groovy.ast.ClassNode classNode)
public void performInjection(org.codehaus.groovy.control.SourceUnit source, org.codehaus.groovy.ast.ClassNode classNode)
public 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)
Groovy Documentation