Package net.bytebuddy.utility
Interface JavaConstant
-
- All Superinterfaces:
ConstantValue
- All Known Implementing Classes:
JavaConstant.Dynamic,JavaConstant.MethodHandle,JavaConstant.MethodType,JavaConstant.Simple,JavaConstant.Simple.OfTrivialValue,JavaConstant.Simple.OfTrivialValue.ForDouble,JavaConstant.Simple.OfTrivialValue.ForFloat,JavaConstant.Simple.OfTrivialValue.ForInteger,JavaConstant.Simple.OfTrivialValue.ForLong,JavaConstant.Simple.OfTrivialValue.ForString,JavaConstant.Simple.OfTypeDescription
public interface JavaConstant extends ConstantValue
Represents a constant-pool constant within a Java class file.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classJavaConstant.DynamicRepresents a dynamically resolved constant pool entry of a class file.static classJavaConstant.MethodHandleRepresents ajava.lang.invoke.MethodHandleobject.static classJavaConstant.MethodTypeRepresents ajava.lang.invoke.MethodTypeobject.static classJavaConstant.Simple<T>Represents a simple Java constant, either a primitive constant, aStringor aClass.static interfaceJavaConstant.Visitor<T>A visitor to resolve aJavaConstantbased on its implementation.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> Taccept(JavaConstant.Visitor<T> visitor)Applies the supplied visitor to this constant type with its respective callback.java.lang.ObjecttoDescription()Returns this constant as a Javajava.lang.constant.ConstantDescif the current VM is of at least version 12.-
Methods inherited from interface net.bytebuddy.utility.ConstantValue
getTypeDescription, toStackManipulation
-
-
-
-
Method Detail
-
toDescription
java.lang.Object toDescription()
Returns this constant as a Javajava.lang.constant.ConstantDescif the current VM is of at least version 12. If the current VM is of an older version and does not support the type, an exception is thrown.- Returns:
- This constant as a Java
java.lang.constant.ConstantDesc.
-
accept
<T> T accept(JavaConstant.Visitor<T> visitor)
Applies the supplied visitor to this constant type with its respective callback.- Type Parameters:
T- The type of the value that is returned by the visitor.- Parameters:
visitor- The visitor to dispatch.- Returns:
- The value that is returned by the supplied visitor.
-
-