@HashCodeAndEqualsPlugin.Enhance public abstract static class JavaModule.Dispatcher.Enabled extends Object implements JavaModule.Dispatcher
java.lang.Module
API.Modifier and Type | Class and Description |
---|---|
protected static class |
JavaModule.Dispatcher.Enabled.WithInstrumentationSupport
A dispatcher for a VM that does support the
java.lang.Module API and that supports Instrumentation . |
protected static class |
JavaModule.Dispatcher.Enabled.WithoutInstrumentationSupport
A dispatcher for a VM that does support the
java.lang.Module API and that does not support Instrumentation . |
JavaModule.Dispatcher.CreationAction, JavaModule.Dispatcher.Disabled, JavaModule.Dispatcher.Enabled
Modifier | Constructor and Description |
---|---|
protected |
Enabled(Method getModule,
Method getClassLoader,
Method isNamed,
Method getName,
Method getResourceAsStream,
Method isExported,
Method isOpened,
Method canRead)
Creates an enabled dispatcher.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canRead(Object source,
Object target)
Checks if the source module can read the target module.
|
ClassLoader |
getClassLoader(Object module)
Returns the module's class loader.
|
String |
getName(Object module)
Returns the module's name.
|
InputStream |
getResourceAsStream(Object module,
String name)
Returns a resource stream for this module for a resource of the given name or
null if such a resource does not exist. |
boolean |
isAlive()
Checks if this dispatcher is alive, i.e.
|
boolean |
isExported(Object source,
Object target,
String aPackage)
Returns
true if the source module exports the supplied package to the target module. |
boolean |
isNamed(Object module)
Returns
true if the supplied module is named. |
boolean |
isOpened(Object source,
Object target,
String aPackage)
Returns
true if the source module opens the supplied package to the target module. |
JavaModule |
moduleOf(Class<?> type)
Extracts the Java
Module for the provided class or returns null if the current VM does not support modules. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
modify
protected Enabled(Method getModule, Method getClassLoader, Method isNamed, Method getName, Method getResourceAsStream, Method isExported, Method isOpened, Method canRead)
getModule
- The java.lang.Class#getModule()
method.getClassLoader
- The java.lang.Module#getClassLoader()
method.isNamed
- The java.lang.Module#isNamed()
method.getName
- The java.lang.Module#getName()
method.getResourceAsStream
- The java.lang.Module#getResourceAsStream(String)
method.isExported
- The java.lang.Module#isExported(String,Module)
method.isOpened
- The java.lang.Module#isOpened(String,Module)
method.canRead
- The java.lang.Module#canRead(Module)
method.public boolean isAlive()
isAlive
in interface JavaModule.Dispatcher
true
if modules are supported on the current VM.public JavaModule moduleOf(Class<?> type)
Module
for the provided class or returns null
if the current VM does not support modules.moduleOf
in interface JavaModule.Dispatcher
type
- The type for which to extract the module.Module
or null
if the current VM does not support modules.public InputStream getResourceAsStream(Object module, String name)
null
if such a resource does not exist.getResourceAsStream
in interface JavaModule.Dispatcher
module
- The java.lang.Module
instance to apply this method upon.name
- The name of the resource.null
if it does not exist.public ClassLoader getClassLoader(Object module)
getClassLoader
in interface JavaModule.Dispatcher
module
- The java.lang.Module
public boolean isNamed(Object module)
true
if the supplied module is named.isNamed
in interface JavaModule.Dispatcher
module
- The java.lang.Module
to check for the existence of a name.true
if the supplied module is named.public String getName(Object module)
getName
in interface JavaModule.Dispatcher
module
- The java.lang.Module
to check for its name.public boolean isExported(Object source, Object target, String aPackage)
true
if the source module exports the supplied package to the target module.isExported
in interface JavaModule.Dispatcher
source
- The source module.target
- The target module.aPackage
- The name of the package to check.true
if the source module exports the supplied package to the target module.public boolean isOpened(Object source, Object target, String aPackage)
true
if the source module opens the supplied package to the target module.isOpened
in interface JavaModule.Dispatcher
source
- The source module.target
- The target module.aPackage
- The name of the package to check.true
if the source module opens the supplied package to the target module.public boolean canRead(Object source, Object target)
canRead
in interface JavaModule.Dispatcher
source
- The source module.target
- The target module.true
if the source module can read the target module.Copyright © 2014–2020. All rights reserved.