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,v 1.6 2004/01/19 21:32:16 hlship Exp $
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

public 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

public 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

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


getPageSpecificationPath

public String getPageSpecificationPath(String name)

setPageSpecificationPath

public void setPageSpecificationPath(String name,
                                     String path)

getPageNames

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


setComponentSpecificationPath

public void setComponentSpecificationPath(String type,
                                          String path)

getComponentSpecificationPath

public String getComponentSpecificationPath(String type)

getComponentTypes

public 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

public String getServiceClassName(String name)

getServiceNames

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


setServiceClassName

public void setServiceClassName(String name,
                                String className)

getDescription

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


setDescription

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


getExtensionSpecifications

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


addExtensionSpecification

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


getExtensionNames

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


getExtensionSpecification

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


getExtension

public 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

public 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

public 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

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


getResourceResolver

public IResourceResolver getResourceResolver()

setResourceResolver

public void setResourceResolver(IResourceResolver resolver)

getPublicId

public String getPublicId()

setPublicId

public void setPublicId(String value)

getSpecificationLocation

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

Since:
3.0

setSpecificationLocation

public void setSpecificationLocation(IResourceLocation specificationLocation)
Since:
3.0