org.apache.tapestry.spec
Interface ILibrarySpecification

All Superinterfaces:
IPropertyHolder, org.apache.hivemind.Locatable, org.apache.hivemind.LocationHolder
All Known Subinterfaces:
IApplicationSpecification
All Known Implementing Classes:
ApplicationSpecification, LibrarySpecification

public interface ILibrarySpecification
extends IPropertyHolder, org.apache.hivemind.LocationHolder

Interface for the Specification for a library. ApplicationSpecificationis a specialized kind of library.

Since:
2.2
Author:
Geoffrey Longman

Method Summary
 void addExtensionSpecification(String name, IExtensionSpecification extension)
          Adds another extension specification.
 boolean checkExtension(String name)
          Returns true if the named extension exists (or can be instantiated), returns false if the named extension has no specification.
 String getComponentSpecificationPath(String type)
           
 List getComponentTypes()
          Returns the simple types of all components defined in this library.
 String getDescription()
          Returns the documentation for this library..
 Object getExtension(String name)
          Returns an instantiated extension.
 Object getExtension(String name, Class typeConstraint)
          Returns an instantiated extension, performing a check to ensure that the extension is a subtype of the given class (or extends the given interface).
 List getExtensionNames()
          Returns a sorted List of the names of all extensions.
 IExtensionSpecification getExtensionSpecification(String name)
          Returns the named IExtensionSpecification, or null if it doesn't exist.
 Map getExtensionSpecifications()
          Returns a Map of extensions; key is extension name, value is IExtensionSpecification.
 List getLibraryIds()
          Returns a sorted list of library ids (or the empty list, but not null).
 String getLibrarySpecificationPath(String id)
          Returns the specification path (within the classpath) for an embedded library, or null if no such library has been defined.
 List getPageNames()
          Returns a sorted list of page names explicitly defined by this library, or an empty list (but not null).
 String getPageSpecificationPath(String name)
           
 String getPublicId()
           
 org.apache.hivemind.Resource getSpecificationLocation()
          Returns the location from which the specification was read.
 void instantiateImmediateExtensions()
          Invoked after the entire specification has been constructed to instantiate any extensions marked immediate.
 void setComponentSpecificationPath(String type, String path)
           
 void setDescription(String description)
          Sets the documentation for this library.
 void setLibrarySpecificationPath(String id, String path)
          Sets the specification path for an embedded library.
 void setPageSpecificationPath(String name, String path)
           
 void setPublicId(String value)
           
 void setSpecificationLocation(org.apache.hivemind.Resource specificationLocation)
           
 
Methods inherited from interface org.apache.tapestry.util.IPropertyHolder
getProperty, getPropertyNames, removeProperty, setProperty
 
Methods inherited from interface org.apache.hivemind.LocationHolder
setLocation
 
Methods inherited from interface org.apache.hivemind.Locatable
getLocation
 

Method Detail

getLibrarySpecificationPath

String getLibrarySpecificationPath(String id)
Returns the specification path (within the classpath) for an embedded library, or null if no such library has been defined.


setLibrarySpecificationPath

void setLibrarySpecificationPath(String id,
                                 String path)
Sets the specification path for an embedded library.

Throws:
IllegalArgumentException - if a library with the given id already exists

getLibraryIds

List getLibraryIds()
Returns a sorted list of library ids (or the empty list, but not null).


getPageSpecificationPath

String getPageSpecificationPath(String name)

setPageSpecificationPath

void setPageSpecificationPath(String name,
                              String path)

getPageNames

List getPageNames()
Returns a sorted list of page names explicitly defined by this library, or an empty list (but not null).


setComponentSpecificationPath

void setComponentSpecificationPath(String type,
                                   String path)

getComponentSpecificationPath

String getComponentSpecificationPath(String type)

getComponentTypes

List getComponentTypes()
Returns the simple types of all components defined in this library. Returns a list of strings in sorted order, or an empty list (but not null).

Since:
3.0

getDescription

String getDescription()
Returns the documentation for this library..


setDescription

void setDescription(String description)
Sets the documentation for this library.


getExtensionSpecifications

Map getExtensionSpecifications()
Returns a Map of extensions; key is extension name, value is IExtensionSpecification. May return null. The returned Map is immutable.


addExtensionSpecification

void addExtensionSpecification(String name,
                               IExtensionSpecification extension)
Adds another extension specification.


getExtensionNames

List getExtensionNames()
Returns a sorted List of the names of all extensions. May return the empty list, but won't return null.


getExtensionSpecification

IExtensionSpecification getExtensionSpecification(String name)
Returns the named IExtensionSpecification, or null if it doesn't exist.


getExtension

Object getExtension(String name)
Returns an instantiated extension. Extensions are created as needed and cached for later use.

Throws:
IllegalArgumentException - if no extension specification exists for the given name.

getExtension

Object getExtension(String name,
                    Class typeConstraint)
Returns an instantiated extension, performing a check to ensure that the extension is a subtype of the given class (or extends the given interface).

Throws:
IllegalArgumentException - if no extension specification exists for the given name, or if the extension fails the type check.
Since:
3.0

checkExtension

boolean checkExtension(String name)
Returns true if the named extension exists (or can be instantiated), returns false if the named extension has no specification.


instantiateImmediateExtensions

void instantiateImmediateExtensions()
Invoked after the entire specification has been constructed to instantiate any extensions marked immediate.


getPublicId

String getPublicId()

setPublicId

void setPublicId(String value)

getSpecificationLocation

org.apache.hivemind.Resource getSpecificationLocation()
Returns the location from which the specification was read.

Since:
3.0

setSpecificationLocation

void setSpecificationLocation(org.apache.hivemind.Resource specificationLocation)
Since:
3.0 *


Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.