public static interface Implementation.Context extends MethodAccessorFactory
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 MethodAccessorFactory . |
static class |
Implementation.Context.Disabled
An implementation context that does not allow for any injections into the static initializer block.
|
static interface |
Implementation.Context.ExtractableView
Represents an extractable view of an
Implementation.Context which
allows the retrieval of any registered auxiliary type. |
static interface |
Implementation.Context.Factory
A factory for creating a new implementation context.
|
static class |
Implementation.Context.FrameGeneration
Indicates the frame generation being applied.
|
MethodAccessorFactory.AccessType, MethodAccessorFactory.Illegal
Modifier and Type | Method and Description |
---|---|
FieldDescription.InDefinedShape |
cache(StackManipulation fieldValue,
TypeDescription fieldType)
Caches a single value by storing it in form of a
private , final and static field. |
ClassFileVersion |
getClassFileVersion()
Returns the class file version of the currently creatgetClassFileVersioned dynamic type.
|
Implementation.Context.FrameGeneration |
getFrameGeneration()
Returns
true if the explicit generation of stack map frames is expected. |
TypeDescription |
getInstrumentedType()
Returns the instrumented type of the current implementation.
|
TypeDescription |
register(AuxiliaryType auxiliaryType)
Registers an auxiliary type as required for the current implementation.
|
registerAccessorFor, registerGetterFor, registerSetterFor
TypeDescription register(AuxiliaryType auxiliaryType)
auxiliaryType
- The auxiliary type that is required for the current implementation.FieldDescription.InDefinedShape 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.TypeDescription getInstrumentedType()
StackManipulation
.ClassFileVersion getClassFileVersion()
Implementation.Context.FrameGeneration getFrameGeneration()
true
if the explicit generation of stack map frames is expected.true
if the explicit generation of stack map frames is expected.Copyright © 2014–2025. All rights reserved.