org.apache.tapestry.resolver
Class ComponentSpecificationResolverImpl

java.lang.Object
  extended byorg.apache.tapestry.resolver.AbstractSpecificationResolver
      extended byorg.apache.tapestry.resolver.ComponentSpecificationResolverImpl
All Implemented Interfaces:
ComponentSpecificationResolver

public class ComponentSpecificationResolverImpl
extends AbstractSpecificationResolver
implements ComponentSpecificationResolver

Utility class that understands the rules of component types (which may optionally have a library prefix) and can resolve the type to a INamespaceand a IComponentSpecification.

Like PageSpecificationResolver, if the component is not defined explicitly in the namespace, a search may occur: Performs the tricky work of resolving a page name to a page specification. The search for pages in the application namespace is the most complicated, since Tapestry searches for pages that aren't explicitly defined in the application specification. The search, based on the simple-name of the page, goes as follows:

The search for components in library namespaces is more abbreviated:
  • As declared in the library specification
  • type .jwc in the same folder as the library specification
  • By searching the framework namespace

    Since:
    3.0
    Author:
    Howard Lewis Ship

    Constructor Summary
    ComponentSpecificationResolverImpl()
               
     
    Method Summary
     java.lang.String getType()
              Returns the unqualified type of the component (i.e., with any namespace prefix stripped off).
    protected  void reset()
              Clears the namespace and specification properties.
     void resolve(IRequestCycle cycle, INamespace containerNamespace, java.lang.String type, org.apache.hivemind.Location location)
              Passed the namespace of a container (to resolve the type in) and the type to resolve, performs the processing.
     void resolve(IRequestCycle cycle, INamespace containerNamespace, java.lang.String libraryId, java.lang.String type, org.apache.hivemind.Location location)
              Like #resolve(org.apache.tapestry.IRequestCycle, org.apache.tapestry.INamespace, java.lang.String, org.apache.tapestry.ILocation), but used when the type has already been parsed into a library id and a simple type.
     void setClassFinder(ClassFinder classFinder)
               
     void setLog(org.apache.commons.logging.Log log)
               
     
    Methods inherited from class org.apache.tapestry.resolver.AbstractSpecificationResolver
    findNamespaceForId, getApplicationNamespace, getContextRoot, getDelegate, getFrameworkNamespace, getNamespace, getSpecification, getSpecificationSource, getWebInfAppLocation, getWebInfLocation, initializeService, setApplicationId, setContextRoot, setDelegate, setNamespace, setSpecification, setSpecificationSource
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     
    Methods inherited from interface org.apache.tapestry.resolver.ComponentSpecificationResolver
    getNamespace, getSpecification
     

    Constructor Detail

    ComponentSpecificationResolverImpl

    public ComponentSpecificationResolverImpl()
    Method Detail

    reset

    protected void reset()
    Description copied from class: AbstractSpecificationResolver
    Clears the namespace and specification properties.

    Overrides:
    reset in class AbstractSpecificationResolver

    resolve

    public void resolve(IRequestCycle cycle,
                        INamespace containerNamespace,
                        java.lang.String type,
                        org.apache.hivemind.Location location)
    Passed the namespace of a container (to resolve the type in) and the type to resolve, performs the processing. A "bare type" (without a library prefix) may be in the containerNamespace, or the framework namespace (a search occurs in that order).

    Specified by:
    resolve in interface ComponentSpecificationResolver
    Parameters:
    cycle - current request cycle
    containerNamespace - namespace that may contain a library referenced in the type
    type - the component specification to find, either a simple name, or prefixed with a library id (defined for the container namespace)
    See Also:
    AbstractSpecificationResolver.getNamespace(), AbstractSpecificationResolver.getSpecification()

    resolve

    public void resolve(IRequestCycle cycle,
                        INamespace containerNamespace,
                        java.lang.String libraryId,
                        java.lang.String type,
                        org.apache.hivemind.Location location)
    Like #resolve(org.apache.tapestry.IRequestCycle, org.apache.tapestry.INamespace, java.lang.String, org.apache.tapestry.ILocation), but used when the type has already been parsed into a library id and a simple type.

    Specified by:
    resolve in interface ComponentSpecificationResolver
    Parameters:
    cycle - current request cycle
    containerNamespace - namespace that may contain a library referenced in the type
    libraryId - the library id within the container namespace, or null
    type - the component specification to find as a simple name (without a library prefix)
    location - of reference to be resolved
    Throws:
    org.apache.hivemind.ApplicationRuntimeException - if the type cannot be resolved

    getType

    public java.lang.String getType()
    Description copied from interface: ComponentSpecificationResolver
    Returns the unqualified type of the component (i.e., with any namespace prefix stripped off).

    Specified by:
    getType in interface ComponentSpecificationResolver

    setLog

    public void setLog(org.apache.commons.logging.Log log)

    setClassFinder

    public void setClassFinder(ClassFinder classFinder)