public class ClassExpression
extends Expression
Represents access to a Java or Groovy class object as an expression.
This is used when referring to a class literal (e.g., String.class, MyClass)
in contexts such as invoking static methods, accessing static members, or passing a class as an argument.
The type of this expression is the ClassNode being accessed.
| Fields inherited from class | Fields |
|---|---|
class Expression |
EMPTY_ARRAY |
| Constructor and description |
|---|
ClassExpression(ClassNode type)Creates a class expression for the specified type. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public String |
getText() |
|
public String |
toString() |
|
public Expression |
transformExpression(ExpressionTransformer transformer) |
|
public void |
visit(GroovyCodeVisitor visitor) |
| Methods inherited from class | Name |
|---|---|
class Expression |
getType, setType, transformExpression, transformExpressions, transformExpressions |
class AnnotatedNode |
addAnnotation, addAnnotation, addAnnotations, getAnnotations, getAnnotations, getDeclaringClass, getGroovydoc, getInstance, hasNoRealSourcePosition, isSynthetic, setDeclaringClass, setHasNoRealSourcePosition, setSynthetic |
class ASTNode |
copyNodeMetaData, getColumnNumber, getLastColumnNumber, getLastLineNumber, getLineNumber, getMetaDataMap, getText, setColumnNumber, setLastColumnNumber, setLastLineNumber, setLineNumber, setMetaDataMap, setSourcePosition, visit |
Creates a class expression for the specified type.
type - the class being accessed as an expression (non-null)Copyright © 2003-2026 The Apache Software Foundation. All rights reserved.