|
||||||||||
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(java.lang.String eventType,
int minContextValues,
java.lang.String methodDescription,
ComponentEventHandler handler)
Deprecated. Adds advice to the Component.dispatchComponentEvent(org.apache.tapestry5.runtime.ComponentEvent) method. |
|
void |
addImplementedInterface(java.lang.Class interfaceClass)
Deprecated. Transforms the class to implement the indicated interface. |
|
|
addIndirectInjectedField(java.lang.Class<T> type,
java.lang.String suggestedName,
ComponentValueProvider<T> provider)
Deprecated. Like addInjectedField(Class, String, Object) , but instead of specifying the value,
a provider for the value is specified. |
|
java.lang.String |
addInjectedField(java.lang.Class type,
java.lang.String suggestedName,
java.lang.Object value)
Deprecated. Defines a new protected instance variable whose initial value is provided statically, via a constructor parameter. |
|
TransformField |
createField(int modifiers,
java.lang.String type,
java.lang.String suggestedName)
Deprecated. Defines a new declared field for the class. |
|
java.lang.String |
getClassName()
Deprecated. Returns the fully qualified class name of the class being transformed. |
|
TransformField |
getField(java.lang.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(java.lang.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. |
|
java.util.List<TransformField> |
matchFields(Predicate<TransformField> predicate)
Deprecated. Finds all unclaimed fields matched by the provided predicate. |
|
java.util.List<TransformField> |
matchFieldsWithAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
Deprecated. Returns a sorted list of declared instance fields with the indicated annotation. |
|
java.util.List<TransformMethod> |
matchMethods(Predicate<TransformMethod> predicate)
Deprecated. Finds all methods matched by the provided predicate. |
|
java.util.List<TransformMethod> |
matchMethodsWithAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Deprecated. Finds all methods matched by the provided predicate. |
|
java.util.List<TransformField> |
matchUnclaimedFields()
Deprecated. Matches all fields that are not claimed. |
|
java.lang.String |
newMemberName(java.lang.String suggested)
Deprecated. Returns the name of a new member (field or method). |
|
java.lang.String |
newMemberName(java.lang.String prefix,
java.lang.String baseName)
Deprecated. As with newMemberName(String) , but the suggested name is constructed from the prefix
and base name. |
|
java.lang.Class |
toClass(java.lang.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 |
---|
java.lang.String getClassName()
java.lang.String newMemberName(java.lang.String suggested)
suggested
- the suggested value for the member
java.lang.String newMemberName(java.lang.String prefix, java.lang.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
java.util.List<TransformField> matchFieldsWithAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
java.util.List<TransformMethod> matchMethods(Predicate<TransformMethod> predicate)
predicate
- Used to filter the list
java.util.List<TransformMethod> matchMethodsWithAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
annotationType
- Used to filter the list
java.util.List<TransformField> matchFields(Predicate<TransformField> predicate)
predicate
- used for matching
TransformField getField(java.lang.String fieldName)
fieldName
- of declared field
java.lang.RuntimeException
- if no such fieldjava.util.List<TransformField> matchUnclaimedFields()
boolean isField(java.lang.String fieldName)
TransformField createField(int modifiers, java.lang.String type, java.lang.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
java.lang.String addInjectedField(java.lang.Class type, java.lang.String suggestedName, java.lang.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(java.lang.Class<T> type, java.lang.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(java.lang.Class interfaceClass)
interfaceClass
- the interface to be implemented by the class
java.lang.IllegalArgumentException
- if the interfaceClass argument does not represent an interfacejava.lang.Class toClass(java.lang.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(java.lang.String eventType, int minContextValues, java.lang.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 |