Top Description Constructors Methods
com.sun.org.apache.bcel.internal.generic

public Class INVOKEDYNAMIC

extends InvokeInstruction
Class Inheritance
Imports
java.io.DataOutputStream, .IOException, com.sun.org.apache.bcel.internal.Const, .ExceptionConst, com.sun.org.apache.bcel.internal.classfile.ConstantInvokeDynamic, .ConstantNameAndType, .ConstantPool, com.sun.org.apache.bcel.internal.util.ByteSequence

Class for INVOKEDYNAMIC. Not an instance of InvokeInstruction, since that class expects to be able to get the class of the method. Ignores the bootstrap mechanism entirely.
Since
6.0
See Also
The invokedynamic instruction in The Java Virtual Machine Specification

Constructor Summary

AccessConstructor and Description
pack-priv
INVOKEDYNAMIC()

Empty constructor needed for Instruction.readInstruction.

public
INVOKEDYNAMIC(final int index)

Method Summary

Modifier and TypeMethod and Description
public void
accept(final Visitor
Visitor object
v
)

Implements abstract com.sun.org.apache.bcel.internal.generic.Instruction.accept.

Call corresponding visitor method(s).
public void
dump(final DataOutputStream
Output stream
out
)

Overrides com.sun.org.apache.bcel.internal.generic.CPInstruction.dump.

Dump instruction as byte code to stream out.
public String
getClassName(final ConstantPoolGen cpg)

Overrides com.sun.org.apache.bcel.internal.generic.InvokeInstruction.getClassName.

Deprecated
Override the parent method because our class name is held elsewhere.
public Class<?>[]
public ReferenceType

Returns:

an ObjectType for java.lang.Object
getReferenceType
(final ConstantPoolGen
the ConstantPoolGen used to create the instruction
cpg
)

Overrides com.sun.org.apache.bcel.internal.generic.FieldOrMethod.getReferenceType.

Since InvokeDynamic doesn't refer to a reference type, just return java.lang.Object, as that is the only type we can say for sure the reference will be.
protected void
initFromFile(final ByteSequence
input stream
bytes
,
final boolean
wide prefix?
wide
)

Overrides com.sun.org.apache.bcel.internal.generic.CPInstruction.initFromFile.

Read needed data (i.e., index) from file.
Inherited from com.sun.org.apache.bcel.internal.generic.InvokeInstruction:
consumeStackgetArgumentTypesgetMethodNamegetReturnTypegetTypeproduceStacktoString

Constructor Detail

INVOKEDYNAMICback to summary
pack-priv INVOKEDYNAMIC()

Empty constructor needed for Instruction.readInstruction. Not to be used otherwise.

INVOKEDYNAMICback to summary
public INVOKEDYNAMIC(final int index)

Method Detail

acceptback to summary
public void accept(final Visitor v)

Implements abstract com.sun.org.apache.bcel.internal.generic.Instruction.accept.

Call corresponding visitor method(s). The order is: Call visitor methods of implemented interfaces first, then call methods according to the class hierarchy in descending order, i.e., the most specific visitXXX() call comes last.

Parameters
v:Visitor

Visitor object

Annotations
@Override
dumpback to summary
public void dump(final DataOutputStream out) throws IOException

Overrides com.sun.org.apache.bcel.internal.generic.CPInstruction.dump.

Dump instruction as byte code to stream out.

Parameters
out:DataOutputStream

Output stream

Annotations
@Override
Exceptions
IOException:

Doc from com.sun.org.apache.bcel.internal.generic.Instruction.dump.

Thrown when an I/O exception of some sort has occurred.

getClassNameback to summary
public String getClassName(final ConstantPoolGen cpg)

Overrides com.sun.org.apache.bcel.internal.generic.InvokeInstruction.getClassName.

Deprecated

Override the parent method because our class name is held elsewhere.

Note

Contrary to this method's name it does not return the class name of the invoke target; rather it returns the name of the method that will be used to invoke the Lambda method generated by this invoke dynamic instruction.

Returns:String

Doc from com.sun.org.apache.bcel.internal.generic.InvokeInstruction.getClassName.

name of the referenced class/interface

Annotations
@Override
@Deprecated
getExceptionsback to summary
public Class<?>[] getExceptions()

Implements com.sun.org.apache.bcel.internal.generic.ExceptionThrower.getExceptions.

Annotations
@Override
getReferenceTypeback to summary
public ReferenceType getReferenceType(final ConstantPoolGen cpg)

Overrides com.sun.org.apache.bcel.internal.generic.FieldOrMethod.getReferenceType.

Since InvokeDynamic doesn't refer to a reference type, just return java.lang.Object, as that is the only type we can say for sure the reference will be.

Parameters
cpg:ConstantPoolGen

the ConstantPoolGen used to create the instruction

Returns:ReferenceType

an ObjectType for java.lang.Object

Annotations
@Override
Since
6.1
initFromFileback to summary
protected void initFromFile(final ByteSequence bytes, final boolean wide) throws IOException

Overrides com.sun.org.apache.bcel.internal.generic.CPInstruction.initFromFile.

Read needed data (i.e., index) from file.

Parameters
bytes:ByteSequence

Doc from com.sun.org.apache.bcel.internal.generic.CPInstruction.initFromFile.

input stream

wide:boolean

Doc from com.sun.org.apache.bcel.internal.generic.CPInstruction.initFromFile.

wide prefix?

Annotations
@Override
Exceptions
IOException:

Doc from com.sun.org.apache.bcel.internal.generic.Instruction.initFromFile.

may be thrown if the implementation needs to read data from the file