public class ModifiesASTTransformation
extends Object
implements ASTTransformation
Handles Modifies annotations placed on methods. Extracts the declared modification targets (fields and parameters) from the annotation closure and stores them as node metadata on the MethodNode.
The metadata key is {@value #MODIFIES_FIELDS_KEY} and the value is a
Set<String> of field/parameter names. Downstream processors
(such as @Ensures validation) can read this metadata.
| Modifiers | Name | Description |
|---|---|---|
static String |
MODIFIES_FIELDS_KEY |
Node metadata key for the set of modifiable field/parameter names. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public void |
visit(ASTNode[] nodes, SourceUnit source)Extracts the modifiable targets declared by @Modifies and stores them as method metadata. |
Node metadata key for the set of modifiable field/parameter names.
Extracts the modifiable targets declared by @Modifies and stores them as method metadata.
nodes - the annotated AST nodes supplied by the compilersource - the current source unit