|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.tapestry.util.BasePropertyHolder
org.apache.tapestry.spec.LocatablePropertyHolder
org.apache.tapestry.spec.LibrarySpecification
public class LibrarySpecification
Specification for a library. ApplicationSpecification
is a specialized kind of library.
| Constructor Summary | |
|---|---|
LibrarySpecification()
|
|
| Method Summary | |
|---|---|
void |
addExtensionSpecification(String name,
IExtensionSpecification extension)
Adds another extension specification. |
protected void |
applyTypeConstraint(String name,
Object extension,
Class typeConstraint,
ILocation location)
Checks that an extension conforms to the supplied type constraint. |
boolean |
checkExtension(String name)
Returns true if this library specification has a specification for the named extension. |
protected void |
extendDescription(org.apache.commons.lang.builder.ToStringBuilder builder)
Does nothing, subclasses may override to add additional description. |
protected Map |
getComponents()
Returns the components map. |
String |
getComponentSpecificationPath(String alias)
|
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. |
protected Map |
getExtensions()
Returns the extensions map. |
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. |
protected Map |
getLibraries()
Returns the libraries map. |
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). |
protected Map |
getPages()
Returns the pages map. |
String |
getPageSpecificationPath(String name)
|
String |
getPublicId()
Returns the XML Public Id for the library file, or null if not applicable. |
IResourceResolver |
getResourceResolver()
|
String |
getServiceClassName(String name)
|
List |
getServiceNames()
Returns a sorted list of service names (or an empty list, but not null). |
protected Map |
getServices()
Returns the services. |
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. |
protected void |
setComponents(Map components)
Updates the components map. |
void |
setComponentSpecificationPath(String alias,
String path)
|
void |
setDescription(String description)
Sets the documentation for this library. |
protected void |
setExtensions(Map extension)
Updates the extension map. |
protected void |
setLibraries(Map libraries)
Updates the library map. |
void |
setLibrarySpecificationPath(String id,
String path)
Sets the specification path for an embedded library. |
protected void |
setPages(Map pages)
Updates the page map. |
void |
setPageSpecificationPath(String name,
String path)
|
void |
setPublicId(String publicId)
|
void |
setResourceResolver(IResourceResolver resolver)
|
void |
setServiceClassName(String name,
String className)
|
protected void |
setServices(Map services)
Updates the services map. |
void |
setSpecificationLocation(IResourceLocation specificationLocation)
|
String |
toString()
|
| Methods inherited from class org.apache.tapestry.spec.LocatablePropertyHolder |
|---|
getLocation, setLocation |
| Methods inherited from class org.apache.tapestry.util.BasePropertyHolder |
|---|
getProperty, getPropertyNames, removeProperty, setProperty |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| 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 |
| Constructor Detail |
|---|
public LibrarySpecification()
| Method Detail |
|---|
public String getLibrarySpecificationPath(String id)
ILibrarySpecification
getLibrarySpecificationPath in interface ILibrarySpecification
public void setLibrarySpecificationPath(String id,
String path)
setLibrarySpecificationPath in interface ILibrarySpecificationIllegalArgumentException - if a library with the given
id already existspublic List getLibraryIds()
ILibrarySpecification
getLibraryIds in interface ILibrarySpecificationpublic String getPageSpecificationPath(String name)
getPageSpecificationPath in interface ILibrarySpecification
public void setPageSpecificationPath(String name,
String path)
setPageSpecificationPath in interface ILibrarySpecificationpublic List getPageNames()
ILibrarySpecification
getPageNames in interface ILibrarySpecification
public void setComponentSpecificationPath(String alias,
String path)
setComponentSpecificationPath in interface ILibrarySpecificationpublic String getComponentSpecificationPath(String alias)
getComponentSpecificationPath in interface ILibrarySpecificationpublic List getComponentTypes()
ILibrarySpecification
getComponentTypes in interface ILibrarySpecificationpublic String getServiceClassName(String name)
getServiceClassName in interface ILibrarySpecificationpublic List getServiceNames()
ILibrarySpecification
getServiceNames in interface ILibrarySpecification
public void setServiceClassName(String name,
String className)
setServiceClassName in interface ILibrarySpecificationpublic String getDescription()
getDescription in interface ILibrarySpecificationpublic void setDescription(String description)
setDescription in interface ILibrarySpecificationpublic Map getExtensionSpecifications()
IExtensionSpecification.
May return null. The returned Map is immutable.
getExtensionSpecifications in interface ILibrarySpecification
public void addExtensionSpecification(String name,
IExtensionSpecification extension)
addExtensionSpecification in interface ILibrarySpecificationIllegalArgumentException - if an extension with the given name already exists.public List getExtensionNames()
getExtensionNames in interface ILibrarySpecificationpublic IExtensionSpecification getExtensionSpecification(String name)
getExtensionSpecification in interface ILibrarySpecificationpublic boolean checkExtension(String name)
checkExtension in interface ILibrarySpecificationpublic Object getExtension(String name)
getExtension in interface ILibrarySpecificationIllegalArgumentException - if no extension specification exists for the
given name.
public Object getExtension(String name,
Class typeConstraint)
ILibrarySpecification
getExtension in interface ILibrarySpecification
protected void applyTypeConstraint(String name,
Object extension,
Class typeConstraint,
ILocation location)
IllegalArgumentException - if the extension fails the check.public void instantiateImmediateExtensions()
instantiateImmediateExtensions in interface ILibrarySpecificationpublic IResourceResolver getResourceResolver()
getResourceResolver in interface ILibrarySpecificationpublic void setResourceResolver(IResourceResolver resolver)
setResourceResolver in interface ILibrarySpecificationprotected Map getExtensions()
protected void setExtensions(Map extension)
extension - A Map of extension specification paths
keyed on extension id.
The map is retained, not copied.
protected Map getLibraries()
LibrarySpecification.protected void setLibraries(Map libraries)
libraries - A Map of library specification paths
keyed on library id.
The map is retained, not copied.
protected Map getPages()
IComponentSpecification.protected void setPages(Map pages)
pages - A Map of page specification paths
keyed on page id.
The map is retained, not copied.
protected Map getServices()
protected void setServices(Map services)
services - A Map of the fully qualified names of classes
which implement
IEngineService
keyed on service id.
The map is retained, not copied.
protected Map getComponents()
IContainedComponent.protected void setComponents(Map components)
components - A Map of IContainedComponent keyed on component id.
The map is retained, not copied.public String getPublicId()
This method exists as a convienience for the Spindle plugin. A previous method used an arbitrary version string, the public id is more useful and less ambiguous.
getPublicId in interface ILibrarySpecificationpublic void setPublicId(String publicId)
setPublicId in interface ILibrarySpecificationpublic IResourceLocation getSpecificationLocation()
ILibrarySpecification
getSpecificationLocation in interface ILibrarySpecificationpublic void setSpecificationLocation(IResourceLocation specificationLocation)
setSpecificationLocation in interface ILibrarySpecificationpublic String toString()
toString in class Objectprotected void extendDescription(org.apache.commons.lang.builder.ToStringBuilder builder)
toString()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||