Package org.jboss.modules

# Class ModuleDependencySpecBuilder

java.lang.Object
org.jboss.modules.DependencySpecBuilder
org.jboss.modules.ModuleDependencySpecBuilder

public final class ModuleDependencySpecBuilder extends DependencySpecBuilder
A builder for dependency specifications that refer to other modules.

## Constructor Summary

Constructors
Constructor
Description
`ModuleDependencySpecBuilder()`
Construct a new instance.

## Method Summary

Modifier and Type
Method
Description
`ModuleDependencySpec`
`build()`
Construct the dependency specification.
`ModuleLoader`
`getModuleLoader()`
Get the module loader of the dependency.
`String`
`getName()`
Get the module name.
`boolean`
`isOptional()`
Determine whether this dependency will be optional.
`ModuleDependencySpecBuilder`
`setClassExportFilter(ClassFilter classExportFilter)`
Set the class export filter to use.
`ModuleDependencySpecBuilder`
`setClassImportFilter(ClassFilter classImportFilter)`
Set the class import filter to use.
`ModuleDependencySpecBuilder`
`setExport(boolean export)`
Set a simple export filter, based on a `boolean` flag.
`ModuleDependencySpecBuilder`
`setExportFilter(PathFilter exportFilter)`
Set the export filter to use.
`ModuleDependencySpecBuilder`
`setImportFilter(PathFilter importFilter)`
Set the import filter to use.
`ModuleDependencySpecBuilder`
`setImportServices(boolean services)`
Set a simple import filter, based on a `boolean` flag specifying whether services should be imported.
`ModuleDependencySpecBuilder`
`setModuleLoader(ModuleLoader moduleLoader)`
Set the module loader of the dependency.
`ModuleDependencySpecBuilder`
`setName(String name)`
Set the module name.
`ModuleDependencySpecBuilder`
`setOptional(boolean optional)`
Establish whether this dependency will be optional.
`ModuleDependencySpecBuilder`
`setResourceExportFilter(PathFilter resourceExportFilter)`
Set the resource export filter to use.
`ModuleDependencySpecBuilder`
`setResourceImportFilter(PathFilter resourceImportFilter)`
Set the resource import filter to use.

### Methods inherited from class org.jboss.modules.DependencySpecBuilder

`getClassExportFilter, getClassImportFilter, getExportFilter, getImportFilter, getResourceExportFilter, getResourceImportFilter`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### ModuleDependencySpecBuilder

public ModuleDependencySpecBuilder()
Construct a new instance.

## Method Details

### setImportFilter

public ModuleDependencySpecBuilder setImportFilter(PathFilter importFilter)
Description copied from class: `DependencySpecBuilder`
Set the import filter to use.

Overrides:
  `setImportFilter` in class `DependencySpecBuilder`
Parameters:
  `importFilter` - the import filter to use (must not be `null`)
Returns:
  this builder

### setImportServices

public ModuleDependencySpecBuilder setImportServices(boolean services)
Description copied from class: `DependencySpecBuilder`
Set a simple import filter, based on a `boolean` flag specifying whether services should be imported. If the flag is `true`, the import filter is set to `PathFilters.getDefaultImportFilterWithServices()`, otherwise it is set to `PathFilters.getDefaultImportFilter()`. Any previous import filter setting is overwritten.

Overrides:
  `setImportServices` in class `DependencySpecBuilder`
Parameters:
  `services` - the services flag
Returns:
  this builder

### setExportFilter

public ModuleDependencySpecBuilder setExportFilter(PathFilter exportFilter)
Description copied from class: `DependencySpecBuilder`
Set the export filter to use.

Overrides:
  `setExportFilter` in class `DependencySpecBuilder`
Parameters:
  `exportFilter` - the export filter to use (must not be `null`)
Returns:
  this builder

### setExport

public ModuleDependencySpecBuilder setExport(boolean export)
Description copied from class: `DependencySpecBuilder`
Set a simple export filter, based on a `boolean` flag. If the flag is `true`, the export filter is set to `PathFilters.acceptAll()`, otherwise it is set to `PathFilters.rejectAll()`. Any previous export filter setting is overwritten.

Overrides:
  `setExport` in class `DependencySpecBuilder`
Parameters:
  `export` - the export flag
Returns:
  this builder

### setResourceImportFilter

public ModuleDependencySpecBuilder setResourceImportFilter(PathFilter resourceImportFilter)
Description copied from class: `DependencySpecBuilder`
Set the resource import filter to use.

Overrides:
  `setResourceImportFilter` in class `DependencySpecBuilder`
Parameters:
  `resourceImportFilter` - the resource import filter to use (must not be `null`)
Returns:
  this builder

### setResourceExportFilter

public ModuleDependencySpecBuilder setResourceExportFilter(PathFilter resourceExportFilter)
Description copied from class: `DependencySpecBuilder`
Set the resource export filter to use. The default value is `PathFilters.acceptAll()`.

Overrides:
  `setResourceExportFilter` in class `DependencySpecBuilder`
Parameters:
  `resourceExportFilter` - the resource export filter to use (must not be `null`)
Returns:
  this builder

### setClassImportFilter

public ModuleDependencySpecBuilder setClassImportFilter(ClassFilter classImportFilter)
Description copied from class: `DependencySpecBuilder`
Set the class import filter to use.

Overrides:
  `setClassImportFilter` in class `DependencySpecBuilder`
Parameters:
  `classImportFilter` - the class import filter to use (must not be `null`)
Returns:
  this builder

### setClassExportFilter

public ModuleDependencySpecBuilder setClassExportFilter(ClassFilter classExportFilter)
Description copied from class: `DependencySpecBuilder`
Set the class export filter to use.

Overrides:
  `setClassExportFilter` in class `DependencySpecBuilder`
Parameters:
  `classExportFilter` - the class export filter to use (must not be `null`)
Returns:
  this builder

### getModuleLoader

public ModuleLoader getModuleLoader()
Get the module loader of the dependency. Defaults to `null`, indicating that the module loader to use should be the loader of the module being defined.

Returns:
  the module loader of the dependency, or `null` to use the module's own module loader

### setModuleLoader

public ModuleDependencySpecBuilder setModuleLoader(ModuleLoader moduleLoader)
Set the module loader of the dependency.

Parameters:
  `moduleLoader` - the module loader of the dependency, or `null` to use the module's own module loader
Returns:
  this builder

### getName

public String getName()
Get the module name.

Returns:
  the module name, or `null` if was not yet set

### setName

public ModuleDependencySpecBuilder setName(String name)
Set the module name.

Parameters:
  `name` - the module name (must not be `null`)
Returns:
  this builder

### isOptional

public boolean isOptional()
Determine whether this dependency will be optional. The default value is `false`.

Returns:
  `true` if the dependency will be optional, `false` if it will be required

### setOptional

public ModuleDependencySpecBuilder setOptional(boolean optional)
Establish whether this dependency will be optional.

Parameters:
  `optional` - `true` if the dependency will be optional, `false` if it will be required
Returns:
  this builder

### build

public ModuleDependencySpec build()
Description copied from class: `DependencySpecBuilder`
Construct the dependency specification.

Specified by:
  `build` in class `DependencySpecBuilder`
Returns:
  the dependency specification