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 classJavaDispatcher.Dispatcher.ForDefaultValue.OfNonPrimitiveArrayA dispatcher for a non-primitive array type.protected static classJavaDispatcher.Dispatcher.ForDefaultValue.OfPrimitiveArrayA 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 BOOLEANA dispatcher for abooleantype.BOOLEAN_REVERSEA dispatcher for abooleantype that returnstrue.BYTEA dispatcher for abytetype.CHARACTERA dispatcher for achartype.DOUBLEA dispatcher for adoubletype.FLOATA dispatcher for afloattype.INTEGERA dispatcher for aninttype.LONGA dispatcher for alongtype.REFERENCEA dispatcher for a reference type.SHORTA dispatcher for ashorttype.VOIDA dispatcher for avoidtype.
-
Constructor Summary
Constructors Modifier Constructor Description privateForDefaultValue(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 intapply(org.objectweb.asm.MethodVisitor methodVisitor, java.lang.reflect.Method method)Implements this dispatcher in a generated proxy.java.lang.Objectinvoke(java.lang.Object[] argument)Invokes the proxied action.protected static JavaDispatcher.Dispatcherof(java.lang.Class<?> type)Resolves a fixed value for a given type.static JavaDispatcher.Dispatcher.ForDefaultValuevalueOf(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 avoidtype.
-
BOOLEAN
public static final JavaDispatcher.Dispatcher.ForDefaultValue BOOLEAN
A dispatcher for abooleantype.
-
BOOLEAN_REVERSE
public static final JavaDispatcher.Dispatcher.ForDefaultValue BOOLEAN_REVERSE
A dispatcher for abooleantype that returnstrue.
-
BYTE
public static final JavaDispatcher.Dispatcher.ForDefaultValue BYTE
A dispatcher for abytetype.
-
SHORT
public static final JavaDispatcher.Dispatcher.ForDefaultValue SHORT
A dispatcher for ashorttype.
-
CHARACTER
public static final JavaDispatcher.Dispatcher.ForDefaultValue CHARACTER
A dispatcher for achartype.
-
INTEGER
public static final JavaDispatcher.Dispatcher.ForDefaultValue INTEGER
A dispatcher for aninttype.
-
LONG
public static final JavaDispatcher.Dispatcher.ForDefaultValue LONG
A dispatcher for alongtype.
-
FLOAT
public static final JavaDispatcher.Dispatcher.ForDefaultValue FLOAT
A dispatcher for afloattype.
-
DOUBLE
public static final JavaDispatcher.Dispatcher.ForDefaultValue DOUBLE
A dispatcher for adoubletype.
-
REFERENCE
public static final JavaDispatcher.Dispatcher.ForDefaultValue REFERENCE
A dispatcher for a reference type.
-
-
Field Detail
-
value
@MaybeNull private final java.lang.Object value
The default value.
-
load
private final int load
The opcode to load the default value.
-
returned
private final int returned
The opcode to return the default value.
-
size
private final int size
The operand stack size of default value.
-
-
Constructor Detail
-
ForDefaultValue
private ForDefaultValue(@MaybeNull 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
@MaybeNull public java.lang.Object invoke(java.lang.Object[] argument)
Invokes the proxied action.- Specified by:
invokein 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:
applyin 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.
-
-