|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PlasticField
Represents a field of a class being transformed.
No methods of this object should be invoked after the class transformation is completed.
Method Summary | ||
---|---|---|
PlasticField |
claim(Object tag)
Claims the field, used to indicate that the field is "processed". |
|
PlasticField |
createAccessors(PropertyAccessType accessType)
Creates access to the field, using the default property name derived from the name of the field. |
|
PlasticField |
createAccessors(PropertyAccessType accessType,
String propertyName)
Creates accessors, possibly replacing existing methods (or overriding methods from a super class). |
|
String |
getGenericSignature()
Returns the field's fully qualified generic type, or null if not defined. |
|
FieldHandle |
getHandle()
Returns a handle that can be used to directly access a private field of a transformed class instance. |
|
int |
getModifiers()
Returns the modifiers on the field. |
|
String |
getName()
Returns the name of the field. |
|
PlasticClass |
getPlasticClass()
Returns the class containing this field. |
|
String |
getTypeName()
Returns the fully qualified class name for the field's type or (for a primitive type) the primitive type name ("int", "char", etc.). |
|
PlasticField |
inject(Object value)
Converts the field to be read-only, and provide the indicated value. |
|
PlasticField |
injectComputed(ComputedValue<?> computedValue)
Converts the field to be read-only, and provide the value, which is computed indirectly inside the class' constructor. |
|
PlasticField |
injectFromInstanceContext()
As with inject(Object) , but the value is extracted from the InstanceContext . |
|
boolean |
isClaimed()
Returns true if the field has already been claimed. |
|
|
setComputedConduit(ComputedValue<FieldConduit<F>> computedConduit)
Sets the conduit for the field to a value computed when the class is instantiated |
|
|
setConduit(FieldConduit<F> conduit)
Intercepts all access to the field, replacing such access with calls on the conduit. |
Methods inherited from interface org.apache.tapestry5.plastic.AnnotationAccess |
---|
getAnnotation, hasAnnotation |
Method Detail |
---|
PlasticClass getPlasticClass()
FieldHandle getHandle()
String getName()
String getTypeName()
PlasticField claim(Object tag)
PlasticClassTransformer
that performed the transformation. That tag value is only used when generating the error message for the case
where a field is claimed for than once.
RuntimeException
- if the field is claimed a second time
AssertionError
- if tag is nullPlasticClass.getUnclaimedFields()
boolean isClaimed()
PlasticClass.getUnclaimedFields()
PlasticField inject(Object value)
value
- to inject, which must be type compatible with the field (possibly, a wrapper type if the field is
a primitive value). The value may not be null.
IllegalStateException
- if the field already has an injection, or the field has a conduitPlasticField injectComputed(ComputedValue<?> computedValue)
computedValue
- provides the actual value to be injected, and must return a value type compatible
with the field (possibly a wrapper type if the field is a primitive value). The computedValue may not
be null.
IllegalStateException
- if the field already has an injection, or the field has a conduitPlasticField injectFromInstanceContext()
inject(Object)
, but the value is extracted from the InstanceContext
.
<F> PlasticField setConduit(FieldConduit<F> conduit)
Normally, once a conduit is in place, the field will never be actually read or written. This is problematic for
debugging, so TransformationOption.FIELD_WRITEBEHIND
is useful when operating in a non-production mode.
IllegalStateException
- if the field already has an injection or a conduit<F> PlasticField setComputedConduit(ComputedValue<FieldConduit<F>> computedConduit)
computedConduit
- object that will compute the actual conduit to be used
PlasticField createAccessors(PropertyAccessType accessType)
accessType
- which methods to create
IllegalArgumentException
- if an accessor method to be created already exists (possibly inherited from a base class)PlasticField createAccessors(PropertyAccessType accessType, String propertyName)
accessType
- which methods to createpropertyName
- the name of the property (from which the names of the methods are generated)
IllegalArgumentException
- if an accessor method to be created already exists (possibly inherited from a base class)String getGenericSignature()
int getModifiers()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |