Package org.jboss.modules
Class ModuleDependencySpecBuilder
java.lang.Object
org.jboss.modules.DependencySpecBuilder
org.jboss.modules.ModuleDependencySpecBuilder
A builder for dependency specifications that refer to other modules.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Construct the dependency specification.Get the module loader of the dependency.getName()Get the module name.booleanDetermine whether this dependency will be optional.setClassExportFilter(ClassFilter classExportFilter) Set the class export filter to use.setClassImportFilter(ClassFilter classImportFilter) Set the class import filter to use.setExport(boolean export) Set a simple export filter, based on abooleanflag.setExportFilter(PathFilter exportFilter) Set the export filter to use.setImportFilter(PathFilter importFilter) Set the import filter to use.setImportServices(boolean services) Set a simple import filter, based on abooleanflag specifying whether services should be imported.setModuleLoader(ModuleLoader moduleLoader) Set the module loader of the dependency.Set the module name.setOptional(boolean optional) Establish whether this dependency will be optional.setResourceExportFilter(PathFilter resourceExportFilter) Set the resource export filter to use.setResourceImportFilter(PathFilter resourceImportFilter) Set the resource import filter to use.Methods inherited from class org.jboss.modules.DependencySpecBuilder
getClassExportFilter, getClassImportFilter, getExportFilter, getImportFilter, getResourceExportFilter, getResourceImportFilter
-
Constructor Details
-
ModuleDependencySpecBuilder
public ModuleDependencySpecBuilder()Construct a new instance.
-
-
Method Details
-
setImportFilter
Description copied from class:DependencySpecBuilderSet the import filter to use.- Overrides:
setImportFilterin classDependencySpecBuilder- Parameters:
importFilter- the import filter to use (must not benull)- Returns:
- this builder
-
setImportServices
Description copied from class:DependencySpecBuilderSet a simple import filter, based on abooleanflag specifying whether services should be imported. If the flag istrue, the import filter is set toPathFilters.getDefaultImportFilterWithServices(), otherwise it is set toPathFilters.getDefaultImportFilter(). Any previous import filter setting is overwritten.- Overrides:
setImportServicesin classDependencySpecBuilder- Parameters:
services- the services flag- Returns:
- this builder
-
setExportFilter
Description copied from class:DependencySpecBuilderSet the export filter to use.- Overrides:
setExportFilterin classDependencySpecBuilder- Parameters:
exportFilter- the export filter to use (must not benull)- Returns:
- this builder
-
setExport
Description copied from class:DependencySpecBuilderSet a simple export filter, based on abooleanflag. If the flag istrue, the export filter is set toPathFilters.acceptAll(), otherwise it is set toPathFilters.rejectAll(). Any previous export filter setting is overwritten.- Overrides:
setExportin classDependencySpecBuilder- Parameters:
export- the export flag- Returns:
- this builder
-
setResourceImportFilter
Description copied from class:DependencySpecBuilderSet the resource import filter to use.- Overrides:
setResourceImportFilterin classDependencySpecBuilder- Parameters:
resourceImportFilter- the resource import filter to use (must not benull)- Returns:
- this builder
-
setResourceExportFilter
Description copied from class:DependencySpecBuilderSet the resource export filter to use. The default value isPathFilters.acceptAll().- Overrides:
setResourceExportFilterin classDependencySpecBuilder- Parameters:
resourceExportFilter- the resource export filter to use (must not benull)- Returns:
- this builder
-
setClassImportFilter
Description copied from class:DependencySpecBuilderSet the class import filter to use.- Overrides:
setClassImportFilterin classDependencySpecBuilder- Parameters:
classImportFilter- the class import filter to use (must not benull)- Returns:
- this builder
-
setClassExportFilter
Description copied from class:DependencySpecBuilderSet the class export filter to use.- Overrides:
setClassExportFilterin classDependencySpecBuilder- Parameters:
classExportFilter- the class export filter to use (must not benull)- Returns:
- this builder
-
getModuleLoader
Get the module loader of the dependency. Defaults tonull, indicating that the module loader to use should be the loader of the module being defined.- Returns:
- the module loader of the dependency, or
nullto use the module's own module loader
-
setModuleLoader
Set the module loader of the dependency.- Parameters:
moduleLoader- the module loader of the dependency, ornullto use the module's own module loader- Returns:
- this builder
-
getName
Get the module name.- Returns:
- the module name, or
nullif was not yet set
-
setName
Set the module name.- Parameters:
name- the module name (must not benull)- Returns:
- this builder
-
isOptional
public boolean isOptional()Determine whether this dependency will be optional. The default value isfalse.- Returns:
trueif the dependency will be optional,falseif it will be required
-
setOptional
Establish whether this dependency will be optional.- Parameters:
optional-trueif the dependency will be optional,falseif it will be required- Returns:
- this builder
-
build
Description copied from class:DependencySpecBuilderConstruct the dependency specification.- Specified by:
buildin classDependencySpecBuilder- Returns:
- the dependency specification
-