Package org.apache.bcel.classfile
Class ModuleRequires
java.lang.Object
org.apache.bcel.classfile.ModuleRequires
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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
private final int
private final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Called by objects that are traversing the nodes of the tree implicitly defined by the contents of a Java class.copy()
void
dump
(DataOutputStream file) Dump table entry to file stream in binary format.getModuleName
(ConstantPool constantPool) Gets the module name from the constant pool.int
Gets the flags for this ModuleRequires.getVersion
(ConstantPool constantPool) Gets the required version from the constant pool.toString()
toString
(ConstantPool constantPool)
-
Field Details
-
requiresIndex
private final int requiresIndex -
requiresFlags
private final int requiresFlags -
requiresVersionIndex
private final int requiresVersionIndex
-
-
Constructor Details
-
ModuleRequires
ModuleRequires(DataInput file) throws IOException Constructs object from file stream.- Parameters:
file
- Input stream- Throws:
IOException
- if an I/O Exception occurs in readUnsignedShort
-
-
Method Details
-
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. -
copy
- Returns:
- deep copy of this object
-
dump
Dump table entry to file stream in binary format.- Parameters:
file
- Output file stream- Throws:
IOException
- if an I/O Exception occurs in writeShort
-
getModuleName
Gets the module name from the constant pool.- Parameters:
constantPool
- Array of constants usually obtained from the ClassFile object- Returns:
- module name
- Since:
- 6.10.0
-
getRequiresFlags
public int getRequiresFlags()Gets the flags for this ModuleRequires.- Returns:
- the requiresFlags
- Since:
- 6.10.0
-
getVersion
Gets the required version from the constant pool.- Parameters:
constantPool
- Array of constants usually obtained from the ClassFile object- Returns:
- required version, "0" if version index is 0.
- Since:
- 6.10.0
-
toString
-
toString
- Returns:
- Resolved string representation
-