org.apache.tapestry.spec
Interface ILibrarySpecification

All Superinterfaces:
ILocatable, ILocationHolder, IPropertyHolder
All Known Subinterfaces:
IApplicationSpecification
All Known Implementing Classes:
ApplicationSpecification, LibrarySpecification

public interface ILibrarySpecification
extends IPropertyHolder, ILocationHolder

Interface for the Specification for a library. ApplicationSpecification is a specialized kind of library.

Since:
2.2
Version:
$Id: ILibrarySpecification.java 243791 2004-02-19 17:38:13Z hlship $
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()
           
 IResourceResolver getResourceResolver()
           
 String getServiceClassName(String name)
           
 List getServiceNames()
          Returns a sorted list of service names (or an empty list, but not null).
 IResourceLocation 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 setResourceResolver(IResourceResolver resolver)
           
 void setServiceClassName(String name, String className)
           
 void setSpecificationLocation(IResourceLocation specificationLocation)
           
 
Methods inherited from interface org.apache.tapestry.util.IPropertyHolder
getProperty, getPropertyNames, removeProperty, setProperty
 
Methods inherited from interface org.apache.tapestry.ILocationHolder
setLocation
 
Methods inherited from interface org.apache.tapestry.ILocatable
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

getServiceClassName

String getServiceClassName(String name)

getServiceNames

List getServiceNames()
Returns a sorted list of service names (or an empty list, but not null).


setServiceClassName

void setServiceClassName(String name,
                         String className)

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.


getResourceResolver

IResourceResolver getResourceResolver()

setResourceResolver

void setResourceResolver(IResourceResolver resolver)

getPublicId

String getPublicId()

setPublicId

void setPublicId(String value)

getSpecificationLocation

IResourceLocation getSpecificationLocation()
Returns the location from which the specification was read.

Since:
3.0

setSpecificationLocation

void setSpecificationLocation(IResourceLocation specificationLocation)
Since:
3.0