public interface TransformField extends AnnotationProvider, Comparable<TransformField>
ClassTransformation
,
allowing the details of the field to be
accessed or modified.Modifier and Type | Method and Description |
---|---|
void |
claim(Object tag)
Claims the field so as to ensure that only a single annotation is applied to any single field.
|
FieldAccess |
getAccess()
Returns an object that can be used to access the value of the field for read and update.
|
int |
getModifiers()
Returns the modifiers for the field.
|
String |
getName()
Returns the name of the field.
|
String |
getSignature()
Returns the field's fully qualified generic type, or null if not defined.
|
String |
getType()
Returns the field's type, either a primitive name (such as "int" or "boolean")
or a fully qualified class name, or an array type name
(in Java source syntax, i.e., "java.lang.String[]").
|
void |
inject(Object value)
Converts this field into a read only field whose value is the provided
value.
|
<T> void |
injectIndirect(ComponentValueProvider<T> provider)
Like
inject(Object) , except that the value to be injected is obtained
from a ComponentValueProvider . |
void |
replaceAccess(ComponentValueProvider<FieldValueConduit> conduitProvider)
Replaces read and write field access with a conduit.
|
void |
replaceAccess(FieldValueConduit conduit)
Replaces read and write field access with a conduit.
|
void |
replaceAccess(TransformField conduitField)
Replaces read and write field access with a conduit.
|
getAnnotation
compareTo
String getType()
String getSignature()
void claim(Object tag)
tag
- a non-null object that represents why the field is being tagged (this is typically
a specific annotation on the field)IllegalStateException
- if the field is already claimed for some other tagvoid replaceAccess(ComponentValueProvider<FieldValueConduit> conduitProvider)
conduitProvider
- provides the actual conduit at class instantiation timevoid replaceAccess(TransformField conduitField)
conduitField
- identifies the field containing (via injection) an instance of FieldValueConduit
void replaceAccess(FieldValueConduit conduit)
conduit
- used to replace read and write access to the fieldint getModifiers()
Field.getModifiers()
void inject(Object value)
value
- the value provided by the field<T> void injectIndirect(ComponentValueProvider<T> provider)
inject(Object)
, except that the value to be injected is obtained
from a ComponentValueProvider
. It is assumed that the provider will return an object
assignable to the field.T
- type of fieldprovider
- provides the value to be assigned to the fieldFieldAccess getAccess()
FieldValueConduit
that has been applied to the field.Copyright © 2003-2012 The Apache Software Foundation.