Top Description Fields Constructors Methods
org.apache.bcel.generic

public Class CHECKCAST

extends CPInstruction
implements LoadClass, ExceptionThrower, StackProducer, StackConsumer
Class Inheritance
All Implemented Interfaces
org.apache.bcel.generic.StackConsumer, org.apache.bcel.generic.StackProducer, org.apache.bcel.generic.ExceptionThrower, org.apache.bcel.generic.LoadClass
Imports
org.apache.bcel.ExceptionConst

CHECKCAST - Check whether object is of given type
Stack: ..., objectref -> ..., objectref

Field Summary

Inherited from org.apache.bcel.generic.CPInstruction:
index

Constructor Summary

AccessConstructor and Description
pack-priv
CHECKCAST()

Empty constructor needed for Instruction.readInstruction.

public
CHECKCAST(final int
index to class in constant pool
index
)

Check whether object is of given type

Method Summary

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

Implements abstract org.apache.bcel.generic.Instruction.accept.

Call corresponding visitor method(s).
public Class<?>[]

Returns:

exceptions this instruction may cause
getExceptions
()

Implements org.apache.bcel.generic.ExceptionThrower.getExceptions.

public ObjectType
getLoadClassType(final ConstantPoolGen
A ConstantPoolGen
cpg
)

Implements org.apache.bcel.generic.LoadClass.getLoadClassType.

Returns the ObjectType of the referenced class or interface that may be loaded and resolved.
Inherited from org.apache.bcel.generic.CPInstruction:
dumpgetIndexgetTypeinitFromFilesetIndextoStringtoString

Constructor Detail

CHECKCASTback to summary
pack-priv CHECKCAST()

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

CHECKCASTback to summary
public CHECKCAST(final int index)

Check whether object is of given type

Parameters
index:int

index to class in constant pool

Method Detail

acceptback to summary
public void accept(final Visitor v)

Implements abstract org.apache.bcel.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
getExceptionsback to summary
public Class<?>[] getExceptions()

Implements org.apache.bcel.generic.ExceptionThrower.getExceptions.

Returns:Class<?>[]

exceptions this instruction may cause

Annotations
@Override
getLoadClassTypeback to summary
public ObjectType getLoadClassType(final ConstantPoolGen cpg)

Implements org.apache.bcel.generic.LoadClass.getLoadClassType.

Doc from org.apache.bcel.generic.LoadClass.getLoadClassType.

Returns the ObjectType of the referenced class or interface that may be loaded and resolved.

Parameters
cpg:ConstantPoolGen

A ConstantPoolGen

Returns:ObjectType

object type that may be loaded or null if a primitive is referenced

Annotations
@Override