Class ConstantExpression

All Implemented Interfaces:
GroovydocHolder<AnnotatedNode>, NodeMetaDataHandler
Direct Known Subclasses:
AnnotationConstantExpression

public class ConstantExpression extends Expression
Represents a constant expression such as null, true, false.
  • Field Details

  • Constructor Details

    • ConstantExpression

      public ConstantExpression(Object value)
    • ConstantExpression

      public ConstantExpression(Object value, boolean keepPrimitive)
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • visit

      public void visit(GroovyCodeVisitor visitor)
      Overrides:
      visit in class ASTNode
    • transformExpression

      public Expression transformExpression(ExpressionTransformer transformer)
      Description copied from class: Expression
      Transforms this expression and any nested expressions.
      Specified by:
      transformExpression in class Expression
    • getValue

      public Object getValue()
      Returns:
      the value of this constant expression
    • getText

      public String getText()
      Overrides:
      getText in class ASTNode
    • getConstantName

      public String getConstantName()
    • setConstantName

      public void setConstantName(String constantName)
    • isNullExpression

      public boolean isNullExpression()
    • isTrueExpression

      public boolean isTrueExpression()
    • isFalseExpression

      public boolean isFalseExpression()
    • isEmptyStringExpression

      public boolean isEmptyStringExpression()