public enum DefaultValue extends Enum<DefaultValue> implements StackManipulation
StackManipulation.Compound, StackManipulation.Illegal, StackManipulation.LegalTrivial, StackManipulation.Size
Enum Constant and Description |
---|
ANY_REFERENCE
The default value of a reference type which resembles the
null reference. |
DOUBLE
The default value of a
double . |
FLOAT
The default value of a
float . |
INTEGER
The default value of a JVM integer which covers Java's
int , boolean , byte ,
short and char values. |
LONG
The default value of a
long . |
VOID
The default value of a
void which resembles a no-op manipulation. |
Modifier and Type | Method and Description |
---|---|
StackManipulation.Size |
apply(org.objectweb.asm.MethodVisitor methodVisitor,
Implementation.Context implementationContext)
Applies the stack manipulation that is described by this instance.
|
boolean |
isValid()
Determines if this stack manipulation is valid.
|
static StackManipulation |
of(TypeDescription typeDescription)
Creates a stack assignment that loads the default value for a given type.
|
String |
toString() |
static DefaultValue |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static DefaultValue[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final DefaultValue INTEGER
int
, boolean
, byte
,
short
and char
values.public static final DefaultValue LONG
long
.public static final DefaultValue FLOAT
float
.public static final DefaultValue DOUBLE
double
.public static final DefaultValue VOID
void
which resembles a no-op manipulation.public static final DefaultValue ANY_REFERENCE
null
reference.public static DefaultValue[] values()
for (DefaultValue c : DefaultValue.values()) System.out.println(c);
public static DefaultValue valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static StackManipulation of(TypeDescription typeDescription)
typeDescription
- The type for which a default value should be loaded onto the operand stack.public boolean isValid()
StackManipulation
isValid
in interface StackManipulation
false
, this manipulation cannot be applied and should throw an exception.public StackManipulation.Size apply(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext)
StackManipulation
apply
in interface StackManipulation
methodVisitor
- The method visitor used to write the method implementation to.implementationContext
- The context of the current implementation.public String toString()
toString
in class Enum<DefaultValue>
Copyright © 2014–2015. All rights reserved.