Enum JavaConstantValue.Visitor
- java.lang.Object
-
- java.lang.Enum<JavaConstantValue.Visitor>
-
- net.bytebuddy.implementation.bytecode.constant.JavaConstantValue.Visitor
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<JavaConstantValue.Visitor>
,JavaConstant.Visitor<java.lang.Object>
- Enclosing class:
- JavaConstantValue
public static enum JavaConstantValue.Visitor extends java.lang.Enum<JavaConstantValue.Visitor> implements JavaConstant.Visitor<java.lang.Object>
A visitor to resolve aJavaConstant
to a ASM constant pool representation.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.utility.JavaConstant.Visitor
JavaConstant.Visitor.NoOp
-
-
Enum Constant Summary
Enum Constants Enum Constant Description INSTANCE
The singleton instance.
-
Constructor Summary
Constructors Modifier Constructor Description private
Visitor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.objectweb.asm.ConstantDynamic
onDynamic(JavaConstant.Dynamic constant)
Invoked on aJavaConstant.Dynamic
constant.org.objectweb.asm.Handle
onMethodHandle(JavaConstant.MethodHandle constant)
Invoked on a constant that represents aJavaConstant.MethodHandle
.org.objectweb.asm.Type
onMethodType(JavaConstant.MethodType constant)
Invoked on a constant that represents aJavaConstant.MethodType
.org.objectweb.asm.Type
onType(JavaConstant.Simple<TypeDescription> constant)
Invoked on aJavaConstant.Simple
constant that represents aTypeDescription
.java.lang.Object
onValue(JavaConstant.Simple<?> constant)
Invoked on aJavaConstant.Simple
constant that represents itself.static JavaConstantValue.Visitor
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static JavaConstantValue.Visitor[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INSTANCE
public static final JavaConstantValue.Visitor INSTANCE
The singleton instance.
-
-
Method Detail
-
values
public static JavaConstantValue.Visitor[] 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 (JavaConstantValue.Visitor c : JavaConstantValue.Visitor.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static JavaConstantValue.Visitor valueOf(java.lang.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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
onValue
public java.lang.Object onValue(JavaConstant.Simple<?> constant)
Invoked on aJavaConstant.Simple
constant that represents itself. Such values are of typeInteger
,Long
,Float
,Double
orString
.- Specified by:
onValue
in interfaceJavaConstant.Visitor<java.lang.Object>
- Parameters:
constant
- The simple constant.- Returns:
- The returned value.
-
onType
public org.objectweb.asm.Type onType(JavaConstant.Simple<TypeDescription> constant)
Invoked on aJavaConstant.Simple
constant that represents aTypeDescription
.- Specified by:
onType
in interfaceJavaConstant.Visitor<java.lang.Object>
- Parameters:
constant
- The simple constant.- Returns:
- The returned value.
-
onMethodType
public org.objectweb.asm.Type onMethodType(JavaConstant.MethodType constant)
Invoked on a constant that represents aJavaConstant.MethodType
.- Specified by:
onMethodType
in interfaceJavaConstant.Visitor<java.lang.Object>
- Parameters:
constant
- The method type constant.- Returns:
- The returned value.
-
onMethodHandle
public org.objectweb.asm.Handle onMethodHandle(JavaConstant.MethodHandle constant)
Invoked on a constant that represents aJavaConstant.MethodHandle
.- Specified by:
onMethodHandle
in interfaceJavaConstant.Visitor<java.lang.Object>
- Parameters:
constant
- The method handle constant.- Returns:
- The returned value.
-
onDynamic
public org.objectweb.asm.ConstantDynamic onDynamic(JavaConstant.Dynamic constant)
Invoked on aJavaConstant.Dynamic
constant.- Specified by:
onDynamic
in interfaceJavaConstant.Visitor<java.lang.Object>
- Parameters:
constant
- The dynamic constant.- Returns:
- The returned value.
-
-