Package com.axelor.script
Class GroovyCheckPropTransformation
java.lang.Object
org.codehaus.groovy.transform.AbstractASTTransformation
com.axelor.script.GroovyCheckPropTransformation
- All Implemented Interfaces:
org.codehaus.groovy.transform.ASTTransformation
,org.codehaus.groovy.transform.ErrorCollecting
public class GroovyCheckPropTransformation
extends org.codehaus.groovy.transform.AbstractASTTransformation
A custom Groovy AST transformer to validate property accesses against the policy settings.
This is done at a compile phase when local variables are resolved.
For example:
def value = foo.bar def value2 = com.axelor.example.Foo.BARwould become:
def value = __$$policy.check(foo).bar def value2 = __$$policy.check(com.axelor.example.Foo).BAR
-
Field Summary
Fields inherited from class org.codehaus.groovy.transform.AbstractASTTransformation
RETENTION_CLASSNODE, sourceUnit
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
visit
(org.codehaus.groovy.ast.ASTNode[] nodes, org.codehaus.groovy.control.SourceUnit source) Methods inherited from class org.codehaus.groovy.transform.AbstractASTTransformation
addError, checkIncludeExcludeUndefinedAware, checkIncludeExcludeUndefinedAware, checkNotInterface, checkPropertyList, checkPropertyList, checkPropertyList, copyAnnotatedNodeAnnotations, copyAnnotatedNodeAnnotations, deemedInternalName, getAnnotationName, getMemberClassList, getMemberClassValue, getMemberClassValue, getMemberIntValue, getMemberStringList, getMemberStringValue, getMemberStringValue, getMemberValue, hasAnnotation, init, memberHasValue, shouldSkip, shouldSkip, shouldSkipOnDescriptorUndefinedAware, shouldSkipUndefinedAware, shouldSkipUndefinedAware, tokenize
-
Constructor Details
-
GroovyCheckPropTransformation
public GroovyCheckPropTransformation()
-
-
Method Details
-
visit
public void visit(org.codehaus.groovy.ast.ASTNode[] nodes, org.codehaus.groovy.control.SourceUnit source)
-