|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.tapestry.enhance.ComponentClassFactory
Contains the logic for analyzing and enhancing a single component class.
Internally, this class makes use of org.apache.tapestry.enhance.ClassFabricator
and org.apache.tapestry.enhance.MethodFabricator
.
Constructor Summary | |
ComponentClassFactory(IResourceResolver resolver,
IComponentSpecification specification,
Class componentClass,
IEnhancedClassFactory enhancedClassFactory)
|
Method Summary | |
protected void |
addAutoParameterEnhancer(String parameterName,
IParameterSpecification ps)
|
protected String |
checkAccessors(String propertyName,
Class propertyType,
ILocation location)
Checks to see that that class either doesn't provide the property, or does but the accessor(s) are abstract. |
protected void |
checkPropertyType(PropertyDescriptor pd,
Class propertyType,
ILocation location)
|
Class |
convertPropertyType(String type,
ILocation location)
Given a class name, returns the corresponding class. |
Class |
createEnhancedSubclass()
Invoked by DefaultComponentClassEnhancer to
create, as a org.apache.bcel.classfile.JavaClass , an enahanced
subclass of the component class. |
IEnhancedClass |
getEnhancedClass()
|
protected PropertyDescriptor |
getPropertyDescriptor(String name)
|
boolean |
isAbstract(Method m)
Returns true if the method is null, or is abstract. |
boolean |
isAbstract(PropertyDescriptor pd)
Returns true if the PropertyDescriptor is null, or
(if non-null), if either accessor method is abstract (or missing). |
protected boolean |
isMissingProperty(String propertyName)
|
boolean |
needsEnhancement()
Invokes scanForEnhancements() to identify any
enhancements needed on the class, returning true
if there are any enhancements to be performed. |
protected void |
scanForBindingProperty(String parameterName,
IParameterSpecification ps)
|
protected void |
scanForEnhancements()
Invoked by needsEnhancement() to find any enhancements
that may be needed. |
protected void |
scanForParameterEnhancements()
Invoked by scanForEnhancements() to locate
any enhancements needed for component parameters (this includes
binding properties and connected parameter property). |
protected void |
scanForParameterProperty(String parameterName,
IParameterSpecification ps)
|
protected void |
scanForSpecifiedProperty(IPropertySpecification ps)
|
protected void |
scanForSpecifiedPropertyEnhancements()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ComponentClassFactory(IResourceResolver resolver, IComponentSpecification specification, Class componentClass, IEnhancedClassFactory enhancedClassFactory)
Method Detail |
protected PropertyDescriptor getPropertyDescriptor(String name)
public boolean needsEnhancement()
scanForEnhancements()
to identify any
enhancements needed on the class, returning true
if there are any enhancements to be performed.public boolean isAbstract(PropertyDescriptor pd)
PropertyDescriptor
is null, or
(if non-null), if either accessor method is abstract (or missing).public boolean isAbstract(Method m)
public Class convertPropertyType(String type, ILocation location)
type
- to convert to a Classlocation
- of the involved specification element (for exception reporting)protected void checkPropertyType(PropertyDescriptor pd, Class propertyType, ILocation location)
protected String checkAccessors(String propertyName, Class propertyType, ILocation location)
protected boolean isMissingProperty(String propertyName)
public Class createEnhancedSubclass()
DefaultComponentClassEnhancer
to
create, as a org.apache.bcel.classfile.JavaClass
, an enahanced
subclass of the component class. This means creating a default constructor,
new fields, and new accessor and mutator methods. Properties are created
for connected parameters, for all formal parameters (the binding property),
and for all specified parameters (which may be transient or persistent).protected void scanForEnhancements()
needsEnhancement()
to find any enhancements
that may be needed. Should create an IEnhancer
for each one, and add it to the queue using #addEnhancer(IEnhancer)
.protected void scanForParameterEnhancements()
scanForEnhancements()
to locate
any enhancements needed for component parameters (this includes
binding properties and connected parameter property).protected void scanForSpecifiedPropertyEnhancements()
protected void scanForBindingProperty(String parameterName, IParameterSpecification ps)
protected void scanForParameterProperty(String parameterName, IParameterSpecification ps)
protected void addAutoParameterEnhancer(String parameterName, IParameterSpecification ps)
protected void scanForSpecifiedProperty(IPropertySpecification ps)
public IEnhancedClass getEnhancedClass()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |