APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.org.apache.bcel.internal.classfile

public final Class ModuleRequires

extends Object
implements Cloneable, Node
Class Inheritance
All Implemented Interfaces
com.sun.org.apache.bcel.internal.classfile.Node, java.lang.Cloneable
Imports
java.io.DataInput, .DataOutputStream, .IOException, com.sun.org.apache.bcel.internal.Const

This class represents an entry in the requires table of the Module attribute. Each entry describes a module on which the parent module depends.
Since
6.4.0
See Also
Module

Field Summary

Modifier and TypeField and Description
private final int
private final int
private final int

Constructor Summary

AccessConstructor and Description
pack-priv
ModuleRequires(final DataInput
Input stream
file
)

Constructs object from file stream.

Method Summary

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

Implements com.sun.org.apache.bcel.internal.classfile.Node.accept.

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

public ModuleRequires
copy()

Returns: deep copy of this object

public void
dump(final DataOutputStream
Output file stream
file
)

Dump table entry to file stream in binary format.

public String

Returns:

module name
getModuleName
(final ConstantPool
Array of constants usually obtained from the ClassFile object
constantPool
)

Gets the module name from the constant pool.

public int

Returns:

the requiresFlags
getRequiresFlags
()

Gets the flags for this ModuleRequires.

public String

Returns:

required version, "0" if version index is 0.
getVersion
(final ConstantPool
Array of constants usually obtained from the ClassFile object
constantPool
)

Gets the required version from the constant pool.

public String

Returns:

String representation
toString
()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public String
toString(final ConstantPool constantPool)

Returns: Resolved string representation

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

requiresFlagsback to summary
private final int requiresFlags
requiresIndexback to summary
private final int requiresIndex
requiresVersionIndexback to summary
private final int requiresVersionIndex

Constructor Detail

ModuleRequiresback to summary
pack-priv ModuleRequires(final DataInput file) throws IOException

Constructs object from file stream.

Parameters
file:DataInput

Input stream

Exceptions
IOException:
if an I/O Exception occurs in readUnsignedShort

Method Detail

acceptback to summary
public void accept(final Visitor v)

Implements com.sun.org.apache.bcel.internal.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 ModuleRequires copy()
Returns:ModuleRequires

deep copy of this object

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

Dump table entry to file stream in binary format.

Parameters
file:DataOutputStream

Output file stream

Exceptions
IOException:
if an I/O Exception occurs in writeShort
getModuleNameback to summary
public String getModuleName(final ConstantPool constantPool)

Gets the module name from the constant pool.

Parameters
constantPool:ConstantPool

Array of constants usually obtained from the ClassFile object

Returns:String

module name

Since
6.10.0
getRequiresFlagsback to summary
public int getRequiresFlags()

Gets the flags for this ModuleRequires.

Returns:int

the requiresFlags

Since
6.10.0
getVersionback to summary
public String getVersion(final ConstantPool constantPool)

Gets the required version from the constant pool.

Parameters
constantPool:ConstantPool

Array of constants usually obtained from the ClassFile object

Returns:String

required version, "0" if version index is 0.

Since
6.10.0
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

String representation

Annotations
@Override
toStringback to summary
public String toString(final ConstantPool constantPool)
Returns:String

Resolved string representation