T - The represented type.public abstract static class JavaConstant.Simple<T> extends Object implements JavaConstant
| Modifier and Type | Class and Description | 
|---|---|
protected static interface  | 
JavaConstant.Simple.Dispatcher
A dispatcher to represent  
java.lang.constant.ConstantDesc. | 
protected static class  | 
JavaConstant.Simple.OfTrivialValue<S>
Represents a trivial constant value that represents itself. 
 | 
protected static class  | 
JavaConstant.Simple.OfTypeDescription
Represents a type constant. 
 | 
JavaConstant.Dynamic, JavaConstant.MethodHandle, JavaConstant.MethodType, JavaConstant.Simple<T>, JavaConstant.Visitor<T>| Modifier and Type | Field and Description | 
|---|---|
protected static JavaConstant.Simple.Dispatcher.OfClassDesc | 
CLASS_DESC
A dispatcher for interaction with  
java.lang.constant.ClassDesc. | 
protected static JavaConstant.Simple.Dispatcher | 
CONSTANT_DESC
A dispatcher for interaction with  
java.lang.constant.ClassDesc. | 
protected static JavaConstant.Simple.Dispatcher.OfDirectMethodHandleDesc | 
DIRECT_METHOD_HANDLE_DESC
A dispatcher for interaction with  
java.lang.constant.DirectMethodHandleDesc. | 
protected static JavaConstant.Simple.Dispatcher.OfDirectMethodHandleDesc.ForKind | 
DIRECT_METHOD_HANDLE_DESC_KIND
A dispatcher for interaction with  
java.lang.constant.DirectMethodHandleDesc. | 
protected static JavaConstant.Simple.Dispatcher.OfDynamicConstantDesc | 
DYNAMIC_CONSTANT_DESC
A dispatcher for interaction with  
java.lang.constant.DirectMethodHandleDesc. | 
protected static JavaConstant.Simple.Dispatcher.OfMethodHandleDesc | 
METHOD_HANDLE_DESC
A dispatcher for interaction with  
java.lang.constant.MethodHandleDesc. | 
protected static JavaConstant.Simple.Dispatcher.OfMethodTypeDesc | 
METHOD_TYPE_DESC
A dispatcher for interaction with  
java.lang.constant.MethodTypeDesc. | 
protected T | 
value
The represented constant pool value. 
 | 
| Modifier | Constructor and Description | 
|---|---|
protected  | 
Simple(T value,
      TypeDescription typeDescription)
Creates a simple Java constant. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
boolean | 
equals(Object object)  | 
TypeDescription | 
getTypeDescription()
Returns a description of the type of this constant. 
 | 
T | 
getValue()
Returns the represented value. 
 | 
int | 
hashCode()  | 
static JavaConstant | 
of(TypeDescription typeDescription)
Returns a Java constant representation for a  
TypeDescription. | 
static JavaConstant | 
ofDescription(Object value,
             ClassFileLocator classFileLocator)
Creates a Java constant value from a  
java.lang.constant.ConstantDesc. | 
static JavaConstant | 
ofDescription(Object value,
             ClassLoader classLoader)
Creates a Java constant value from a  
java.lang.constant.ConstantDesc. | 
static JavaConstant | 
ofDescription(Object value,
             TypePool typePool)
Creates a Java constant value from a  
java.lang.constant.ConstantDesc. | 
static JavaConstant | 
ofLoaded(Object value)
Resolves a loaded Java value to a Java constant representation. 
 | 
protected static JavaConstant | 
ofLoadedOrNull(Object value)
Resolves a loaded Java value to a Java constant representation. 
 | 
String | 
toString()  | 
static List<JavaConstant> | 
wrap(List<?> values)
Wraps a list of either loaded or unloaded constant representations as  
JavaConstant instances. | 
static JavaConstant | 
wrap(Object value)
Wraps a value representing a loaded or unloaded constant as  
JavaConstant instance. | 
clone, finalize, getClass, notify, notifyAll, wait, wait, waitaccept, toDescriptiontoStackManipulationprotected static final JavaConstant.Simple.Dispatcher CONSTANT_DESC
java.lang.constant.ClassDesc.protected static final JavaConstant.Simple.Dispatcher.OfClassDesc CLASS_DESC
java.lang.constant.ClassDesc.protected static final JavaConstant.Simple.Dispatcher.OfMethodTypeDesc METHOD_TYPE_DESC
java.lang.constant.MethodTypeDesc.protected static final JavaConstant.Simple.Dispatcher.OfMethodHandleDesc METHOD_HANDLE_DESC
java.lang.constant.MethodHandleDesc.protected static final JavaConstant.Simple.Dispatcher.OfDirectMethodHandleDesc DIRECT_METHOD_HANDLE_DESC
java.lang.constant.DirectMethodHandleDesc.protected static final JavaConstant.Simple.Dispatcher.OfDirectMethodHandleDesc.ForKind DIRECT_METHOD_HANDLE_DESC_KIND
java.lang.constant.DirectMethodHandleDesc.protected static final JavaConstant.Simple.Dispatcher.OfDynamicConstantDesc DYNAMIC_CONSTANT_DESC
java.lang.constant.DirectMethodHandleDesc.protected final T value
protected Simple(T value, TypeDescription typeDescription)
value - The represented constant pool value.typeDescription - A description of the type of the constant.public static JavaConstant ofLoaded(Object value)
value - The value to represent.@MaybeNull protected static JavaConstant ofLoadedOrNull(Object value)
value - The value to represent.null if the supplied argument is not a compile-time constant.public static JavaConstant ofDescription(Object value, @MaybeNull ClassLoader classLoader)
java.lang.constant.ConstantDesc.value - The  java.lang.constant.ConstantDesc to represent.classLoader - The class loader to use for resolving type information from the supplied value.public static JavaConstant ofDescription(Object value, ClassFileLocator classFileLocator)
java.lang.constant.ConstantDesc.value - The  java.lang.constant.ConstantDesc to represent.classFileLocator - The class file locator to use for resolving type information from the supplied value.public static JavaConstant ofDescription(Object value, TypePool typePool)
java.lang.constant.ConstantDesc.value - The  java.lang.constant.ConstantDesc to represent.typePool - The type pool to use for resolving type information from the supplied value.public static JavaConstant of(TypeDescription typeDescription)
TypeDescription.typeDescription - The type to represent as a constant.public static JavaConstant wrap(Object value)
JavaConstant instance.value - The value to wrap.public static List<JavaConstant> wrap(List<?> values)
JavaConstant instances.values - The values to wrap.public T getValue()
public TypeDescription getTypeDescription()
getTypeDescription in interface ConstantValuepublic boolean equals(@MaybeNull Object object)
Copyright © 2014–2023. All rights reserved.