Package org.apache.bcel.classfile
Class ModuleProvides
- java.lang.Object
-
- org.apache.bcel.classfile.ModuleProvides
-
- All Implemented Interfaces:
java.lang.Cloneable,Node
public final class ModuleProvides extends java.lang.Object implements java.lang.Cloneable, Node
This class represents an entry in the provides table of the Module attribute. Each entry describes a service implementation that the parent module provides.- Since:
- 6.4.0
- See Also:
Module
-
-
Field Summary
Fields Modifier and Type Field Description private intprovidesIndexprivate intprovidesWithCountprivate int[]providesWithIndex
-
Constructor Summary
Constructors Constructor Description ModuleProvides(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.ModuleProvidescopy()voiddump(java.io.DataOutputStream file)Dumps table entry to file stream in binary format.private static java.lang.StringgetImplementationClassNameAtIndex(ConstantPool constantPool, int index, boolean compactClassName)java.lang.String[]getImplementationClassNames(ConstantPool constantPool, boolean compactClassName)Gets the array of implementation class names for this ModuleProvides.java.lang.StringgetInterfaceName(ConstantPool constantPool)Gets the interface name for this ModuleProvides.java.lang.StringtoString()java.lang.StringtoString(ConstantPool constantPool)
-
-
-
Method Detail
-
getImplementationClassNameAtIndex
private static java.lang.String getImplementationClassNameAtIndex(ConstantPool constantPool, int index, boolean compactClassName)
-
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 ModuleProvides 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.
-
getImplementationClassNames
public java.lang.String[] getImplementationClassNames(ConstantPool constantPool, boolean compactClassName)
Gets the array of implementation class names for this ModuleProvides.- Parameters:
constantPool- Array of constants usually obtained from the ClassFile object.compactClassName- false for original constant pool value, true to replace '/' with '.'.- Returns:
- array of implementation class names.
- Since:
- 6.10.0
-
getInterfaceName
public java.lang.String getInterfaceName(ConstantPool constantPool)
Gets the interface name for this ModuleProvides.- Parameters:
constantPool- Array of constants usually obtained from the ClassFile object.- Returns:
- interface name.
- 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.
-
-