public static interface Instrumentation.Context
MethodVisitor. As such, an instrumentation context and a
MethodVisitor are complementary for creating an new Java type.| Modifier and Type | Interface and Description |
|---|---|
static class |
Instrumentation.Context.Default
A default implementation of an
Instrumentation.Context.ExtractableView
which serves as its own AuxiliaryType.MethodAccessorFactory. |
static interface |
Instrumentation.Context.ExtractableView
Represents an extractable view of an
Instrumentation.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 instrumentation.
|
TypeDescription register(AuxiliaryType auxiliaryType)
auxiliaryType - The auxiliary type that is required for the current instrumentation.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. All rights reserved.