final class ModuleWriter extends ModuleVisitor
Modifier and Type | Field and Description |
---|---|
private int |
access
module access flags
|
(package private) int |
attributeCount
Number of attributes associated with the current module
(Version, ConcealPackages, etc)
|
(package private) int |
attributesSize
Size in bytes of the attributes associated with the current module
|
private ClassWriter |
cw
The class writer to which this Module attribute must be added.
|
private int |
exportCount
number of exports items
|
private ByteVector |
exports
The exports items in bytecode form.
|
private int |
mainClass
module main class index in the constant pool or 0
|
private int |
name
module name index in the constant pool
|
private int |
openCount
number of opens items
|
private ByteVector |
opens
The opens items in bytecode form.
|
private int |
packageCount
number of packages
|
private ByteVector |
packages
The packages in bytecode form.
|
private int |
provideCount
number of provides items
|
private ByteVector |
provides
The uses provides in bytecode form.
|
private int |
requireCount
number of requires items
|
private ByteVector |
requires
The requires items in bytecode form.
|
(package private) int |
size
size in byte of the Module attribute.
|
private int |
useCount
number of uses items
|
private ByteVector |
uses
The uses items in bytecode form.
|
private int |
version
module version index in the constant pool or 0
|
api, mv
Constructor and Description |
---|
ModuleWriter(ClassWriter cw,
int name,
int access,
int version) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
put(ByteVector out) |
(package private) void |
putAttributes(ByteVector out) |
void |
visitEnd() |
void |
visitExport(java.lang.String packaze,
int access,
java.lang.String... modules)
Visit an exported package of the current module.
|
void |
visitMainClass(java.lang.String mainClass)
Visit the main class of the current module.
|
void |
visitOpen(java.lang.String packaze,
int access,
java.lang.String... modules)
Visit an open package of the current module.
|
void |
visitPackage(java.lang.String packaze)
Visit a concealed package of the current module.
|
void |
visitProvide(java.lang.String service,
java.lang.String... providers)
Visit an implementation of a service.
|
void |
visitRequire(java.lang.String module,
int access,
java.lang.String version)
Visits a dependence of the current module.
|
void |
visitUse(java.lang.String service)
Visit a service used by the current module.
|
private final ClassWriter cw
int size
int attributeCount
int attributesSize
private final int name
private final int access
private final int version
private int mainClass
private int packageCount
private ByteVector packages
private int requireCount
private ByteVector requires
private int exportCount
private ByteVector exports
private int openCount
private ByteVector opens
private int useCount
private ByteVector uses
private int provideCount
private ByteVector provides
ModuleWriter(ClassWriter cw, int name, int access, int version)
public void visitMainClass(java.lang.String mainClass)
ModuleVisitor
visitMainClass
in class ModuleVisitor
mainClass
- the main class of the current module.public void visitPackage(java.lang.String packaze)
ModuleVisitor
visitPackage
in class ModuleVisitor
packaze
- name of a concealed packagepublic void visitRequire(java.lang.String module, int access, java.lang.String version)
ModuleVisitor
visitRequire
in class ModuleVisitor
module
- the module name of the dependenceaccess
- the access flag of the dependence among
ACC_TRANSITIVE, ACC_STATIC_PHASE, ACC_SYNTHETIC
and ACC_MANDATED.version
- the module version at compile time or null.public void visitExport(java.lang.String packaze, int access, java.lang.String... modules)
ModuleVisitor
visitExport
in class ModuleVisitor
packaze
- the name of the exported package.access
- the access flag of the exported package,
valid values are among ACC_SYNTHETIC
and
ACC_MANDATED
.modules
- names of the modules that can access to
the public classes of the exported package or
null.public void visitOpen(java.lang.String packaze, int access, java.lang.String... modules)
ModuleVisitor
visitOpen
in class ModuleVisitor
packaze
- the name of the opened package.access
- the access flag of the opened package,
valid values are among ACC_SYNTHETIC
and
ACC_MANDATED
.modules
- names of the modules that can use deep
reflection to the classes of the open package or
null.public void visitUse(java.lang.String service)
ModuleVisitor
visitUse
in class ModuleVisitor
service
- the internal name of the service.public void visitProvide(java.lang.String service, java.lang.String... providers)
ModuleVisitor
visitProvide
in class ModuleVisitor
service
- the internal name of the serviceproviders
- the internal names of the implementations
of the service (there is at least one provider).public void visitEnd()
visitEnd
in class ModuleVisitor
void putAttributes(ByteVector out)
void put(ByteVector out)