public abstract class Module extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Map<URI,Supplier<Component>> |
components |
| Modifier | Constructor and Description |
|---|---|
protected |
Module(String name,
String version,
String title)
Instantiate a new module
|
protected |
Module(String name,
String version,
String title,
ResourceLoader loader) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
addComponent(Component component) |
protected boolean |
addComponent(URI uri,
String path)
This method can be overridden to exclude certain components that have unmet dependencies.
|
protected boolean |
addEntity(Entity entity) |
protected boolean |
addEntity(String publicId,
String path) |
protected boolean |
addXSLTPackage(String name,
String version,
String path) |
protected boolean |
addXSLTPackage(String path,
XMLInputFactory parser) |
protected boolean |
addXSLTPackage(XSLTPackage pack) |
boolean |
equals(Object o) |
Component |
getComponent(URI uri)
Gets the component identified by the given URI.
|
Set<URI> |
getComponents()
Gets all the component URIs.
|
Set<String> |
getEntities()
Gets the list of entity IDs.
|
Entity |
getEntity(String publicId)
Gets the entity identified by the given ID.
|
protected org.slf4j.Logger |
getLogger() |
String |
getName()
Gets the name.
|
URL |
getResource(String path)
Get the specified resource from the module.
|
String |
getTitle()
Gets the title.
|
String |
getVersion()
Gets the version.
|
XSLTPackage |
getXSLTPackage(String name)
Gets the XSLT package identified by the given name.
|
Iterable<XSLTPackage> |
getXSLTPackages()
Gets the list of XSLT packages.
|
boolean |
hasComponent(URI uri)
Whether this module provides a component with the given URI.
|
boolean |
hasEntity(String publicId)
Whether this module provides a entity with the given ID.
|
int |
hashCode() |
static void |
parseCatalog(Module module,
XmlCatalog catalog) |
static void |
parseCatalog(Module module,
XmlCatalogParser parser)
Parse catalog.xml file
|
abstract void |
resolveDependencies()
Called by
ModuleRegistry to resolve dependencies of components. |
String |
toString() |
protected Module(String name, String version, String title, ResourceLoader loader)
protected org.slf4j.Logger getLogger()
public abstract void resolveDependencies()
ModuleRegistry to resolve dependencies of components. If a dependency of a
component can not be resolved, this does not result in an exception, but the component will
not be created (and consequently will not be available through the #getComponent() or
getEntity(java.lang.String) method).public static void parseCatalog(Module module, XmlCatalogParser parser)
public static void parseCatalog(Module module, XmlCatalog catalog) throws NoSuchFileException
NoSuchFileExceptionprotected boolean addComponent(URI uri, String path) throws NoSuchFileException
NoSuchFileExceptionprotected boolean addComponent(Component component)
protected boolean addEntity(String publicId, String path) throws NoSuchFileException
NoSuchFileExceptionprotected boolean addEntity(Entity entity)
protected boolean addXSLTPackage(String path, XMLInputFactory parser) throws NoSuchFileException, IllegalArgumentException
protected boolean addXSLTPackage(String name, String version, String path) throws NoSuchFileException
NoSuchFileExceptionprotected boolean addXSLTPackage(XSLTPackage pack)
public String getName()
public String getVersion()
public String getTitle()
public URL getResource(String path) throws NoSuchFileException
path - The (not URL-encoded) path, relative to catalog.xml, of a resource inside the JAR
or class directory of the module.NoSuchFileException - if the resource at path is not availablepublic boolean hasComponent(URI uri)
ResolutionException when the getComponent(java.net.URI) method is called.public Component getComponent(URI uri) throws NoSuchElementException, ResolutionException
NoSuchElementException - if this module provides a component with the given URI.ResolutionException - if the component could not be resolved, e.g. due to a missing dependency.public boolean hasEntity(String publicId)
ResolutionException when the getEntity(java.lang.String) method is called.public Entity getEntity(String publicId) throws NoSuchElementException, ResolutionException
NoSuchElementException - if this module provides an entity with the given ID.ResolutionException - if the entity could not be resolved, e.g. due to a missing dependency.public Iterable<XSLTPackage> getXSLTPackages()
public XSLTPackage getXSLTPackage(String name)
Copyright © 2010–2025 The DAISY Consortium. All rights reserved.