public static interface Implementation.Context
MethodVisitor
. As such, an implementation context and a
MethodVisitor
are complementary for creating an new Java type.Modifier and Type | Interface and Description |
---|---|
static class |
Implementation.Context.Default
A default implementation of an
Implementation.Context.ExtractableView
which serves as its own AuxiliaryType.MethodAccessorFactory . |
static interface |
Implementation.Context.ExtractableView
Represents an extractable view of an
Implementation.Context which
allows the retrieval of any registered auxiliary type. |
Modifier and Type | Method and Description |
---|---|
FieldDescription |
cache(StackManipulation fieldValue,
TypeDescription fieldType)
Caches a single value by storing it in form of a
private , final and static field. |
TypeDescription |
register(AuxiliaryType auxiliaryType)
Registers an auxiliary type as required for the current implementation.
|
TypeDescription register(AuxiliaryType auxiliaryType)
auxiliaryType
- The auxiliary type that is required for the current implementation.FieldDescription cache(StackManipulation fieldValue, TypeDescription fieldType)
private
, final
and static
field.
By caching values, expensive instance creations can be avoided and object identity can be preserved.
The field is initiated in a generated class's static initializer.fieldValue
- A stack manipulation for creating the value that is to be cached in a static
field.
After executing the stack manipulation, exactly one value must be put onto the operand
stack which is assignable to the given fieldType
.fieldType
- The type of the field for storing the cached value. This field's type determines the value
that is put onto the operand stack by this method's returned stack manipulation.Copyright © 2014–2015. All rights reserved.