public static class Implementation.Context.Disabled extends Object implements Implementation.Context.ExtractableView
Modifier and Type | Class and Description |
---|---|
static class |
Implementation.Context.Disabled.Factory
A factory for creating a
Implementation.Context.Disabled . |
Implementation.Context.ExtractableView.InjectedCode
Implementation.Context.Default, Implementation.Context.Disabled, Implementation.Context.ExtractableView
Modifier | Constructor and Description |
---|---|
protected |
Disabled(TypeDescription instrumentedType)
Creates a new disabled implementation context.
|
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. |
void |
drain(ClassVisitor classVisitor,
TypeWriter.MethodPool methodPool,
Implementation.Context.ExtractableView.InjectedCode injectedCode)
Writes any information that was registered with an
Implementation.Context
to the provided class visitor. |
boolean |
equals(Object other) |
List<DynamicType> |
getRegisteredAuxiliaryTypes()
Returns any
AuxiliaryType that was registered
with this Implementation.Context . |
int |
hashCode() |
boolean |
isRetainTypeInitializer()
Determines if this implementation context allows for the retention of a static type initializer.
|
void |
prohibitTypeInitializer()
Prohibits any instrumentation of an instrumented class's type initializer.
|
TypeDescription |
register(AuxiliaryType auxiliaryType)
Registers an auxiliary type as required for the current implementation.
|
String |
toString() |
protected Disabled(TypeDescription instrumentedType)
instrumentedType
- The instrumented type.public boolean isRetainTypeInitializer()
Implementation.Context.ExtractableView
isRetainTypeInitializer
in interface Implementation.Context.ExtractableView
true
if the original type initializer can be retained. false
if the original type
initializer needs to be copied to another method for allowing code injection into the initializer.public List<DynamicType> getRegisteredAuxiliaryTypes()
Implementation.Context.ExtractableView
AuxiliaryType
that was registered
with this Implementation.Context
.getRegisteredAuxiliaryTypes
in interface Implementation.Context.ExtractableView
public void drain(ClassVisitor classVisitor, TypeWriter.MethodPool methodPool, Implementation.Context.ExtractableView.InjectedCode injectedCode)
Implementation.Context.ExtractableView
Implementation.Context
to the provided class visitor. This contains any fields for value caching, any accessor method and it
writes the type initializer. The type initializer must therefore never be written manually.drain
in interface Implementation.Context.ExtractableView
classVisitor
- The class visitor to which the extractable view is to be written.methodPool
- A method pool which is queried for any user code to add to the type initializer.injectedCode
- Potential code that is to be injected into the type initializer.public TypeDescription register(AuxiliaryType auxiliaryType)
Implementation.Context
register
in interface Implementation.Context
auxiliaryType
- The auxiliary type that is required for the current implementation.public FieldDescription cache(StackManipulation fieldValue, TypeDescription fieldType)
Implementation.Context
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.cache
in interface Implementation.Context
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.public void prohibitTypeInitializer()
Implementation.Context.ExtractableView
prohibitTypeInitializer
in interface Implementation.Context.ExtractableView
Copyright © 2014–2015. All rights reserved.