Enum JavaType

  • All Implemented Interfaces:
    Serializable, Comparable<JavaType>

    public enum JavaType
    extends Enum<JavaType>
    Representations of Java types that do not exist in Java 6 but that have a special meaning to the JVM.
    • Enum Constant Detail

      • CONSTABLE

        public static final JavaType CONSTABLE
        The Java 12 java.lang.constant.Constable type.
      • TYPE_DESCRIPTOR

        public static final JavaType TYPE_DESCRIPTOR
        The Java 12 java.lang.invoke.TypeDescriptor type.
      • TYPE_DESCRIPTOR_OF_FIELD

        public static final JavaType TYPE_DESCRIPTOR_OF_FIELD
        The Java 12 java.lang.invoke.TypeDescriptor$OfMethod type.
      • TYPE_DESCRIPTOR_OF_METHOD

        public static final JavaType TYPE_DESCRIPTOR_OF_METHOD
        The Java 12 java.lang.invoke.TypeDescriptor$OfMethod type.
      • CONSTANT_DESCRIPTION

        public static final JavaType CONSTANT_DESCRIPTION
        The Java 12 java.lang.constant.ConstableDesc type.
      • DYNAMIC_CONSTANT_DESCRIPTION

        public static final JavaType DYNAMIC_CONSTANT_DESCRIPTION
        The Java 12 java.lang.constant.DynamicConstantDesc type.
      • CLASS_DESCRIPTION

        public static final JavaType CLASS_DESCRIPTION
        The Java 12 java.lang.constant.ClassDesc type.
      • METHOD_TYPE_DESCRIPTION

        public static final JavaType METHOD_TYPE_DESCRIPTION
        The Java 12 java.lang.constant.MethodTypeDesc type.
      • METHOD_HANDLE_DESCRIPTION

        public static final JavaType METHOD_HANDLE_DESCRIPTION
        The Java 12 java.lang.constant.MethodHandleDesc type.
      • DIRECT_METHOD_HANDLE_DESCRIPTION

        public static final JavaType DIRECT_METHOD_HANDLE_DESCRIPTION
        The Java 12 java.lang.constant.DirectMethodHandleDesc type.
      • METHOD_HANDLE

        public static final JavaType METHOD_HANDLE
        The Java 7 java.lang.invoke.MethodHandle type.
      • METHOD_HANDLES

        public static final JavaType METHOD_HANDLES
        The Java 7 java.lang.invoke.MethodHandles type.
      • METHOD_TYPE

        public static final JavaType METHOD_TYPE
        The Java 7 java.lang.invoke.MethodType type.
      • METHOD_HANDLES_LOOKUP

        public static final JavaType METHOD_HANDLES_LOOKUP
        The Java 7 java.lang.invoke.MethodTypes.Lookup type.
      • CALL_SITE

        public static final JavaType CALL_SITE
        The Java 7 java.lang.invoke.CallSite type.
      • VAR_HANDLE

        public static final JavaType VAR_HANDLE
        The Java 9 java.lang.invoke.VarHandle type.
      • PARAMETER

        public static final JavaType PARAMETER
        The Java 8 java.lang.reflect.Parameter type.
      • EXECUTABLE

        public static final JavaType EXECUTABLE
        The Java 7 java.lang.reflect.Executable type.
      • MODULE

        public static final JavaType MODULE
        The Java 9 java.lang.Module type.
      • RECORD

        public static final JavaType RECORD
        The Java 14 java.lang.Record type.
      • OBJECT_METHODS

        public static final JavaType OBJECT_METHODS
        The Java 14 java.lang.runtime.ObjectMethods type.
    • Method Detail

      • values

        public static JavaType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (JavaType c : JavaType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static JavaType 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
      • getTypeStub

        public TypeDescription getTypeStub()
        Returns at least a stub representing this type where the stub does not define any methods or fields. If a type exists for the current runtime, a loaded type representation is returned.
        Returns:
        A type description for this Java type.
      • isAvailable

        @Enhance
        public boolean isAvailable()
        Returns true if this type is available on the current JVM.
        Returns:
        true if this type is available on the current JVM.
      • isInstance

        public boolean isInstance​(Object instance)
        Checks if the supplied object is an instance of this type.
        Parameters:
        instance - The instance to check.
        Returns:
        true if the supplied object is an instance of this type.