Field AST transformation this way:
import groovy.transform.*The closure code is executed after the specified phase has completed. If no phase is provided, then the code is executed after the@ASTTest(value = { def owner = node.declaringClass assert owner.fields.any { it.name == 'x' } })@Field int x
semantic analysis phase
and each subsequent phase.
The node variable refers to the AST node where the AST test annotation is put. In the previous example,
it means that node refers to the declaration "int x".
| Modifier and Type | Method and Description |
|---|---|
| public CompilePhase | |
| public Class | value()
A closure which is executed against the annotated node after the specified phase has completed. |
| phase | back to summary |
|---|---|
| public CompilePhase phase() The compile phase after which the test code should run. | |
| value | back to summary |
|---|---|
| public Class A closure which is executed against the annotated node after the specified phase has completed. | |