Package org.apache.bcel.classfile
Class ModuleRequires
- java.lang.Object
-
- org.apache.bcel.classfile.ModuleRequires
-
- All Implemented Interfaces:
java.lang.Cloneable,Node
public final class ModuleRequires extends java.lang.Object implements java.lang.Cloneable, Node
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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(Visitor v)Called by objects that are traversing the nodes of the tree implicitly defined by the contents of a Java class.ModuleRequirescopy()Creates a deep copy of this object.voiddump(java.io.DataOutputStream file)Dumps table entry to file stream in binary format.java.lang.StringgetModuleName(ConstantPool constantPool)Gets the module name from the constant pool.intgetRequiresFlags()Gets the flags for this ModuleRequires.java.lang.StringgetVersion(ConstantPool constantPool)Gets the required version from the constant pool.java.lang.StringtoString()java.lang.StringtoString(ConstantPool constantPool)Gets the resolved string representation.
-
-
-
Method Detail
-
accept
public void accept(Visitor v)
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
public ModuleRequires copy()
Creates a deep copy of this object.- Returns:
- deep copy of this object.
-
dump
public void dump(java.io.DataOutputStream file) throws java.io.IOException
Dumps table entry to file stream in binary format.- Parameters:
file- Output file stream.- Throws:
java.io.IOException- Thrown if an I/O Exception occurs in writeShort.
-
getModuleName
public java.lang.String getModuleName(ConstantPool constantPool)
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
public java.lang.String getVersion(ConstantPool constantPool)
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
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- Returns:
- String representation.
-
toString
public java.lang.String toString(ConstantPool constantPool)
Gets the resolved string representation.- Parameters:
constantPool- The constant pool.- Returns:
- Resolved string representation.
-
-