public class Namespace extends java.lang.Object implements INamespace
INamespace that works with a
NamespaceResources to obtain page and component
specifications as needed.APPLICATION_NAMESPACE, FRAMEWORK_NAMESPACE, SEPARATOR| Constructor and Description |
|---|
Namespace(java.lang.String id,
INamespace parent,
ILibrarySpecification specification,
NamespaceResources resources) |
| 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 alias)
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.
|
org.apache.hivemind.Location |
getLocation() |
java.lang.String |
getNamespaceId()
Returns a string identifying the namespace, for use in 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.
|
java.lang.String |
getPropertyValue(java.lang.String propertyName)
Returns property values defined in the namespace's library specification.
|
ILibrarySpecification |
getSpecification()
Returns the
LibrarySpecificationfrom 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).
|
java.lang.String |
toString() |
public Namespace(java.lang.String id, INamespace parent, ILibrarySpecification specification, NamespaceResources resources)
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getId()
INamespaceThe application namespace has a null id; the framework namespace has an id of "framework".
getId in interface INamespacepublic java.lang.String getExtendedId()
INamespacegetExtendedId in interface INamespacepublic INamespace getParentNamespace()
INamespaceThe application and framework namespaces return null as the parent.
getParentNamespace in interface INamespacepublic INamespace getChildNamespace(java.lang.String id)
INamespacegetChildNamespace in interface INamespaceid - either a simple name (of a directly contained namespace), or a dot-separated name
sequencepublic java.util.List getChildIds()
INamespacegetChildIds in interface INamespacepublic IComponentSpecification getPageSpecification(java.lang.String name)
INamespacegetPageSpecification in interface INamespacename - the name of the pagepublic java.util.List getPageNames()
INamespacegetPageNames in interface INamespacepublic IComponentSpecification getComponentSpecification(java.lang.String alias)
INamespacegetComponentSpecification in interface INamespacealias - the component typepublic ILibrarySpecification getSpecification()
INamespaceLibrarySpecificationfrom which this namespace
was created.getSpecification in interface INamespacepublic java.lang.String getNamespaceId()
getNamespaceId in interface INamespacepublic boolean containsPage(java.lang.String name)
INamespacecontainsPage in interface INamespacepublic java.lang.String constructQualifiedName(java.lang.String pageName)
INamespaceconstructQualifiedName in interface INamespacepublic org.apache.hivemind.Resource getSpecificationLocation()
INamespacegetSpecificationLocation in interface INamespacepublic boolean isApplicationNamespace()
INamespaceisApplicationNamespace in interface INamespacepublic void installPageSpecification(java.lang.String pageName, IComponentSpecification specification)
INamespaceinstallPageSpecification in interface INamespacepublic void installComponentSpecification(java.lang.String type, IComponentSpecification specification)
INamespaceinstallComponentSpecification in interface INamespacepublic boolean containsComponentType(java.lang.String type)
INamespacecontainsComponentType in interface INamespacetype - a simple component type (no namespace prefix is allowed)public org.apache.hivemind.Location getLocation()
getLocation in interface org.apache.hivemind.Locatablepublic java.lang.String getPropertyValue(java.lang.String propertyName)
getPropertyValue in interface IPropertySource