public final class ModuleImpl extends BaseLocatable implements Module
Module.| Constructor and Description |
|---|
ModuleImpl() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsService(java.lang.Class serviceInterface)
Returns true if a single service exists which implements the specified service interface and
is visible to this module.
|
java.lang.String |
expandSymbols(java.lang.String input,
Location location) |
ClassResolver |
getClassResolver()
Returns the resource resolver for this module.
|
java.util.List |
getConfiguration(java.lang.String extensionPointId)
Returns the
List of elements for the specified configuration point. |
java.util.Map |
getConfigurationAsMap(java.lang.String configurationId)
Returns the elements of the given configuration point as an unmodifiable
Map. |
ErrorHandler |
getErrorHandler()
Returns the
ErrorHandler for this Registry. |
java.util.Locale |
getLocale() |
Messages |
getMessages()
Returns an object that can provide and format localized messages for this module.
|
java.lang.String |
getModuleId()
Returns the unique identifier for this module.
|
java.lang.Object |
getService(java.lang.Class serviceInterface)
Finds a service that implements the provided interface.
|
java.lang.Object |
getService(java.lang.String serviceId,
java.lang.Class serviceInterface)
Looks up the
ServicePoint (throwing an exception if not found) and invokes
ServicePoint.getService(Class). |
ServiceModelFactory |
getServiceModelFactory(java.lang.String name) |
ServicePoint |
getServicePoint(java.lang.String serviceId)
Returns the identified service extension point.
|
Translator |
getTranslator(java.lang.String translator) |
boolean |
isConfigurationMappable(java.lang.String configurationId)
Returns true if the elements contributed to the given configuration point can be
retrieved as a Map. |
java.lang.Class |
resolveType(java.lang.String type)
Returns the class matching the type.
|
void |
setClassResolver(ClassResolver resolver) |
void |
setModuleId(java.lang.String string) |
void |
setPackageName(java.lang.String packageName) |
void |
setRegistry(RegistryInfrastructure registry) |
java.lang.String |
toString() |
java.lang.String |
valueForSymbol(java.lang.String symbol)
Returns the value for the symbol, if this source can provide one.
|
getLocation, setLocationclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetLocationpublic ModuleImpl()
public java.util.List getConfiguration(java.lang.String extensionPointId)
ModuleList of elements for the specified configuration point. The
returned List is unmodifiable. It may be empty, but won't be null.
It is expressly the caller's job to sort the elements into an appropriate order (a copy will have to be made since the returned List is unmodifiable).
getConfiguration in interface ModuleextensionPointId - an unqualified id for a configuration within this module, or a fully qualified id
for a configuration in this or any other modulepublic boolean isConfigurationMappable(java.lang.String configurationId)
Moduleretrieved as a Map.isConfigurationMappable in interface ModuleConfigurationPoint.areElementsMappable()public java.util.Map getConfigurationAsMap(java.lang.String configurationId)
ModuleMap. It may
be empty, but not null.getConfigurationAsMap in interface ModuleconfigurationId - an unqualified id for a configuration within this module, or a fully qualified id
for a configuration in this or any other module.ConfigurationPoint.getElementsAsMap(),
Module.isConfigurationMappable(String)public java.lang.String getModuleId()
ModulegetModuleId in interface Modulepublic void setPackageName(java.lang.String packageName)
public boolean containsService(java.lang.Class serviceInterface)
ModulecontainsService in interface Modulepublic java.lang.Object getService(java.lang.String serviceId, java.lang.Class serviceInterface)
ModuleServicePoint (throwing an exception if not found) and invokes
ServicePoint.getService(Class).getService in interface ModuleserviceId - an unqualified id for a service within this module, or a fully qualified id for a
service in this or any other moduleserviceInterface - type the result will be cast topublic java.lang.Object getService(java.lang.Class serviceInterface)
ModulegetService in interface ModuleserviceInterface - used to locate the servicepublic void setModuleId(java.lang.String string)
public void setRegistry(RegistryInfrastructure registry)
public void setClassResolver(ClassResolver resolver)
public ClassResolver getClassResolver()
ModulegetClassResolver in interface Modulepublic Messages getMessages()
Modulehivemodule.properties (localized) stored
with the HiveMind deployment descriptor in the META-INF folder.getMessages in interface Modulepublic java.lang.String expandSymbols(java.lang.String input, Location location)
expandSymbols in interface ModuleRegistryInfrastructure.expandSymbols(String, Location)public java.lang.String toString()
toString in class java.lang.Objectpublic ServicePoint getServicePoint(java.lang.String serviceId)
ModulegetServicePoint in interface ModuleserviceId - an unqualified id for a service within this module, or a fully qualified id for a
service in this or any other modulepublic ServiceModelFactory getServiceModelFactory(java.lang.String name)
getServiceModelFactory in interface ModuleRegistryInfrastructure.getServiceModelFactory(String)public Translator getTranslator(java.lang.String translator)
getTranslator in interface ModuleRegistryInfrastructure.getTranslator(String)public java.util.Locale getLocale()
getLocale in interface ModuleRegistry.getLocale()public ErrorHandler getErrorHandler()
ModuleErrorHandler for this Registry.getErrorHandler in interface Modulepublic java.lang.String valueForSymbol(java.lang.String symbol)
SymbolSourcevalueForSymbol in interface SymbolSourcepublic java.lang.Class resolveType(java.lang.String type)
ModuleresolveType in interface Moduletype - the Java type to convert into a class. May be a primitive type, or an array of
objects or primitives.Class object.