public static final class ModuleLayer.Controller extends Object
ModuleLayer
to create module layers return a Controller
that can be used to
control modules in the layer.
Unless otherwise specified, passing a null
argument to a
method in this class causes a NullPointerException
to be thrown.
Controller
objects, they
should never be shared with untrusted code.Modifier and Type | Method | Description |
---|---|---|
ModuleLayer.Controller |
addExports(Module source,
String pn,
Module target) |
Updates module
source in the layer to export a package to
module target . |
ModuleLayer.Controller |
addOpens(Module source,
String pn,
Module target) |
Updates module
source in the layer to open a package to
module target . |
ModuleLayer.Controller |
addReads(Module source,
Module target) |
Updates module
source in the layer to read module
target . |
ModuleLayer |
layer() |
Returns the layer that this object controls.
|
public ModuleLayer layer()
public ModuleLayer.Controller addReads(Module source, Module target)
source
in the layer to read module
target
. This method is a no-op if source
already
reads target
.target
from being GC'ed when source
is strongly reachable.source
- The source moduletarget
- The target module to readIllegalArgumentException
- If source
is not in the module layerModule.addReads(java.lang.Module)
public ModuleLayer.Controller addExports(Module source, String pn, Module target)
source
in the layer to export a package to
module target
. This method is a no-op if source
already exports the package to at least target
.source
- The source modulepn
- The package nametarget
- The target moduleIllegalArgumentException
- If source
is not in the module layer or the package
is not in the source moduleModule.addExports(java.lang.String, java.lang.Module)
public ModuleLayer.Controller addOpens(Module source, String pn, Module target)
source
in the layer to open a package to
module target
. This method is a no-op if source
already opens the package to at least target
.source
- The source modulepn
- The package nametarget
- The target moduleIllegalArgumentException
- If source
is not in the module layer or the package
is not in the source moduleModule.addOpens(java.lang.String, java.lang.Module)
Copyright © 1993, 2017, Oracle and/or its affiliates · All rights reserved · License