Top Description Fields Constructors Methods
org.objectweb.asm

pack-priv final Class ModuleWriter

extends ModuleVisitor
Class Inheritance

A ModuleVisitor that generates the corresponding Module, ModulePackages and ModuleMainClass attributes, as defined in the Java Virtual Machine Specification (JVMS).
Authors
Remi Forax, Eric Bruneton
See Also
JVMS 4.7.25, JVMS 4.7.26, JVMS 4.7.27

Field Summary

Modifier and TypeField and Description
private final ByteVector
exports

The binary content of the 'exports' array of the JVMS Module attribute.

private int
exportsCount

The exports_count field of the JVMS Module attribute.

private int
mainClassIndex

The main_class_index field of the JVMS ModuleMainClass attribute, or 0.

private final int
moduleFlags

The module_flags field of the JVMS Module attribute.

private final int
moduleNameIndex

The module_name_index field of the JVMS Module attribute.

private final int
moduleVersionIndex

The module_version_index field of the JVMS Module attribute.

private final ByteVector
opens

The binary content of the 'opens' array of the JVMS Module attribute.

private int
opensCount

The opens_count field of the JVMS Module attribute.

private int
packageCount

The provides_count field of the JVMS ModulePackages attribute.

private final ByteVector
packageIndex

The binary content of the 'package_index' array of the JVMS ModulePackages attribute.

private final ByteVector
provides

The binary content of the 'provides' array of the JVMS Module attribute.

private int
providesCount

The provides_count field of the JVMS Module attribute.

private final ByteVector
requires

The binary content of the 'requires' array of the JVMS Module attribute.

private int
requiresCount

The requires_count field of the JVMS Module attribute.

private final SymbolTable
symbolTable

Where the constants used in this AnnotationWriter must be stored.

private int
usesCount

The uses_count field of the JVMS Module attribute.

private final ByteVector
usesIndex

The binary content of the 'uses_index' array of the JVMS Module attribute.

Inherited from org.objectweb.asm.ModuleVisitor:
apimv

Constructor Summary

AccessConstructor and Description
pack-priv
ModuleWriter(final SymbolTable symbolTable, final int name, final int access, final int version)

Method Summary

Modifier and TypeMethod and Description
pack-priv int

Returns:

the size in bytes of the Module, ModulePackages and ModuleMainClass attributes.
computeAttributesSize
()

Returns the size of the Module, ModulePackages and ModuleMainClass attributes generated by this ModuleWriter.

pack-priv int

Returns:

the number of Module, ModulePackages and ModuleMainClass attributes (between 1 and 3).
getAttributeCount
()

Returns the number of Module, ModulePackages and ModuleMainClass attributes generated by this ModuleWriter.

pack-priv void
putAttributes(final ByteVector
where the attributes must be put.
output
)

Puts the Module, ModulePackages and ModuleMainClass attributes generated by this ModuleWriter in the given ByteVector.

public void
visitEnd()

Overrides org.objectweb.asm.ModuleVisitor.visitEnd.

Visits the end of the module.
public void
visitExport(final String
the internal name of the exported package (see Type#getInternalName()).
packaze
,
final int
the access flag of the exported package, valid values are among ACC_SYNTHETIC and ACC_MANDATED.
access
,
final String...
the fully qualified names (using dots) of the modules that can access the public classes of the exported package, or null.
modules
)

Overrides org.objectweb.asm.ModuleVisitor.visitExport.

Visit an exported package of the current module.
public void
visitMainClass(final String
the internal name of the main class of the current module (see Type#getInternalName()).
mainClass
)

Overrides org.objectweb.asm.ModuleVisitor.visitMainClass.

Visit the main class of the current module.
public void
visitOpen(final String
the internal name of the opened package (see Type#getInternalName()).
packaze
,
final int
the access flag of the opened package, valid values are among ACC_SYNTHETIC and ACC_MANDATED.
access
,
final String...
the fully qualified names (using dots) of the modules that can use deep reflection to the classes of the open package, or null.
modules
)

Overrides org.objectweb.asm.ModuleVisitor.visitOpen.

Visit an open package of the current module.
public void
visitPackage(final String
the internal name of a package (see Type#getInternalName()).
packaze
)

Overrides org.objectweb.asm.ModuleVisitor.visitPackage.

Visit a package of the current module.
public void
visitProvide(final String
the internal name of the service (see Type#getInternalName()).
service
,
final String...
the internal names (see Type#getInternalName()) of the implementations of the service (there is at least one provider).
providers
)

Overrides org.objectweb.asm.ModuleVisitor.visitProvide.

Visit an implementation of a service.
public void
visitRequire(final String
the fully qualified name (using dots) of the dependence.
module
,
final int
the access flag of the dependence among ACC_TRANSITIVE, ACC_STATIC_PHASE, ACC_SYNTHETIC and ACC_MANDATED.
access
,
final String
the module version at compile time, or null.
version
)

Overrides org.objectweb.asm.ModuleVisitor.visitRequire.

Visits a dependence of the current module.
public void
visitUse(final String
the internal name of the service (see Type#getInternalName()).
service
)

Overrides org.objectweb.asm.ModuleVisitor.visitUse.

Visit a service used by the current module.
Inherited from org.objectweb.asm.ModuleVisitor:
getDelegate

Field Detail

exportsback to summary
private final ByteVector exports

The binary content of the 'exports' array of the JVMS Module attribute.

exportsCountback to summary
private int exportsCount

The exports_count field of the JVMS Module attribute.

mainClassIndexback to summary
private int mainClassIndex

The main_class_index field of the JVMS ModuleMainClass attribute, or 0.

moduleFlagsback to summary
private final int moduleFlags

The module_flags field of the JVMS Module attribute.

moduleNameIndexback to summary
private final int moduleNameIndex

The module_name_index field of the JVMS Module attribute.

moduleVersionIndexback to summary
private final int moduleVersionIndex

The module_version_index field of the JVMS Module attribute.

opensback to summary
private final ByteVector opens

The binary content of the 'opens' array of the JVMS Module attribute.

opensCountback to summary
private int opensCount

The opens_count field of the JVMS Module attribute.

packageCountback to summary
private int packageCount

The provides_count field of the JVMS ModulePackages attribute.

packageIndexback to summary
private final ByteVector packageIndex

The binary content of the 'package_index' array of the JVMS ModulePackages attribute.

providesback to summary
private final ByteVector provides

The binary content of the 'provides' array of the JVMS Module attribute.

providesCountback to summary
private int providesCount

The provides_count field of the JVMS Module attribute.

requiresback to summary
private final ByteVector requires

The binary content of the 'requires' array of the JVMS Module attribute.

requiresCountback to summary
private int requiresCount

The requires_count field of the JVMS Module attribute.

symbolTableback to summary
private final SymbolTable symbolTable

Where the constants used in this AnnotationWriter must be stored.

usesCountback to summary
private int usesCount

The uses_count field of the JVMS Module attribute.

usesIndexback to summary
private final ByteVector usesIndex

The binary content of the 'uses_index' array of the JVMS Module attribute.

Constructor Detail

ModuleWriterback to summary
pack-priv ModuleWriter(final SymbolTable symbolTable, final int name, final int access, final int version)

Method Detail

computeAttributesSizeback to summary
pack-priv int computeAttributesSize()

Returns the size of the Module, ModulePackages and ModuleMainClass attributes generated by this ModuleWriter. Also add the names of these attributes in the constant pool.

Returns:int

the size in bytes of the Module, ModulePackages and ModuleMainClass attributes.

getAttributeCountback to summary
pack-priv int getAttributeCount()

Returns the number of Module, ModulePackages and ModuleMainClass attributes generated by this ModuleWriter.

Returns:int

the number of Module, ModulePackages and ModuleMainClass attributes (between 1 and 3).

putAttributesback to summary
pack-priv void putAttributes(final ByteVector output)

Puts the Module, ModulePackages and ModuleMainClass attributes generated by this ModuleWriter in the given ByteVector.

Parameters
output:ByteVector

where the attributes must be put.

visitEndback to summary
public void visitEnd()

Overrides org.objectweb.asm.ModuleVisitor.visitEnd.

Doc from org.objectweb.asm.ModuleVisitor.visitEnd.

Visits the end of the module. This method, which is the last one to be called, is used to inform the visitor that everything have been visited.

Annotations
@Override
visitExportback to summary
public void visitExport(final String packaze, final int access, final String... modules)

Overrides org.objectweb.asm.ModuleVisitor.visitExport.

Doc from org.objectweb.asm.ModuleVisitor.visitExport.

Visit an exported package of the current module.

Parameters
packaze:String

the internal name of the exported package (see Type#getInternalName()).

access:int

the access flag of the exported package, valid values are among ACC_SYNTHETIC and ACC_MANDATED.

modules:String[]

the fully qualified names (using dots) of the modules that can access the public classes of the exported package, or null.

Annotations
@Override
visitMainClassback to summary
public void visitMainClass(final String mainClass)

Overrides org.objectweb.asm.ModuleVisitor.visitMainClass.

Doc from org.objectweb.asm.ModuleVisitor.visitMainClass.

Visit the main class of the current module.

Parameters
mainClass:String

the internal name of the main class of the current module (see Type#getInternalName()).

Annotations
@Override
visitOpenback to summary
public void visitOpen(final String packaze, final int access, final String... modules)

Overrides org.objectweb.asm.ModuleVisitor.visitOpen.

Doc from org.objectweb.asm.ModuleVisitor.visitOpen.

Visit an open package of the current module.

Parameters
packaze:String

the internal name of the opened package (see Type#getInternalName()).

access:int

the access flag of the opened package, valid values are among ACC_SYNTHETIC and ACC_MANDATED.

modules:String[]

the fully qualified names (using dots) of the modules that can use deep reflection to the classes of the open package, or null.

Annotations
@Override
visitPackageback to summary
public void visitPackage(final String packaze)

Overrides org.objectweb.asm.ModuleVisitor.visitPackage.

Doc from org.objectweb.asm.ModuleVisitor.visitPackage.

Visit a package of the current module.

Parameters
packaze:String

the internal name of a package (see Type#getInternalName()).

Annotations
@Override
visitProvideback to summary
public void visitProvide(final String service, final String... providers)

Overrides org.objectweb.asm.ModuleVisitor.visitProvide.

Doc from org.objectweb.asm.ModuleVisitor.visitProvide.

Visit an implementation of a service.

Parameters
service:String

the internal name of the service (see Type#getInternalName()).

providers:String[]

the internal names (see Type#getInternalName()) of the implementations of the service (there is at least one provider).

Annotations
@Override
visitRequireback to summary
public void visitRequire(final String module, final int access, final String version)

Overrides org.objectweb.asm.ModuleVisitor.visitRequire.

Doc from org.objectweb.asm.ModuleVisitor.visitRequire.

Visits a dependence of the current module.

Parameters
module:String

the fully qualified name (using dots) of the dependence.

access:int

the access flag of the dependence among ACC_TRANSITIVE, ACC_STATIC_PHASE, ACC_SYNTHETIC and ACC_MANDATED.

version:String

the module version at compile time, or null.

Annotations
@Override
visitUseback to summary
public void visitUse(final String service)

Overrides org.objectweb.asm.ModuleVisitor.visitUse.

Doc from org.objectweb.asm.ModuleVisitor.visitUse.

Visit a service used by the current module. The name must be the internal name of an interface or a class.

Parameters
service:String

the internal name of the service (see Type#getInternalName()).

Annotations
@Override