org.apache.tapestry.enhance
Class DefaultComponentClassEnhancer
java.lang.Object
|
+--org.apache.tapestry.enhance.DefaultComponentClassEnhancer
- All Implemented Interfaces:
- IComponentClassEnhancer
- public class DefaultComponentClassEnhancer
- extends Object
- implements IComponentClassEnhancer
Default implementation of org.apache.tapestry.IComponentClassEnhancer
.
- Since:
- 3.0
- Version:
- $Id: DefaultComponentClassEnhancer.java,v 1.9 2003/06/21 19:47:24 mindbridge Exp $
- Author:
- Howard Lewis Ship
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultComponentClassEnhancer
public DefaultComponentClassEnhancer(IResourceResolver resolver)
createEnhancedClassFactory
protected IEnhancedClassFactory createEnhancedClassFactory()
reset
public void reset()
- Description copied from interface:
IComponentClassEnhancer
- Clears all cached data for the enhancer; this includes references to
enhanced classes.
- Specified by:
reset
in interface IComponentClassEnhancer
getResourceResolver
public IResourceResolver getResourceResolver()
getEnhancedClass
public Class getEnhancedClass(IComponentSpecification specification,
String className)
- Description copied from interface:
IComponentClassEnhancer
- Used to access the class for a given component (or page). Returns the
specified class, or an enhanced version of the class if the
component requires enhancement.
- Specified by:
getEnhancedClass
in interface IComponentClassEnhancer
- Following copied from interface:
org.apache.tapestry.engine.IComponentClassEnhancer
- Parameters:
specification
- the specification for the componentclassName
- the name of base class to enhance, as extracted
from the specification (or possibly, from a default).- Throws:
ApplicationRuntimeException
- if the class does not exist, is invalid,
or may not be enhanced.
storeCachedClass
protected void storeCachedClass(IComponentSpecification specification,
Class cachedClass)
getCachedClass
protected Class getCachedClass(IComponentSpecification specification)
constructComponentClass
protected Class constructComponentClass(IComponentSpecification specification,
String className)
- Returns the class to be used for the component, which is either
the class with the given name, or an enhanced subclass.
createComponentClassFactory
protected ComponentClassFactory createComponentClassFactory(IComponentSpecification specification,
Class componentClass)
- Constructs a new factory for enhancing the specified class. Advanced users
may want to provide thier own enhancements to classes and this method
is the hook that allows them to provide a subclass of
ComponentClassFactory
adding those
enhancements.
validateEnhancedClass
protected void validateEnhancedClass(Class subject,
String className,
IComponentSpecification specification)
- Invoked to validate that an enhanced class is acceptible. Primarily, this is to ensure
that the class contains no unimplemented abstract methods or fields. Normally,
this kind of checking is done at compile time, but for generated
classes, there is no compile time check (!) and you can get runtime
errors when accessing unimplemented abstract methods.