|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tapestry.enhance.ComponentClassFactory
public class ComponentClassFactory
Contains the logic for analyzing and enhancing a single component class.
Internally, this class makes use of IEnhancedClassFactory
.
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 an enahanced
subclass of the component class. |
IEnhancedClass |
getEnhancedClass()
|
protected PropertyDescriptor |
getPropertyDescriptor(String name)
|
boolean |
isAbstract(Method m)
|
boolean |
isImplemented(Method m)
|
boolean |
isImplemented(PropertyDescriptor pd)
|
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 |
scanForAbstractClass()
|
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()
|
protected String |
translateClassName(String type)
Translates types from standard Java format to Java VM format. |
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 isImplemented(PropertyDescriptor pd)
public boolean isAbstract(Method m)
public boolean isImplemented(Method m)
public Class convertPropertyType(String type, ILocation location)
type
- to convert to a Classlocation
- of the involved specification element (for exception reporting)protected String translateClassName(String type)
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 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.
protected void scanForAbstractClass()
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: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |