Groovy Documentation

## org.codehaus.groovy.transform
[Java] Class ImmutableASTTransformation

    java.lang.Object
      org.codehaus.groovy.transform.AbstractASTTransformation
          org.codehaus.groovy.transform.ImmutableASTTransformation

    @GroovyASTTransformation(phase = CompilePhase.CANONICALIZATION)
    public class ImmutableASTTransformation
    extends AbstractASTTransformation

Handles generation of code for the

Immutable:
  annotation.

Authors:
  Paul King
  Andre Steingress

Method Summary
`static java.lang.Object` | `checkImmutable(java.lang.String className, java.lang.String fieldName, java.lang.Object field)`
`static java.lang.Object` | `checkImmutable(java.lang.Class clazz, java.lang.String fieldName, java.lang.Object field)`
`static void` | `checkPropNames(java.lang.Object instance, java.util.Map args)`
`void` | `visit(ASTNode[] nodes, SourceUnit source)`

Methods inherited from class AbstractASTTransformation
addError, checkNotInterface, getMemberList, getMemberStringValue, getMemberValue, hasAnnotation, init, memberHasValue, tokenize

Methods inherited from class java.lang.Object
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), 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()

Method Detail

### checkImmutable

    public static java.lang.Object checkImmutable(java.lang.String className, java.lang.String fieldName, java.lang.Object field)

### checkImmutable

    if (field == null || field instanceof Enum || inImmutableList(field.getClass().getName()) || knownImmutableClasses.contains(field.getClass()))
    public static java.lang.Object checkImmutable(java.lang.Class clazz, java.lang.String fieldName, java.lang.Object field)

### checkPropNames

    public static void checkPropNames(java.lang.Object instance, java.util.Map args)

### visit

    public void visit(ASTNode[] nodes, SourceUnit source)

Groovy Documentation