Top Description Methods
groovy.transform

public @Interface CompileStatic

extends Annotation
Annotations
@Documented
@Retention:SOURCE
@Target:METHOD, TYPE, CONSTRUCTOR
@GroovyASTTransformationClass:StaticCompileTransformation
Imports
org.codehaus.groovy.transform.GroovyASTTransformationClass, java.lang.annotation.Documented, .ElementType, .Retention, .RetentionPolicy, .Target

This will let the Groovy compiler use compile time checks in the style of Java then perform static compilation, thus bypassing the Groovy meta object protocol.

When a class is annotated, all methods, properties, files, inner classes, etc. of the annotated class will be type checked. When a method is annotated, static compilation applies only to items (closures and anonymous inner classes) within the method.

By using TypeCheckingMode#SKIP, static compilation can be skipped on an element within a class or method otherwise marked with CompileStatic. For example a class can be annotated with CompileStatic, and a method within can be marked to skip static checking to use dynamic language features.

See Also
CompileDynamic

Method Summary

Modifier and TypeMethod and Description
public String[]

Returns:

an array of paths to groovy scripts that must be on compile classpath
extensions
()

The list of (classpath resources) paths to type checking DSL scripts, also known as type checking extensions.

public TypeCheckingMode
Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

extensionsback to summary
public String[] extensions()

The list of (classpath resources) paths to type checking DSL scripts, also known as type checking extensions.

Returns:String[]

an array of paths to groovy scripts that must be on compile classpath

valueback to summary
public TypeCheckingMode value()