Top Description Fields Constructors Methods
org.apache.bcel.classfile

public final Class Module

extends Attribute
Class Inheritance
Imports
java.io.DataInput, .DataOutputStream, .IOException, java.util.Arrays, org.apache.bcel.Const

This class is derived from Attribute and represents the list of modules required, exported, opened or provided by a module. There may be at most one Module attribute in a ClassFile structure.
Since
6.4.0
See Also
Attribute

Field Summary

Modifier and TypeField and Description
private ModuleExports[]
public static final String
EXTENSION

The module file name extension.

private final int
private final int
private final int
private ModuleOpens[]
private ModuleProvides[]
private ModuleRequires[]
private final int
private final int[]
Inherited from org.apache.bcel.classfile.Attribute:
constant_poolEMPTY_ARRAYlengthname_indextag

Constructor Summary

AccessConstructor and Description
pack-priv
Module(final int
Index in constant pool
nameIndex
,
final int
Content length in bytes
length
,
final DataInput
Input stream
input
,
final ConstantPool
Array of constants
constantPool
)

Constructs object from input stream.

Method Summary

Modifier and TypeMethod and Description
public void
accept(final Visitor
Visitor object
v
)

Implements abstract org.apache.bcel.classfile.Attribute.accept.

Implements org.apache.bcel.classfile.Node.accept.

Called by objects that are traversing the nodes of the tree implicitly defined by the contents of a Java class.
public Attribute

Returns:

deep copy of this attribute
copy
(final ConstantPool
constant pool to save.
constantPool
)

Implements abstract org.apache.bcel.classfile.Attribute.copy.

public void
dump(final DataOutputStream
Output file stream
file
)

Overrides org.apache.bcel.classfile.Attribute.dump.

Dump Module attribute to file stream in binary format.
public ModuleExports[]

Returns:

table of exported interfaces
getExportsTable
()

public ModuleOpens[]

Returns:

table of provided interfaces
getOpensTable
()

public ModuleProvides[]

Returns:

table of provided interfaces
getProvidesTable
()

public ModuleRequires[]

Returns:

table of required modules
getRequiresTable
()

public String

Returns:

String representation, i.e., a list of packages.
toString
()

Overrides org.apache.bcel.classfile.Attribute.toString.

Returns a string representation of the object.
Inherited from org.apache.bcel.classfile.Attribute:
addAttributeReaderaddAttributeReaderclonegetConstantPoolgetLengthgetNamegetNameIndexgetTagprintlnreadAttributereadAttributeremoveAttributeReadersetConstantPoolsetLengthsetNameIndex

Field Detail

exportsTableback to summary
private ModuleExports[] exportsTable
EXTENSIONback to summary
public static final String EXTENSION

The module file name extension.

Since
6.7.0
moduleFlagsback to summary
private final int moduleFlags
moduleNameIndexback to summary
private final int moduleNameIndex
moduleVersionIndexback to summary
private final int moduleVersionIndex
opensTableback to summary
private ModuleOpens[] opensTable
providesTableback to summary
private ModuleProvides[] providesTable
requiresTableback to summary
private ModuleRequires[] requiresTable
usesCountback to summary
private final int usesCount
usesIndexback to summary
private final int[] usesIndex

Constructor Detail

Moduleback to summary
pack-priv Module(final int nameIndex, final int length, final DataInput input, final ConstantPool constantPool) throws IOException

Constructs object from input stream.

Parameters
nameIndex:int

Index in constant pool

length:int

Content length in bytes

input:DataInput

Input stream

constantPool:ConstantPool

Array of constants

Exceptions
IOException:
if an I/O error occurs.

Method Detail

acceptback to summary
public void accept(final Visitor v)

Implements abstract org.apache.bcel.classfile.Attribute.accept.

Implements org.apache.bcel.classfile.Node.accept.

Called by objects that are traversing the nodes of the tree implicitly defined by the contents of a Java class. I.e., the hierarchy of methods, fields, attributes, etc. spawns a tree of objects.

Parameters
v:Visitor

Visitor object

Annotations
@Override
copyback to summary
public Attribute copy(final ConstantPool constantPool)

Implements abstract org.apache.bcel.classfile.Attribute.copy.

Parameters
constantPool:ConstantPool

Doc from org.apache.bcel.classfile.Attribute.copy.

constant pool to save.

Returns:Attribute

deep copy of this attribute

Annotations
@Override
dumpback to summary
public void dump(final DataOutputStream file) throws IOException

Overrides org.apache.bcel.classfile.Attribute.dump.

Dump Module attribute to file stream in binary format.

Parameters
file:DataOutputStream

Output file stream

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
getExportsTableback to summary
public ModuleExports[] getExportsTable()
Returns:ModuleExports[]

table of exported interfaces

See Also
ModuleExports
getOpensTableback to summary
public ModuleOpens[] getOpensTable()
Returns:ModuleOpens[]

table of provided interfaces

See Also
ModuleOpens
getProvidesTableback to summary
public ModuleProvides[] getProvidesTable()
Returns:ModuleProvides[]

table of provided interfaces

See Also
ModuleProvides
getRequiresTableback to summary
public ModuleRequires[] getRequiresTable()
Returns:ModuleRequires[]

table of required modules

See Also
ModuleRequires
toStringback to summary
public String toString()

Overrides org.apache.bcel.classfile.Attribute.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

String representation, i.e., a list of packages.

Annotations
@Override