Top Fields Constructors Methods
org.apache.groovy.ast.tools

public Class ImmutablePropertyUtils

extends Object
Class Inheritance
Imports
groovy.transform.ImmutableOptions, org.codehaus.groovy.ast.AnnotationNode, .ClassHelper, .ClassNode, .GenericsType, .GroovyCodeVisitor, org.codehaus.groovy.ast.expr.ClassExpression, .ConstantExpression, .Expression, .ListExpression, org.codehaus.groovy.classgen.AsmClassGenerator, .BytecodeExpression, org.codehaus.groovy.classgen.asm.CompileStack, .OperandStack, org.codehaus.groovy.control.CompilerConfiguration, org.codehaus.groovy.runtime.InvokerHelper, org.codehaus.groovy.transform.AbstractASTTransformation, org.objectweb.asm.Handle, .MethodVisitor, .Opcodes, java.lang.annotation.Annotation, java.lang.invoke.CallSite, .MethodHandles, .MethodType, java.util.ArrayList, .Arrays, .Date, .HashSet, .List, .Set

Field Summary

Modifier and TypeField and Description
private static final Set<String>
private static final Set<String>
BUILTIN_IMMUTABLES

Currently leaving BigInteger and BigDecimal in list but see: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6348370 Also, Color is not final so while not normally used with child classes, it isn't strictly immutable.

private static final ClassNode
private static final ClassNode
public static final ClassNode
private static final String
private static final String

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static boolean
builtinOrDeemedType(ClassNode fieldType, List<String> knownImmutableClasses)

public static boolean
public static Expression
public static Expression
public static String
createErrorMessage(String className, String fieldName, String typeName, String mode)

public static boolean
public static List<String>
public static List<String>
private static boolean
private static boolean
public static boolean
public static boolean
public static boolean
isKnownImmutableType(ClassNode fieldType, List<String> knownImmutableClasses)

private static boolean
private static String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BUILTIN_IMMUTABLE_ANNOTATIONSback to summary
private static final Set<String> BUILTIN_IMMUTABLE_ANNOTATIONS
BUILTIN_IMMUTABLESback to summary
private static final Set<String> BUILTIN_IMMUTABLES

Currently leaving BigInteger and BigDecimal in list but see: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6348370 Also, Color is not final so while not normally used with child classes, it isn't strictly immutable. Use at your own risk. This list can by extended by providing "known immutable" classes via Immutable.knownImmutableClasses

CLONEABLE_TYPEback to summary
private static final ClassNode CLONEABLE_TYPE
DATE_TYPEback to summary
private static final ClassNode DATE_TYPE
IMMUTABLE_OPTIONS_TYPEback to summary
public static final ClassNode IMMUTABLE_OPTIONS_TYPE
MEMBER_KNOWN_IMMUTABLE_CLASSESback to summary
private static final String MEMBER_KNOWN_IMMUTABLE_CLASSES
MEMBER_KNOWN_IMMUTABLESback to summary
private static final String MEMBER_KNOWN_IMMUTABLES

Constructor Detail

ImmutablePropertyUtilsback to summary
private ImmutablePropertyUtils()

Method Detail

builtinOrDeemedTypeback to summary
private static boolean builtinOrDeemedType(ClassNode fieldType, List<String> knownImmutableClasses)
builtinOrMarkedImmutableClassback to summary
public static boolean builtinOrMarkedImmutableClass(Class<?> clazz)
cloneArrayOrCloneableExprback to summary
public static Expression cloneArrayOrCloneableExpr(final Expression expr, final ClassNode type)
cloneDateExprback to summary
public static Expression cloneDateExpr(Expression origDate)
createErrorMessageback to summary
public static String createErrorMessage(String className, String fieldName, String typeName, String mode)
derivesFromDateback to summary
public static boolean derivesFromDate(ClassNode fieldType)
getKnownImmutableClassesback to summary
public static List<String> getKnownImmutableClasses(AbstractASTTransformation xform, ClassNode cNode)
getKnownImmutablesback to summary
public static List<String> getKnownImmutables(AbstractASTTransformation xform, ClassNode cNode)
hasImmutableAnnotationback to summary
private static boolean hasImmutableAnnotation(ClassNode type)
hasImmutableAnnotationback to summary
private static boolean hasImmutableAnnotation(Class<T> clazz)
implementsCloneableback to summary
public static boolean implementsCloneable(ClassNode fieldType)
isBuiltinImmutableback to summary
public static boolean isBuiltinImmutable(String typeName)
isKnownImmutableTypeback to summary
public static boolean isKnownImmutableType(ClassNode fieldType, List<String> knownImmutableClasses)
matchingImmutableMarkerNameback to summary
private static boolean matchingImmutableMarkerName(String name)
prettyTypeNameback to summary
private static String prettyTypeName(String name)