Package org.apache.bcel.classfile
Class ModuleOpens
java.lang.Object
org.apache.bcel.classfile.ModuleOpens
This class represents an entry in the opens table of the Module attribute. Each entry describes a package which the
parent module opens.
- Since:
- 6.4.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
private 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.int
Gets the flags for this ModuleOpens.getPackageName
(ConstantPool constantPool) Gets the opened package name.private static String
getToModuleNameAtIndex
(ConstantPool constantPool, int index) String[]
getToModuleNames
(ConstantPool constantPool) Gets an array of module names for this ModuleOpens.toString()
toString
(ConstantPool constantPool)
-
Field Details
-
opensIndex
private final int opensIndex -
opensFlags
private final int opensFlags -
opensToCount
private final int opensToCount -
opensToIndex
private final int[] opensToIndex
-
-
Constructor Details
-
ModuleOpens
ModuleOpens(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
-
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
- 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
-
getOpensFlags
public int getOpensFlags()Gets the flags for this ModuleOpens.- Returns:
- the opensFlags
- Since:
- 6.10.0
-
getPackageName
Gets the opened package name.- Parameters:
constantPool
- the constant pool from the ClassFile- Returns:
- the opened package name
- Since:
- 6.10.0
-
getToModuleNames
Gets an array of module names for this ModuleOpens.- Parameters:
constantPool
- Array of constants usually obtained from the ClassFile object- Returns:
- array of module names following 'opens to'
- Since:
- 6.10.0
-
toString
-
toString
- Returns:
- Resolved string representation
-