public class LibrarySpecification extends LocatablePropertyHolder implements ILibrarySpecification
ApplicationSpecificationis a
specialized kind of library.| Constructor and Description |
|---|
LibrarySpecification() |
| Modifier and Type | Method and Description |
|---|---|
void |
addExtensionSpecification(java.lang.String name,
IExtensionSpecification extension)
Adds another extension specification.
|
protected void |
applyTypeConstraint(java.lang.String name,
java.lang.Object extension,
java.lang.Class typeConstraint,
org.apache.hivemind.Location location)
Checks that an extension conforms to the supplied type constraint.
|
boolean |
checkExtension(java.lang.String name)
Returns true if this library specification has a specification for the named extension.
|
protected void |
extendDescription(org.apache.hivemind.util.ToStringBuilder builder)
Does nothing, subclasses may override to add additional description.
|
protected java.util.Map |
getComponents()
Returns the components map.
|
java.lang.String |
getComponentSpecificationPath(java.lang.String alias) |
java.util.List |
getComponentTypes()
Returns the simple types of all components defined in this library.
|
java.lang.String |
getDescription()
Returns the documentation for this library..
|
java.lang.Object |
getExtension(java.lang.String name)
Returns an instantiated extension.
|
java.lang.Object |
getExtension(java.lang.String name,
java.lang.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).
|
java.util.List |
getExtensionNames()
Returns a sorted List of the names of all extensions.
|
protected java.util.Map |
getExtensions()
Returns the extensions map.
|
IExtensionSpecification |
getExtensionSpecification(java.lang.String name)
Returns the named IExtensionSpecification, or null if it doesn't exist.
|
java.util.Map |
getExtensionSpecifications()
Returns a Map of extensions; key is extension name, value is
IExtensionSpecification. |
protected java.util.Map |
getLibraries()
Returns the libraries map.
|
java.util.List |
getLibraryIds()
Returns a sorted list of library ids (or the empty list, but not null).
|
java.lang.String |
getLibrarySpecificationPath(java.lang.String id)
Returns the specification path (within the classpath) for an embedded library, or null if no
such library has been defined.
|
java.util.List |
getPageNames()
Returns a sorted list of page names explicitly defined by this library, or an empty list (but
not null).
|
protected java.util.Map |
getPages()
Returns the pages map.
|
java.lang.String |
getPageSpecificationPath(java.lang.String name) |
java.lang.String |
getPublicId()
Returns the XML Public Id for the library file, or null if not applicable.
|
java.lang.String |
getServiceClassName(java.lang.String name) |
java.util.List |
getServiceNames()
Returns a sorted list of service names (or an empty list, but not null).
|
protected java.util.Map |
getServices()
Deprecated.
To be removed in release 4.1.
|
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.
|
protected void |
setComponents(java.util.Map components)
Updates the components map.
|
void |
setComponentSpecificationPath(java.lang.String alias,
java.lang.String path) |
void |
setDescription(java.lang.String description)
Sets the documentation for this library.
|
protected void |
setExtensions(java.util.Map extension)
Updates the extension map.
|
protected void |
setLibraries(java.util.Map libraries)
Updates the library map.
|
void |
setLibrarySpecificationPath(java.lang.String id,
java.lang.String path)
Sets the specification path for an embedded library.
|
protected void |
setPages(java.util.Map pages)
Updates the page map.
|
void |
setPageSpecificationPath(java.lang.String name,
java.lang.String path) |
void |
setPublicId(java.lang.String publicId) |
void |
setServiceClassName(java.lang.String name,
java.lang.String className) |
protected void |
setServices(java.util.Map services)
Deprecated.
To be removed in release 4.1.
|
void |
setSpecificationLocation(org.apache.hivemind.Resource specificationLocation) |
java.lang.String |
toString() |
getLocation, setLocationgetProperty, getPropertyNames, removeProperty, setPropertyclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetProperty, getPropertyNames, removeProperty, setPropertypublic LibrarySpecification()
public java.lang.String getLibrarySpecificationPath(java.lang.String id)
ILibrarySpecificationgetLibrarySpecificationPath in interface ILibrarySpecificationpublic void setLibrarySpecificationPath(java.lang.String id, java.lang.String path)
setLibrarySpecificationPath in interface ILibrarySpecificationjava.lang.IllegalArgumentException - if a library with the given id already existspublic java.util.List getLibraryIds()
ILibrarySpecificationgetLibraryIds in interface ILibrarySpecificationpublic java.lang.String getPageSpecificationPath(java.lang.String name)
getPageSpecificationPath in interface ILibrarySpecificationpublic void setPageSpecificationPath(java.lang.String name, java.lang.String path)
setPageSpecificationPath in interface ILibrarySpecificationpublic java.util.List getPageNames()
ILibrarySpecificationgetPageNames in interface ILibrarySpecificationpublic void setComponentSpecificationPath(java.lang.String alias, java.lang.String path)
setComponentSpecificationPath in interface ILibrarySpecificationpublic java.lang.String getComponentSpecificationPath(java.lang.String alias)
getComponentSpecificationPath in interface ILibrarySpecificationpublic java.util.List getComponentTypes()
ILibrarySpecificationgetComponentTypes in interface ILibrarySpecificationpublic java.lang.String getServiceClassName(java.lang.String name)
getServiceClassName in interface ILibrarySpecificationpublic java.util.List getServiceNames()
ILibrarySpecificationgetServiceNames in interface ILibrarySpecificationpublic void setServiceClassName(java.lang.String name, java.lang.String className)
setServiceClassName in interface ILibrarySpecificationpublic java.lang.String getDescription()
getDescription in interface ILibrarySpecificationpublic void setDescription(java.lang.String description)
setDescription in interface ILibrarySpecificationpublic java.util.Map getExtensionSpecifications()
IExtensionSpecification. May return null. The returned Map
is immutable.getExtensionSpecifications in interface ILibrarySpecificationpublic void addExtensionSpecification(java.lang.String name, IExtensionSpecification extension)
addExtensionSpecification in interface ILibrarySpecificationjava.lang.IllegalArgumentException - if an extension with the given name already exists.public java.util.List getExtensionNames()
getExtensionNames in interface ILibrarySpecificationpublic IExtensionSpecification getExtensionSpecification(java.lang.String name)
getExtensionSpecification in interface ILibrarySpecificationpublic boolean checkExtension(java.lang.String name)
checkExtension in interface ILibrarySpecificationpublic java.lang.Object getExtension(java.lang.String name)
getExtension in interface ILibrarySpecificationjava.lang.IllegalArgumentException - if no extension specification exists for the given name.public java.lang.Object getExtension(java.lang.String name, java.lang.Class typeConstraint)
ILibrarySpecificationgetExtension in interface ILibrarySpecificationprotected void applyTypeConstraint(java.lang.String name, java.lang.Object extension, java.lang.Class typeConstraint, org.apache.hivemind.Location location)
java.lang.IllegalArgumentException - if the extension fails the check.public void instantiateImmediateExtensions()
instantiateImmediateExtensions in interface ILibrarySpecificationprotected java.util.Map getExtensions()
protected void setExtensions(java.util.Map extension)
extension - A Map of extension specification paths keyed on extension id.
The map is retained, not copied.
protected java.util.Map getLibraries()
LibrarySpecification.protected void setLibraries(java.util.Map libraries)
libraries - A Map of library specification paths keyed on library id.
The map is retained, not copied.
protected java.util.Map getPages()
IComponentSpecification.protected void setPages(java.util.Map pages)
pages - A Map of page specification paths keyed on page id.
The map is retained, not copied.
protected java.util.Map getServices()
protected void setServices(java.util.Map services)
services - A Map of the fully qualified names of classes which implement
IEngineServicekeyed on service id.
The map is retained, not copied.
protected java.util.Map getComponents()
IContainedComponent.protected void setComponents(java.util.Map components)
components - A Map of IContainedComponentkeyed on component id. The map is retained,
not copied.public java.lang.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(java.lang.String publicId)
setPublicId in interface ILibrarySpecificationpublic org.apache.hivemind.Resource getSpecificationLocation()
ILibrarySpecificationgetSpecificationLocation in interface ILibrarySpecificationpublic void setSpecificationLocation(org.apache.hivemind.Resource specificationLocation)
setSpecificationLocation in interface ILibrarySpecificationpublic java.lang.String toString()
toString in class java.lang.Objectprotected void extendDescription(org.apache.hivemind.util.ToStringBuilder builder)
toString()