[Java] Class ImmutableASTTransformation

  • org.codehaus.groovy.transform.ImmutableASTTransformation
All Implemented Interfaces and Traits:
CompilationUnitAware
@GroovyASTTransformation(phase = CompilePhase.CANONICALIZATION)
public class ImmutableASTTransformation
extends AbstractASTTransformation

Handles generation of code for the

Immutable:
annotation.

Field Summary

Fields
Modifiers Name Description
static ClassNode MY_TYPE
Inherited fields
Fields inherited from class Fields
class AbstractASTTransformation RETENTION_CLASSNODE, sourceUnit

Methods Summary

Methods
Type Params Return Type Name and description
static Object checkImmutable(String className, String fieldName, Object field)
This method exists to be binary compatible with 1.7 - 1.8.6 compiled code.
static Object checkImmutable(Class<?> clazz, String fieldName, Object field)
For compatibility with pre 2.5 compiled classes
static Object checkImmutable(Class<?> clazz, String fieldName, Object field, List<String> knownImmutableFieldNames, List<Class> knownImmutableClasses)
static void checkPropNames(Object instance, Map<String, Object> args)
String getAnnotationName()
void setCompilationUnit(CompilationUnit unit)
void visit(ASTNode[] nodes, SourceUnit source)

Inherited Methods Summary

Inherited Methods
Methods inherited from class Name
class AbstractASTTransformation addError, checkIncludeExclude, checkIncludeExclude, checkIncludeExcludeUndefinedAware, checkIncludeExcludeUndefinedAware, checkNotInterface, checkPropertyList, checkPropertyList, checkPropertyList, copyAnnotatedNodeAnnotations, copyAnnotatedNodeAnnotations, deemedInternalName, getAnnotationName, getClassList, getMemberClassList, getMemberClassValue, getMemberClassValue, getMemberIntValue, getMemberList, getMemberStringList, getMemberStringValue, getMemberStringValue, getMemberValue, hasAnnotation, init, memberHasValue, nonGeneric, shouldSkip, shouldSkip, shouldSkipOnDescriptor, shouldSkipOnDescriptorUndefinedAware, shouldSkipUndefinedAware, shouldSkipUndefinedAware, tokenize

Field Detail

public static final ClassNode MY_TYPE

Method Detail

@SuppressWarnings("Unchecked") public static Object checkImmutable(String className, String fieldName, Object field)

This method exists to be binary compatible with 1.7 - 1.8.6 compiled code.

@SuppressWarnings("Unchecked") public static Object checkImmutable(Class<?> clazz, String fieldName, Object field)

For compatibility with pre 2.5 compiled classes

@SuppressWarnings("Unchecked") public static Object checkImmutable(Class<?> clazz, String fieldName, Object field, List<String> knownImmutableFieldNames, List<Class> knownImmutableClasses)

public static void checkPropNames(Object instance, Map<String, Object> args)

@Override public String getAnnotationName()

@Override public void setCompilationUnit(CompilationUnit unit)

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

© 2003-2020 The Apache Software Foundation
Licensed under the Apache license.
https://docs.groovy-lang.org/2.5.14/html/gapi/org/codehaus/groovy/transform/ImmutableASTTransformation.html