Enum JavaType
- All Implemented Interfaces:
Serializable, Comparable<JavaType>, java.lang.constant.Constable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classA latent type that resolves the simple name without considering the declaring type which is not normally available.Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThejava.security.AccessControlContexttype which is deprecated for removal beginning in Java 17.The Java 7java.lang.invoke.CallSitetype.The Java 12java.lang.constant.ClassDesctype.The Java 12java.lang.constant.Constabletype.The Java 12java.lang.invoke.ConstantBootstrapstype.The Java 12java.lang.constant.ConstableDesctype.The Java 12java.lang.constant.DirectMethodHandleDesctype.The Java 12java.lang.constant.DynamicConstantDesctype.The Java 7java.lang.reflect.Executabletype.The Java 7java.lang.invoke.MethodHandletype.The Java 12java.lang.constant.MethodHandleDesctype.The Java 7java.lang.invoke.MethodHandlestype.The Java 7java.lang.invoke.MethodTypes.Lookuptype.The Java 7java.lang.invoke.MethodTypetype.The Java 12java.lang.constant.MethodTypeDesctype.The Java 9java.lang.Moduletype.The Java 14java.lang.runtime.ObjectMethodstype.The Java 8java.lang.reflect.Parametertype.The Java 14java.lang.Recordtype.The Java 12java.lang.invoke.TypeDescriptortype.The Java 12java.lang.invoke.TypeDescriptor$OfMethodtype.The Java 12java.lang.invoke.TypeDescriptor$OfMethodtype.The Java 9java.lang.invoke.VarHandletype. -
Method Summary
Modifier and TypeMethodDescriptionReturns at least a stub representing this type where the stub does not define any methods or fields.booleanReturnstrueif this type is available on the current JVM.booleanisInstance(Object instance) Checks if the supplied object is an instance of this type.Class<?> load()Loads the class that is represented by this Java type.Loads the class that is represented by this Java type and represents it as aTypeDescription.static JavaTypeReturns the enum constant of this type with the specified name.static JavaType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
CONSTABLE
The Java 12java.lang.constant.Constabletype. -
TYPE_DESCRIPTOR
The Java 12java.lang.invoke.TypeDescriptortype. -
TYPE_DESCRIPTOR_OF_FIELD
The Java 12java.lang.invoke.TypeDescriptor$OfMethodtype. -
TYPE_DESCRIPTOR_OF_METHOD
The Java 12java.lang.invoke.TypeDescriptor$OfMethodtype. -
CONSTANT_DESCRIPTION
The Java 12java.lang.constant.ConstableDesctype. -
DYNAMIC_CONSTANT_DESCRIPTION
The Java 12java.lang.constant.DynamicConstantDesctype. -
CLASS_DESCRIPTION
The Java 12java.lang.constant.ClassDesctype. -
METHOD_TYPE_DESCRIPTION
The Java 12java.lang.constant.MethodTypeDesctype. -
METHOD_HANDLE_DESCRIPTION
The Java 12java.lang.constant.MethodHandleDesctype. -
DIRECT_METHOD_HANDLE_DESCRIPTION
The Java 12java.lang.constant.DirectMethodHandleDesctype. -
METHOD_HANDLE
The Java 7java.lang.invoke.MethodHandletype. -
METHOD_HANDLES
The Java 7java.lang.invoke.MethodHandlestype. -
METHOD_TYPE
The Java 7java.lang.invoke.MethodTypetype. -
METHOD_HANDLES_LOOKUP
The Java 7java.lang.invoke.MethodTypes.Lookuptype. -
CALL_SITE
The Java 7java.lang.invoke.CallSitetype. -
VAR_HANDLE
The Java 9java.lang.invoke.VarHandletype. -
PARAMETER
The Java 8java.lang.reflect.Parametertype. -
EXECUTABLE
The Java 7java.lang.reflect.Executabletype. -
MODULE
The Java 9java.lang.Moduletype. -
CONSTANT_BOOTSTRAPS
The Java 12java.lang.invoke.ConstantBootstrapstype. -
RECORD
The Java 14java.lang.Recordtype. -
OBJECT_METHODS
The Java 14java.lang.runtime.ObjectMethodstype. -
ACCESS_CONTROL_CONTEXT
Thejava.security.AccessControlContexttype which is deprecated for removal beginning in Java 17.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
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.
-
load
Loads the class that is represented by this Java type.- Returns:
- A loaded type of this Java type.
- Throws:
ClassNotFoundException- If the represented type cannot be loaded.
-
loadAsDescription
Loads the class that is represented by this Java type and represents it as aTypeDescription.- Returns:
- A loaded type of this Java type.
- Throws:
ClassNotFoundException- If the represented type cannot be loaded.
-
isAvailable
public boolean isAvailable()Returnstrueif this type is available on the current JVM.- Returns:
trueif this type is available on the current JVM.
-
isInstance
Checks if the supplied object is an instance of this type.- Parameters:
instance- The instance to check.- Returns:
trueif the supplied object is an instance of this type.
-