public interface INamespace extends org.apache.hivemind.Locatable, IPropertySource
Tapestry release 3.0 includes dynamic discovery of pages and components; an application or library may contain a page or component that won't be "known" until the name is resolved (because it involves searching for a particular named file).
A namespace implements IPropertySource
, exposing the
properties provided in the namespace's specification.
PageSpecificationResolver
,
ComponentSpecificationResolver
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
APPLICATION_NAMESPACE
Reserved name for the implicit (root) application namespace.
|
static java.lang.String |
FRAMEWORK_NAMESPACE
Reserved name of a the implicit Framework library.
|
static char |
SEPARATOR
Character used to seperate the namespace prefix from the page name or component type.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
constructQualifiedName(java.lang.String pageName)
Constructs a qualified name for the given simple page name by applying the correct prefix (if
any).
|
boolean |
containsComponentType(java.lang.String type)
Returns true if the namespace contains the indicated component type.
|
boolean |
containsPage(java.lang.String name)
Returns true if this namespace contains the specified page name.
|
java.util.List |
getChildIds()
Returns a sorted, immutable list of the ids of the immediate children of this namespace.
|
INamespace |
getChildNamespace(java.lang.String id)
Returns a namespace contained by this namespace.
|
IComponentSpecification |
getComponentSpecification(java.lang.String type)
Returns the path for the named component (within the namespace).
|
java.lang.String |
getExtendedId()
Returns the extended id for this namespace, which is a dot-seperated sequence of ids.
|
java.lang.String |
getId()
Returns an identifier for the namespace.
|
java.lang.String |
getNamespaceId()
Returns a version of the extended id appropriate for error messages.
|
java.util.List |
getPageNames()
Returns a sorted list of page names.
|
IComponentSpecification |
getPageSpecification(java.lang.String name)
Returns the page specification of the named page (defined within the namespace).
|
INamespace |
getParentNamespace()
Returns the parent namespace; the namespace which contains this namespace.
|
ILibrarySpecification |
getSpecification()
Returns the
LibrarySpecification from which this namespace
was created. |
org.apache.hivemind.Resource |
getSpecificationLocation()
Returns the location of the resource from which the specification for this namespace was
read.
|
void |
installComponentSpecification(java.lang.String type,
IComponentSpecification specification)
Used to specify additional components beyond those that came from the namespace's
specification.
|
void |
installPageSpecification(java.lang.String pageName,
IComponentSpecification specification)
Used to specify additional pages beyond those that came from the namespace's specification.
|
boolean |
isApplicationNamespace()
Returns true if the namespace is the special application namespace (which has special search
rules for handling undeclared pages and components).
|
getPropertyValue
static final java.lang.String FRAMEWORK_NAMESPACE
static final java.lang.String APPLICATION_NAMESPACE
static final char SEPARATOR
java.lang.String getId()
The application namespace has a null id; the framework namespace has an id of "framework".
java.lang.String getExtendedId()
java.lang.String getNamespaceId()
getExtendedId()
, unless this is the application or framework namespace, in which
case special strings are returned.INamespace getParentNamespace()
The application and framework namespaces return null as the parent.
INamespace getChildNamespace(java.lang.String id)
id
- either a simple name (of a directly contained namespace), or a dot-separated name
sequenceApplicationRuntimeException
- if no such namespace exist.java.util.List getChildIds()
IComponentSpecification getPageSpecification(java.lang.String name)
name
- the name of the pageApplicationRuntimeException
- if the page specification doesn't exist or can't be loadedboolean containsPage(java.lang.String name)
java.util.List getPageNames()
IComponentSpecification getComponentSpecification(java.lang.String type)
type
- the component typeApplicationRuntimeException
- if the specification doesn't exist or can't be loadedboolean containsComponentType(java.lang.String type)
type
- a simple component type (no namespace prefix is allowed)ILibrarySpecification getSpecification()
LibrarySpecification
from which this namespace
was created.java.lang.String constructQualifiedName(java.lang.String pageName)
org.apache.hivemind.Resource getSpecificationLocation()
boolean isApplicationNamespace()
void installPageSpecification(java.lang.String pageName, IComponentSpecification specification)
void installComponentSpecification(java.lang.String type, IComponentSpecification specification)