Package net.bytebuddy.utility.dispatcher
Enum JavaDispatcher.Dispatcher.ForDefaultValue
- java.lang.Object
-
- java.lang.Enum<JavaDispatcher.Dispatcher.ForDefaultValue>
-
- net.bytebuddy.utility.dispatcher.JavaDispatcher.Dispatcher.ForDefaultValue
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<JavaDispatcher.Dispatcher.ForDefaultValue>
,JavaDispatcher.Dispatcher
- Enclosing interface:
- JavaDispatcher.Dispatcher
public static enum JavaDispatcher.Dispatcher.ForDefaultValue extends java.lang.Enum<JavaDispatcher.Dispatcher.ForDefaultValue> implements JavaDispatcher.Dispatcher
A dispatcher that returns a fixed value.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
JavaDispatcher.Dispatcher.ForDefaultValue.OfNonPrimitiveArray
A dispatcher for a non-primitive array type.protected static class
JavaDispatcher.Dispatcher.ForDefaultValue.OfPrimitiveArray
A dispatcher for returning a default value for a primitive array.-
Nested classes/interfaces inherited from interface net.bytebuddy.utility.dispatcher.JavaDispatcher.Dispatcher
JavaDispatcher.Dispatcher.ForConstructor, JavaDispatcher.Dispatcher.ForContainerCreation, JavaDispatcher.Dispatcher.ForDefaultValue, JavaDispatcher.Dispatcher.ForInstanceCheck, JavaDispatcher.Dispatcher.ForNonStaticMethod, JavaDispatcher.Dispatcher.ForStaticMethod, JavaDispatcher.Dispatcher.ForUnresolvedMethod
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BOOLEAN
A dispatcher for aboolean
type.BOOLEAN_REVERSE
A dispatcher for aboolean
type that returnstrue
.BYTE
A dispatcher for abyte
type.CHARACTER
A dispatcher for achar
type.DOUBLE
A dispatcher for adouble
type.FLOAT
A dispatcher for afloat
type.INTEGER
A dispatcher for anint
type.LONG
A dispatcher for along
type.REFERENCE
A dispatcher for a reference type.SHORT
A dispatcher for ashort
type.VOID
A dispatcher for avoid
type.
-
Constructor Summary
Constructors Modifier Constructor Description private
ForDefaultValue(java.lang.Object value, int load, int returned, int size)
Creates a new default value dispatcher.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
apply(org.objectweb.asm.MethodVisitor methodVisitor, java.lang.reflect.Method method)
Implements this dispatcher in a generated proxy.java.lang.Object
invoke(java.lang.Object[] argument)
Invokes the proxied action.protected static JavaDispatcher.Dispatcher
of(java.lang.Class<?> type)
Resolves a fixed value for a given type.static JavaDispatcher.Dispatcher.ForDefaultValue
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static JavaDispatcher.Dispatcher.ForDefaultValue[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
VOID
public static final JavaDispatcher.Dispatcher.ForDefaultValue VOID
A dispatcher for avoid
type.
-
BOOLEAN
public static final JavaDispatcher.Dispatcher.ForDefaultValue BOOLEAN
A dispatcher for aboolean
type.
-
BOOLEAN_REVERSE
public static final JavaDispatcher.Dispatcher.ForDefaultValue BOOLEAN_REVERSE
A dispatcher for aboolean
type that returnstrue
.
-
BYTE
public static final JavaDispatcher.Dispatcher.ForDefaultValue BYTE
A dispatcher for abyte
type.
-
SHORT
public static final JavaDispatcher.Dispatcher.ForDefaultValue SHORT
A dispatcher for ashort
type.
-
CHARACTER
public static final JavaDispatcher.Dispatcher.ForDefaultValue CHARACTER
A dispatcher for achar
type.
-
INTEGER
public static final JavaDispatcher.Dispatcher.ForDefaultValue INTEGER
A dispatcher for anint
type.
-
LONG
public static final JavaDispatcher.Dispatcher.ForDefaultValue LONG
A dispatcher for along
type.
-
FLOAT
public static final JavaDispatcher.Dispatcher.ForDefaultValue FLOAT
A dispatcher for afloat
type.
-
DOUBLE
public static final JavaDispatcher.Dispatcher.ForDefaultValue DOUBLE
A dispatcher for adouble
type.
-
REFERENCE
public static final JavaDispatcher.Dispatcher.ForDefaultValue REFERENCE
A dispatcher for a reference type.
-
-
Constructor Detail
-
ForDefaultValue
private ForDefaultValue(java.lang.Object value, int load, int returned, int size)
Creates a new default value dispatcher.- Parameters:
value
- The default value.load
- The opcode to load the default value.returned
- The opcode to return the default value.size
- The operand stack size of default value.
-
-
Method Detail
-
values
public static JavaDispatcher.Dispatcher.ForDefaultValue[] 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 (JavaDispatcher.Dispatcher.ForDefaultValue c : JavaDispatcher.Dispatcher.ForDefaultValue.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static JavaDispatcher.Dispatcher.ForDefaultValue 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
-
of
protected static JavaDispatcher.Dispatcher of(java.lang.Class<?> type)
Resolves a fixed value for a given type.- Parameters:
type
- The type to resolve.- Returns:
- An appropriate dispatcher.
-
invoke
public java.lang.Object invoke(java.lang.Object[] argument)
Invokes the proxied action.- Specified by:
invoke
in interfaceJavaDispatcher.Dispatcher
- Parameters:
argument
- The arguments provided.- Returns:
- The return value.
-
apply
public int apply(org.objectweb.asm.MethodVisitor methodVisitor, java.lang.reflect.Method method)
Implements this dispatcher in a generated proxy.- Specified by:
apply
in interfaceJavaDispatcher.Dispatcher
- Parameters:
methodVisitor
- The method visitor to implement the method with.method
- The method being implemented.- Returns:
- The maximal size of the operand stack.
-
-