public static final class ModuleDescriptor.Builder extends Object
ModuleDescriptor objects.
Example usage:
ModuleDescriptor descriptor = new ModuleDescriptor.Builder("m1")
.requires("m2")
.exports("p")
.build();
| Constructor and Description |
|---|
Builder(String name)
Initializes a new builder with the given module name.
|
| Modifier and Type | Method and Description |
|---|---|
ModuleDescriptor |
build()
Builds and returns a
ModuleDescriptor from its components. |
ModuleDescriptor.Builder |
conceals(String pn)
Adds a concealed package.
|
ModuleDescriptor.Builder |
conceals(Set<String> pns)
Adds a set of (possible empty) concealed packages.
|
ModuleDescriptor.Builder |
exports(ModuleDescriptor.Exports e)
Adds an export.
|
ModuleDescriptor.Builder |
exports(String pn)
Adds an export.
|
ModuleDescriptor.Builder |
exports(String pn,
String target)
Adds an export to a target module.
|
ModuleDescriptor.Builder |
exports(String pn,
Set<String> targets)
Adds an export to a set of target modules.
|
ModuleDescriptor.Builder |
mainClass(String mc)
Sets the module main class.
|
ModuleDescriptor.Builder |
osArch(String arch)
Sets the operating system architecture.
|
ModuleDescriptor.Builder |
osName(String name)
Sets the operating system name.
|
ModuleDescriptor.Builder |
osVersion(String version)
Sets the operating system version.
|
ModuleDescriptor.Builder |
provides(ModuleDescriptor.Provides p)
Provides a service with one or more implementations.
|
ModuleDescriptor.Builder |
provides(String st,
String pc)
Provides service
st with implementation pc. |
ModuleDescriptor.Builder |
provides(String st,
Set<String> pcs)
Provides service
st with implementations pcs. |
ModuleDescriptor.Builder |
requires(ModuleDescriptor.Requires req)
Adds a dependence on a module.
|
ModuleDescriptor.Builder |
requires(ModuleDescriptor.Requires.Modifier mod,
String mn)
Adds a dependence on a module with the given modifier.
|
ModuleDescriptor.Builder |
requires(String mn)
Adds a dependence on a module with an empty set of modifiers.
|
ModuleDescriptor.Builder |
requires(Set<ModuleDescriptor.Requires.Modifier> mods,
String mn)
Adds a dependence on a module with the given (and possibly empty)
set of modifiers.
|
ModuleDescriptor.Builder |
uses(String st)
Adds a service dependence.
|
ModuleDescriptor.Builder |
version(ModuleDescriptor.Version v)
Sets the module version.
|
ModuleDescriptor.Builder |
version(String v)
Sets the module version.
|
public Builder(String name)
name - The module nameIllegalArgumentException - If the module name is null or is not a legal Java
identifierpublic ModuleDescriptor.Builder requires(ModuleDescriptor.Requires req)
req - The dependenceIllegalArgumentException - If the dependence is on the module that this builder was
initialized to buildIllegalStateException - If the dependence on the module has already been declaredpublic ModuleDescriptor.Builder requires(Set<ModuleDescriptor.Requires.Modifier> mods, String mn)
mods - The set of modifiersmn - The module nameIllegalArgumentException - If the module name is null, is not a legal Java
identifier, or is equal to the module name that this builder
was initialized to buildIllegalStateException - If the dependence on the module has already been declaredpublic ModuleDescriptor.Builder requires(String mn)
mn - The module nameIllegalArgumentException - If the module name is null, is not a legal Java
identifier, or is equal to the module name that this builder
was initialized to buildIllegalStateException - If the dependence on the module has already been declaredpublic ModuleDescriptor.Builder requires(ModuleDescriptor.Requires.Modifier mod, String mn)
mod - The modifiermn - The module nameIllegalArgumentException - If the module name is null, is not a legal Java
identifier, or is equal to the module name that this builder
was initialized to buildIllegalStateException - If the dependence on the module has already been declaredpublic ModuleDescriptor.Builder uses(String st)
st - The service typeIllegalArgumentException - If the service type is null or is not a legal Java
identifierIllegalStateException - If a dependency on the service type has already been declaredpublic ModuleDescriptor.Builder exports(ModuleDescriptor.Exports e)
e - The exportIllegalStateException - If the package is already declared as an exported or
concealed packagepublic ModuleDescriptor.Builder exports(String pn, Set<String> targets)
pn - The package nametargets - The set of target modules namesIllegalArgumentException - If the package name or any of the target modules is
null or is not a legal Java identifier, or the set of
targets is emptyIllegalStateException - If the package is already declared as an exported or
concealed packagepublic ModuleDescriptor.Builder exports(String pn, String target)
pn - The package nametarget - The target module nameIllegalArgumentException - If the package name or target module is null or is
not a legal Java identifierIllegalStateException - If the package is already declared as an exported or
concealed packagepublic ModuleDescriptor.Builder exports(String pn)
pn - The package nameIllegalArgumentException - If the package name is null or is not a legal Java
identifierIllegalStateException - If the package is already declared as an exported or
concealed packagepublic ModuleDescriptor.Builder provides(ModuleDescriptor.Provides p)
p - The providesIllegalStateException - If the providers for the service type have already been
declaredpublic ModuleDescriptor.Builder provides(String st, Set<String> pcs)
st with implementations pcs.st - The service typepcs - The set of provider class namesIllegalArgumentException - If the service type or any of the provider class names is
null or is not a legal Java identifier, or the set
of provider class names is emptyIllegalStateException - If the providers for the service type have already been
declaredpublic ModuleDescriptor.Builder provides(String st, String pc)
st with implementation pc.st - The service typepc - The provider class nameIllegalArgumentException - If the service type or the provider class name is
null or is not a legal Java identifierIllegalStateException - If the providers for the service type have already been
declaredpublic ModuleDescriptor.Builder conceals(Set<String> pns)
pns - The set of package names of the concealed packagesIllegalArgumentException - If any of the package names is null or is not a
legal Java identifierIllegalStateException - If any of packages are already declared as a concealed or
exported packagepublic ModuleDescriptor.Builder conceals(String pn)
pn - The package nameIllegalArgumentException - If the package name is null, or is not a legal Java
identifierIllegalStateException - If the package is already declared as a concealed or exported
packagepublic ModuleDescriptor.Builder version(ModuleDescriptor.Version v)
v - The versionIllegalStateException - If the module version is already setpublic ModuleDescriptor.Builder version(String v)
v - The version string to parseIllegalArgumentException - If v is null or cannot be parsed as a version stringIllegalStateException - If the module version is already setModuleDescriptor.Version.parse(String)public ModuleDescriptor.Builder mainClass(String mc)
mc - The module main classIllegalArgumentException - If mainClass is null or is not a legal Java identifierIllegalStateException - If the module main class is already setpublic ModuleDescriptor.Builder osName(String name)
name - The operating system nameIllegalArgumentException - If name is null or the empty StringIllegalStateException - If the operating system name is already setpublic ModuleDescriptor.Builder osArch(String arch)
arch - The operating system architectureIllegalArgumentException - If name is null or the empty StringIllegalStateException - If the operating system architecture is already setpublic ModuleDescriptor.Builder osVersion(String version)
version - The operating system versionIllegalArgumentException - If name is null or the empty StringIllegalStateException - If the operating system version is already setpublic ModuleDescriptor build()
ModuleDescriptor from its components. Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2016, Oracle and/or its affiliates. All rights reserved.
DRAFT 9-internal+0-2016-04-14-195246.buildd.src