Package org.apache.bcel.classfile
Class ModuleExports
java.lang.Object
org.apache.bcel.classfile.ModuleExports
This class represents an entry in the exports table of the Module attribute. Each entry describes a package which may
open the parent module.
- Since:
- 6.4.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intprivate final intprivate final intprivate final int[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled by objects that are traversing the nodes of the tree implicitly defined by the contents of a Java class.copy()Creates a deep copy of this object.voiddump(DataOutputStream file) Dumps table entry to file stream in binary format.intGets the flags for this ModuleExports.getPackageName(ConstantPool constantPool) Gets the exported package name.private static StringgetToModuleNameAtIndex(ConstantPool constantPool, int index) String[]getToModuleNames(ConstantPool constantPool) Gets an array of module names for this ModuleExports.toString()toString(ConstantPool constantPool) Gets the resolved string representation.
-
Field Details
-
exportsIndex
private final int exportsIndex -
exportsFlags
private final int exportsFlags -
exportsToCount
private final int exportsToCount -
exportsToIndex
private final int[] exportsToIndex
-
-
Constructor Details
-
ModuleExports
ModuleExports(DataInput dataInput) throws IOException Constructs object from file stream.- Parameters:
dataInput- Input stream.- Throws:
IOException- Thrown if an I/O Exception occurs in readUnsignedShort.
-
-
Method Details
-
getToModuleNameAtIndex
-
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
Creates a deep copy of this object.- Returns:
- deep copy of this object.
-
dump
Dumps table entry to file stream in binary format.- Parameters:
file- Output file stream.- Throws:
IOException- Thrown if an I/O Exception occurs in writeShort.
-
getExportsFlags
public int getExportsFlags()Gets the flags for this ModuleExports.- Returns:
- The exportsFlags.
- Since:
- 6.10.0
-
getPackageName
Gets the exported package name.- Parameters:
constantPool- The constant pool from the ClassFile.- Returns:
- The exported package name.
- Since:
- 6.10.0
-
getToModuleNames
Gets an array of module names for this ModuleExports.- Parameters:
constantPool- Array of constants usually obtained from the ClassFile object.- Returns:
- array of module names following 'exports to'.
- Since:
- 6.10.0
-
toString
-
toString
Gets the resolved string representation.- Parameters:
constantPool- The constant pool.- Returns:
- Resolved string representation.
-