|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ClassTransformation
Contains class-specific information used when transforming a raw component class into an
executable component class.
An executable class is one that has been transformed to work within Tapestry. This includes
adding interfaces
(Component
) but also transforming access to fields, based on
annotations and
naming conventions. Most of the changes are provided by different implementations of
ComponentClassTransformWorker
.
PlasticClass
Method Summary | ||
---|---|---|
void |
addComponentEventHandler(String eventType,
int minContextValues,
String methodDescription,
ComponentEventHandler handler)
Deprecated. Adds advice to the Component.dispatchComponentEvent(org.apache.tapestry5.runtime.ComponentEvent) method. |
|
void |
addImplementedInterface(Class interfaceClass)
Deprecated. Transforms the class to implement the indicated interface. |
|
|
addIndirectInjectedField(Class<T> type,
String suggestedName,
ComponentValueProvider<T> provider)
Deprecated. Like addInjectedField(Class, String, Object) , but instead of specifying the value,
a provider for the value is specified. |
|
String |
addInjectedField(Class type,
String suggestedName,
Object value)
Deprecated. Defines a new protected instance variable whose initial value is provided statically, via a constructor parameter. |
|
TransformField |
createField(int modifiers,
String type,
String suggestedName)
Deprecated. Defines a new declared field for the class. |
|
String |
getClassName()
Deprecated. Returns the fully qualified class name of the class being transformed. |
|
TransformField |
getField(String fieldName)
Deprecated. Locates a declared field by its field name. |
|
org.slf4j.Logger |
getLogger()
Deprecated. Returns a logger, based on the class name being transformed, to which warnings or errors concerning the class being transformed may be logged. |
|
TransformMethod |
getOrCreateMethod(TransformMethodSignature signature)
Deprecated. Locates and returns the method if declared in this class; If not, the method is added to the class. |
|
boolean |
isDeclaredMethod(TransformMethodSignature signature)
Deprecated. Determines if the class being transformed includes a declared (not inherited) method with the provided signature. |
|
boolean |
isField(String fieldName)
Deprecated. Returns true if the indicated name is a private instance field. |
|
boolean |
isRootTransformation()
Deprecated. Returns true if this transformation represents a root class (one that extends directly from Object), or false if this transformation is an sub-class of another transformed class. |
|
List<TransformField> |
matchFields(Predicate<TransformField> predicate)
Deprecated. Finds all unclaimed fields matched by the provided predicate. |
|
List<TransformField> |
matchFieldsWithAnnotation(Class<? extends Annotation> annotationClass)
Deprecated. Returns a sorted list of declared instance fields with the indicated annotation. |
|
List<TransformMethod> |
matchMethods(Predicate<TransformMethod> predicate)
Deprecated. Finds all methods matched by the provided predicate. |
|
List<TransformMethod> |
matchMethodsWithAnnotation(Class<? extends Annotation> annotationType)
Deprecated. Finds all methods matched by the provided predicate. |
|
List<TransformField> |
matchUnclaimedFields()
Deprecated. Matches all fields that are not claimed. |
|
String |
newMemberName(String suggested)
Deprecated. Returns the name of a new member (field or method). |
|
String |
newMemberName(String prefix,
String baseName)
Deprecated. As with newMemberName(String) , but the suggested name is constructed from the prefix
and base name. |
|
Class |
toClass(String type)
Deprecated. Converts a type name into a corresponding class (possibly, a transformed class). |
Methods inherited from interface org.apache.tapestry5.ioc.AnnotationProvider |
---|
getAnnotation |
Method Detail |
---|
String getClassName()
String newMemberName(String suggested)
suggested
- the suggested value for the member
String newMemberName(String prefix, String baseName)
newMemberName(String)
, but the suggested name is constructed from the prefix
and base name. An
underscore will separate the prefix from the base name.
prefix
- for the generated namebaseName
- a name, often of an existing field or method
List<TransformField> matchFieldsWithAnnotation(Class<? extends Annotation> annotationClass)
List<TransformMethod> matchMethods(Predicate<TransformMethod> predicate)
predicate
- Used to filter the list
List<TransformMethod> matchMethodsWithAnnotation(Class<? extends Annotation> annotationType)
annotationType
- Used to filter the list
List<TransformField> matchFields(Predicate<TransformField> predicate)
predicate
- used for matching
TransformField getField(String fieldName)
fieldName
- of declared field
RuntimeException
- if no such fieldList<TransformField> matchUnclaimedFields()
boolean isField(String fieldName)
TransformField createField(int modifiers, String type, String suggestedName)
modifiers
- modifiers for the field (typically, Modifier.PRIVATE
)type
- the type for the field, as a stringsuggestedName
- the desired name for the field, which may be modified (for uniqueness) when
returned
String addInjectedField(Class type, String suggestedName, Object value)
type
- the type of object to injectsuggestedName
- the suggested name for the new fieldvalue
- to be injected. This value is retained.
<T> TransformField addIndirectInjectedField(Class<T> type, String suggestedName, ComponentValueProvider<T> provider)
addInjectedField(Class, String, Object)
, but instead of specifying the value,
a provider for the value is specified. In the generated class' constructor, the provider
will be passed the ComponentResources
and will return the final value; thus
each component instance will receive a matching unique instance via the provider.
type
- type of value to injectsuggestedName
- suggested name for the new fieldprovider
- injected into the component to provide the value
void addImplementedInterface(Class interfaceClass)
interfaceClass
- the interface to be implemented by the class
IllegalArgumentException
- if the interfaceClass argument does not represent an interfaceClass toClass(String type)
org.slf4j.Logger getLogger()
boolean isRootTransformation()
TransformMethod getOrCreateMethod(TransformMethodSignature signature)
signature
- identifies the method to locate, override or createboolean isDeclaredMethod(TransformMethodSignature signature)
signature
- identifies method to search for
void addComponentEventHandler(String eventType, int minContextValues, String methodDescription, ComponentEventHandler handler)
Component.dispatchComponentEvent(org.apache.tapestry5.runtime.ComponentEvent)
method.
If the handler is invoked,
the return value of the method will be overriden to true. Updates
the model to
indicate that there is a handler for the named event. Existing handlers, or super-class handlers,
are invoked first.
eventType
- name of event to be handledminContextValues
- minimum number of event context values required to invoke the methodmethodDescription
- Text description of what the handler does (used with Event.setMethodDescription(String)
)handler
- the handler to invoke
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |