org.apache.tapestry.resolver
Class ComponentSpecificationResolver
java.lang.Object
|
+--org.apache.tapestry.resolver.AbstractSpecificationResolver
|
+--org.apache.tapestry.resolver.ComponentSpecificationResolver
- All Implemented Interfaces:
- IPoolable
- public class ComponentSpecificationResolver
- extends AbstractSpecificationResolver
Utility class that understands the rules of component types (which
may optionally have a library prefix) and can resolve
the type to a INamespace
and 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:
- As declared in the application specification
- type.jwc in the same folder as the application specification
- type jwc in the WEB-INF/servlet-name directory of the context root
- type.jwc in WEB-INF
- type.jwc in the application root (within the context root)
- By searching the framework namespace
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
- Version:
- $Id: ComponentSpecificationResolver.java,v 1.10 2003/06/21 21:25:22 mindbridge Exp $
- Author:
- Howard Lewis Ship
Method Summary |
protected void |
reset()
Clears the namespace, specification and simpleName properties. |
void |
resolve(IRequestCycle cycle,
INamespace containerNamespace,
String type,
ILocation 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,
String libraryId,
String type,
ILocation location)
Like #resolve(INamespace, String) , but used when the type has already
been parsed into a library id and a simple type. |
Methods inherited from class org.apache.tapestry.resolver.AbstractSpecificationResolver |
discardFromPool, getApplicationRootLocation, getDelegate, getNamespace, getSpecification, getSpecificationSource, getWebInfAppLocation, getWebInfLocation, resetForPool, setNamespace, setSpecification |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ComponentSpecificationResolver
public ComponentSpecificationResolver(IRequestCycle cycle)
reset
protected void reset()
- Description copied from class:
AbstractSpecificationResolver
- Clears the namespace, specification and simpleName properties.
- Overrides:
reset
in class AbstractSpecificationResolver
resolve
public void resolve(IRequestCycle cycle,
INamespace containerNamespace,
String type,
ILocation 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).
- Parameters:
cycle
- current request cyclecontainerNamespace
- namespace that may contain
a library referenced in the typetype
- 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,
String libraryId,
String type,
ILocation location)
- Like
#resolve(INamespace, String)
, but used when the type has already
been parsed into a library id and a simple type.
- Parameters:
cycle
- current request cyclecontainerNamespace
- namespace that may contain
a library referenced in the typelibraryId
- the library id within the container namespace, or nulltype
- the component specification
to find as a simple name (without a library prefix)location
- of reference to be resolved- Throws:
ApplicationRuntimeException
- if the type cannot be resolved