public class DefaultModuleDefinition extends Object implements ModuleDefinition
ModuleDefinition
implementation that picks up most of the module
properties from the manifest file of the jar, as baked in by
the hk2-maven-plugin.Modifier and Type | Field and Description |
---|---|
protected List<URI> |
classPath |
protected List<ModuleDependency> |
dependencies |
protected Attributes |
mainAttributes
Main attributes section of the manifest.
|
Constructor and Description |
---|
DefaultModuleDefinition(File location)
TO DO need to support a URI constructor
|
DefaultModuleDefinition(File location,
Attributes attr) |
Modifier and Type | Method and Description |
---|---|
protected String |
decorateClassPath(String classpathElement)
Extension point to manipulate the classpath element before it's parsed.
|
ModuleDependency[] |
getDependencies()
Returns the list of module dependencies
|
String |
getImportPolicyClassName()
Returns the class name implementing the
ImportPolicy interface for this module or
null if there is no such implementation |
String |
getLifecyclePolicyClassName()
Returns the class name implementing the
LifecyclePolicy interface for this module or
null if there is no such implementation |
URI[] |
getLocations()
Returns the list of URI locations forming the classpath for this module.
|
Manifest |
getManifest()
Returns the manifest file from the module's implementation jar file
|
ModuleMetadata |
getMetadata()
Gets the metadata that describes various components and services in this module.
|
String |
getName()
Returns the name of the module
|
String[] |
getPublicInterfaces()
Returns the list of classes and packages that have been designated as
public interfaces of this module.
|
String |
getVersion()
Returns the module's version
|
protected void |
parseAttributes(Attributes attr)
Extensibility point to parse more information from Manifest attributes.
|
protected void |
parseClassPath(Attributes attr,
URI baseURI)
Parses from manifest attributes
and updates URI list.
|
String |
toString()
Assists debugging.
|
protected final List<ModuleDependency> dependencies
protected final Attributes mainAttributes
public DefaultModuleDefinition(File location) throws IOException
IOException
public DefaultModuleDefinition(File location, Attributes attr) throws IOException
IOException
protected void parseClassPath(Attributes attr, URI baseURI) throws IOException
IOException
protected String decorateClassPath(String classpathElement)
parseClassPath(Attributes,URI)
protected void parseAttributes(Attributes attr)
attr
- Main attributes of the manifest. Always non-null.public String getName()
getName
in interface ModuleDefinition
public String[] getPublicInterfaces()
getPublicInterfaces
in interface ModuleDefinition
public ModuleDependency[] getDependencies()
getDependencies
in interface ModuleDefinition
public URI[] getLocations()
getLocations
in interface ModuleDefinition
public String getVersion()
getVersion
in interface ModuleDefinition
public String getImportPolicyClassName()
ImportPolicy
interface for this module or
null if there is no such implementationgetImportPolicyClassName
in interface ModuleDefinition
ImportPolicy
implementation class namepublic String getLifecyclePolicyClassName()
LifecyclePolicy
interface for this module or
null if there is no such implementationgetLifecyclePolicyClassName
in interface ModuleDefinition
LifecyclePolicy
implementation class namepublic Manifest getManifest()
getManifest
in interface ModuleDefinition
public ModuleMetadata getMetadata()
ModuleDefinition
getMetadata
in interface ModuleDefinition
Copyright © 2009–2023 Oracle Corporation. All rights reserved.