Top Description Fields Constructors Methods
net.bytebuddy.implementation.bytecode.constant

public final Enum DefaultValue

extends Enum<DefaultValue>
implements StackManipulation
Class Inheritance
All Implemented Interfaces
net.bytebuddy.implementation.bytecode.StackManipulation
Imports
net.bytebuddy.description.type.TypeDefinition, net.bytebuddy.implementation.Implementation, net.bytebuddy.implementation.bytecode.StackManipulation, net.bytebuddy.jar.asm.MethodVisitor

Represents a stack assignment that loads the default value of a given type onto the stack.

Field Summary

Modifier and TypeField and Description
public static final DefaultValue
DOUBLE

The default value of a double.

public static final DefaultValue
FLOAT

The default value of a float.

public static final DefaultValue
INTEGER

The default value of a JVM integer which covers Java's int, boolean, byte, short and char values.

public static final DefaultValue
LONG

The default value of a long.

public static final DefaultValue
REFERENCE

The default value of a reference type which resembles the null reference.

private final StackManipulation
stackManipulation

The stack manipulation that represents the loading of a given default value onto the operand stack.

public static final DefaultValue
VOID

The default value of a void which resembles a no-op manipulation.

Constructor Summary

AccessConstructor and Description
private
DefaultValue(StackManipulation
The stack manipulation that represents the loading of a given default value onto the operand stack.
stackManipulation
)

Creates a new default value load operation.

Method Summary

Modifier and TypeMethod and Description
public StackManipulation.Size
apply(MethodVisitor
The method visitor used to write the method implementation to.
methodVisitor
,
Implementation.Context
The context of the current implementation.
implementationContext
)

Implements net.bytebuddy.implementation.bytecode.StackManipulation.apply.

Applies the stack manipulation that is described by this instance.
public boolean
isValid()

Implements net.bytebuddy.implementation.bytecode.StackManipulation.isValid.

Determines if this stack manipulation is valid.
public static StackManipulation

Returns:

A stack manipulation loading the default value for the given type.
of
(TypeDefinition
The type for which a default value should be loaded onto the operand stack.
typeDefinition
)

Creates a stack assignment that loads the default value for a given type.

public static DefaultValue
public static DefaultValue[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

DOUBLEback to summary
public static final DefaultValue DOUBLE

The default value of a double.

FLOATback to summary
public static final DefaultValue FLOAT

The default value of a float.

INTEGERback to summary
public static final DefaultValue INTEGER

The default value of a JVM integer which covers Java's int, boolean, byte, short and char values.

LONGback to summary
public static final DefaultValue LONG

The default value of a long.

REFERENCEback to summary
public static final DefaultValue REFERENCE

The default value of a reference type which resembles the null reference.

stackManipulationback to summary
private final StackManipulation stackManipulation

The stack manipulation that represents the loading of a given default value onto the operand stack.

VOIDback to summary
public static final DefaultValue VOID

The default value of a void which resembles a no-op manipulation.

Constructor Detail

DefaultValueback to summary
private DefaultValue(StackManipulation stackManipulation)

Creates a new default value load operation.

Parameters
stackManipulation:StackManipulation

The stack manipulation that represents the loading of a given default value onto the operand stack.

Method Detail

applyback to summary
public StackManipulation.Size apply(MethodVisitor methodVisitor, Implementation.Context implementationContext)

Implements net.bytebuddy.implementation.bytecode.StackManipulation.apply.

Doc from net.bytebuddy.implementation.bytecode.StackManipulation.apply.

Applies the stack manipulation that is described by this instance.

Parameters
methodVisitor:MethodVisitor

The method visitor used to write the method implementation to.

implementationContext:Implementation.Context

The context of the current implementation.

Returns:StackManipulation.Size

The changes to the size of the operand stack that are implied by this stack manipulation.

isValidback to summary
public boolean isValid()

Implements net.bytebuddy.implementation.bytecode.StackManipulation.isValid.

Doc from net.bytebuddy.implementation.bytecode.StackManipulation.isValid.

Determines if this stack manipulation is valid.

Returns:boolean

If false, this manipulation cannot be applied and should throw an exception.

ofback to summary
public static StackManipulation of(TypeDefinition typeDefinition)

Creates a stack assignment that loads the default value for a given type.

Parameters
typeDefinition:TypeDefinition

The type for which a default value should be loaded onto the operand stack.

Returns:StackManipulation

A stack manipulation loading the default value for the given type.

valueOfback to summary
public static DefaultValue valueOf(String name)
valuesback to summary
public static DefaultValue[] values()