Enum JPrimitiveType

java.lang.Object
java.lang.Enum<JPrimitiveType>
com.google.gwt.core.ext.typeinfo.JPrimitiveType
All Implemented Interfaces:
JType, Serializable, Comparable<JPrimitiveType>, java.lang.constant.Constable

public enum JPrimitiveType extends Enum<JPrimitiveType> implements JType
Represents a primitive type in a declaration.
  • Enum Constant Details

  • Method Details

    • values

      public static JPrimitiveType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static JPrimitiveType valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • parse

      public static JPrimitiveType parse(String name)
    • getErasedType

      public JType getErasedType()
      Description copied from interface: JType
      Returns this type with no type parameters or type variables. See the JLS Third Edition section on Type Erasure.
      Specified by:
      getErasedType in interface JType
    • getJNISignature

      public String getJNISignature()
      Description copied from interface: JType
      Returns the "field descriptor" for a type as specified by the Java Virtual Machine Specification. Examples:
      • boolean = Z
      • byte[] = [B
      • java.lang.String = Ljava/lang/String;
      Specified by:
      getJNISignature in interface JType
    • getLeafType

      public JType getLeafType()
      Description copied from interface: JType
      For array types, recursively looks for the element type that is not an array. Otherwise, returns this type.
      Specified by:
      getLeafType in interface JType
    • getParameterizedQualifiedSourceName

      public String getParameterizedQualifiedSourceName()
      Description copied from interface: JType
      Returns a type name as it would be specified in Java source, with the package name included. Includes the type parameters. If called on a type parameter, does not include any bounds. For example, a type Foo declared in com.example would be given as "com.example.Foo", while the same type instantiated with Baz would be "com.example.Foo<com.example.Baz>".
      Specified by:
      getParameterizedQualifiedSourceName in interface JType
    • getQualifiedBinaryName

      public String getQualifiedBinaryName()
      Description copied from interface: JType
      A binary type name as specified by the Java Language Spec, ThirdEdition.
      Specified by:
      getQualifiedBinaryName in interface JType
    • getQualifiedBoxedSourceName

      public String getQualifiedBoxedSourceName()
    • getQualifiedSourceName

      public String getQualifiedSourceName()
      Description copied from interface: JType
      Returns a type name as it would be specified in Java source, with the package name included. Does not include the type parameters. If called on a type parameter, includes any bounds.
      Specified by:
      getQualifiedSourceName in interface JType
    • getSimpleSourceName

      public String getSimpleSourceName()
      Description copied from interface: JType
      Returns the name of this class without the package name or enclosing class name.
      Specified by:
      getSimpleSourceName in interface JType
    • getUninitializedFieldExpression

      public String getUninitializedFieldExpression()
    • isAnnotation

      public JAnnotationType isAnnotation()
      Description copied from interface: JType
      Returns this instance as a JAnnotationType if it is an annotation or null if it is not.
      Specified by:
      isAnnotation in interface JType
    • isArray

      public JArrayType isArray()
      Specified by:
      isArray in interface JType
    • isClass

      public JClassType isClass()
      Description copied from interface: JType
      Returns this instance if the erased version of this type is a class (as opposed to a primitive, array, or interface) or null if it is not.
      Specified by:
      isClass in interface JType
    • isClassOrInterface

      public JClassType isClassOrInterface()
      Description copied from interface: JType
      Returns this instance if the erased version of this type is a class or interface (as opposed to a primitive or array array) or null if it is not.
      Specified by:
      isClassOrInterface in interface JType
    • isEnum

      public JEnumType isEnum()
      Description copied from interface: JType
      Returns this instance if it is an enumeration or null if it is not.
      Specified by:
      isEnum in interface JType
    • isGenericType

      public JGenericType isGenericType()
      Description copied from interface: JType
      Returns this instance if it is a real class that has type parameters or null if it is not.
      Specified by:
      isGenericType in interface JType
    • isInterface

      public JClassType isInterface()
      Description copied from interface: JType
      Returns this instance if it is an interface or null if it is not.
      Specified by:
      isInterface in interface JType
    • isParameterized

      public JParameterizedType isParameterized()
      Description copied from interface: JType
      Returns this instance as a JParameterizedType if it is a parameterized type or null if it is not.
      Specified by:
      isParameterized in interface JType
    • isPrimitive

      public JPrimitiveType isPrimitive()
      Specified by:
      isPrimitive in interface JType
    • isRawType

      public JRawType isRawType()
      Description copied from interface: JType
      Returns the raw type if this is a JRawType, otherwise returns null.
      Specified by:
      isRawType in interface JType
    • isTypeParameter

      public JTypeParameter isTypeParameter()
      Specified by:
      isTypeParameter in interface JType
    • isWildcard

      public JWildcardType isWildcard()
      Specified by:
      isWildcard in interface JType
    • toString

      public String toString()
      Overrides:
      toString in class Enum<JPrimitiveType>