Class PrimitiveHelper

java.lang.Object
org.codehaus.groovy.antlr.PrimitiveHelper

public class PrimitiveHelper extends Object
Default constants for primitive ClassNodes.
  • Method Details

    • getDefaultValueForPrimitive

      public static Expression getDefaultValueForPrimitive(ClassNode type)
      Returns a zero or false constant for one of the eight primitive types. int, long, double, float, char, and boolean keep that primitive type. byte and short are stored as those values, but ConstantExpression types them as the boxed class. void and reference types return null.
      Parameters:
      type - the type whose default constant is required
      Returns:
      that constant, or null when type is not a numeric or boolean primitive