Package org.apache.bcel.classfile
Class ModuleOpens
- java.lang.Object
-
- org.apache.bcel.classfile.ModuleOpens
-
- All Implemented Interfaces:
java.lang.Cloneable,Node
public final class ModuleOpens extends java.lang.Object implements java.lang.Cloneable, Node
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:
Module
-
-
Field Summary
Fields Modifier and Type Field Description private intopensFlagsprivate intopensIndexprivate intopensToCountprivate int[]opensToIndex
-
Constructor Summary
Constructors Constructor Description ModuleOpens(java.io.DataInput dataInput)Constructs object from file stream.
-
Method Summary
All Methods Static 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.ModuleOpenscopy()voiddump(java.io.DataOutputStream file)Dumps table entry to file stream in binary format.intgetOpensFlags()Gets the flags for this ModuleOpens.java.lang.StringgetPackageName(ConstantPool constantPool)Gets the opened package name.private static java.lang.StringgetToModuleNameAtIndex(ConstantPool constantPool, int index)java.lang.String[]getToModuleNames(ConstantPool constantPool)Gets an array of module names for this ModuleOpens.java.lang.StringtoString()java.lang.StringtoString(ConstantPool constantPool)
-
-
-
Method Detail
-
getToModuleNameAtIndex
private static java.lang.String getToModuleNameAtIndex(ConstantPool constantPool, int index)
-
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 ModuleOpens copy()
- Returns:
- deep copy of this object.
-
dump
public void dump(java.io.DataOutputStream file) throws java.io.IOExceptionDumps table entry to file stream in binary format.- Parameters:
file- Output file stream.- Throws:
java.io.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
public java.lang.String getPackageName(ConstantPool constantPool)
Gets the opened package name.- Parameters:
constantPool- the constant pool from the ClassFile.- Returns:
- the opened package name.
- Since:
- 6.10.0
-
getToModuleNames
public java.lang.String[] getToModuleNames(ConstantPool constantPool)
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
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- Returns:
- String representation.
-
toString
public java.lang.String toString(ConstantPool constantPool)
- Returns:
- Resolved string representation.
-
-