public class LibrarySpecification extends LocatablePropertyHolder implements ILibrarySpecification
ApplicationSpecification
is 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, setLocation
getProperty, getPropertyNames, removeProperty, setProperty
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getProperty, getPropertyNames, removeProperty, setProperty
public LibrarySpecification()
public java.lang.String getLibrarySpecificationPath(java.lang.String id)
ILibrarySpecification
getLibrarySpecificationPath
in interface ILibrarySpecification
public void setLibrarySpecificationPath(java.lang.String id, java.lang.String path)
setLibrarySpecificationPath
in interface ILibrarySpecification
java.lang.IllegalArgumentException
- if a library with the given id already existspublic java.util.List getLibraryIds()
ILibrarySpecification
getLibraryIds
in interface ILibrarySpecification
public java.lang.String getPageSpecificationPath(java.lang.String name)
getPageSpecificationPath
in interface ILibrarySpecification
public void setPageSpecificationPath(java.lang.String name, java.lang.String path)
setPageSpecificationPath
in interface ILibrarySpecification
public java.util.List getPageNames()
ILibrarySpecification
getPageNames
in interface ILibrarySpecification
public void setComponentSpecificationPath(java.lang.String alias, java.lang.String path)
setComponentSpecificationPath
in interface ILibrarySpecification
public java.lang.String getComponentSpecificationPath(java.lang.String alias)
getComponentSpecificationPath
in interface ILibrarySpecification
public java.util.List getComponentTypes()
ILibrarySpecification
getComponentTypes
in interface ILibrarySpecification
public java.lang.String getServiceClassName(java.lang.String name)
getServiceClassName
in interface ILibrarySpecification
public java.util.List getServiceNames()
ILibrarySpecification
getServiceNames
in interface ILibrarySpecification
public void setServiceClassName(java.lang.String name, java.lang.String className)
setServiceClassName
in interface ILibrarySpecification
public java.lang.String getDescription()
getDescription
in interface ILibrarySpecification
public void setDescription(java.lang.String description)
setDescription
in interface ILibrarySpecification
public java.util.Map getExtensionSpecifications()
IExtensionSpecification
. May return null. The returned Map
is immutable.getExtensionSpecifications
in interface ILibrarySpecification
public void addExtensionSpecification(java.lang.String name, IExtensionSpecification extension)
addExtensionSpecification
in interface ILibrarySpecification
java.lang.IllegalArgumentException
- if an extension with the given name already exists.public java.util.List getExtensionNames()
getExtensionNames
in interface ILibrarySpecification
public IExtensionSpecification getExtensionSpecification(java.lang.String name)
getExtensionSpecification
in interface ILibrarySpecification
public boolean checkExtension(java.lang.String name)
checkExtension
in interface ILibrarySpecification
public java.lang.Object getExtension(java.lang.String name)
getExtension
in interface ILibrarySpecification
java.lang.IllegalArgumentException
- if no extension specification exists for the given name.public java.lang.Object getExtension(java.lang.String name, java.lang.Class typeConstraint)
ILibrarySpecification
getExtension
in interface ILibrarySpecification
protected 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 ILibrarySpecification
protected 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
IEngineService
keyed 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 IContainedComponent
keyed 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 ILibrarySpecification
public void setPublicId(java.lang.String publicId)
setPublicId
in interface ILibrarySpecification
public org.apache.hivemind.Resource getSpecificationLocation()
ILibrarySpecification
getSpecificationLocation
in interface ILibrarySpecification
public void setSpecificationLocation(org.apache.hivemind.Resource specificationLocation)
setSpecificationLocation
in interface ILibrarySpecification
public java.lang.String toString()
toString
in class java.lang.Object
protected void extendDescription(org.apache.hivemind.util.ToStringBuilder builder)
toString()