Package org.apache.bcel.generic
Class NEW
java.lang.Object
org.apache.bcel.generic.Instruction
org.apache.bcel.generic.CPInstruction
org.apache.bcel.generic.NEW
- All Implemented Interfaces:
Cloneable,AllocationInstruction,ExceptionThrower,IndexedInstruction,LoadClass,StackProducer,TypedInstruction
public class NEW
extends CPInstruction
implements LoadClass, AllocationInstruction, ExceptionThrower, StackProducer
NEW - Create new object
Stack: ... -> ..., objectref
-
Field Summary
Fields inherited from class org.apache.bcel.generic.CPInstruction
indexFields inherited from class org.apache.bcel.generic.Instruction
length, opcode -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCall corresponding visitor method(s).Class<?>[]Gets the exceptions that may be thrown by this instruction.Returns theObjectTypeof the referenced class or interface that may be loaded and resolved.Methods inherited from class org.apache.bcel.generic.CPInstruction
dump, getIndex, getType, initFromFile, setIndex, toString, toStringMethods inherited from class org.apache.bcel.generic.Instruction
consumeStack, copy, equals, getComparator, getLength, getName, getOpcode, hashCode, isValidByte, isValidShort, produceStack, readInstruction, setComparator, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.bcel.generic.StackProducer
produceStack
-
Constructor Details
-
NEW
Constructs a NEW instruction.- Parameters:
index- index into constant pool.
-
-
Method Details
-
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, that is, the most specific visitXXX() call comes last.- Specified by:
acceptin classInstruction- Parameters:
v- Visitor object.
-
getExceptions
Description copied from interface:ExceptionThrowerGets the exceptions that may be thrown by this instruction.- Specified by:
getExceptionsin interfaceExceptionThrower- Returns:
- The exceptions that may be thrown by this instruction.
-
getLoadClassType
Description copied from interface:LoadClassReturns theObjectTypeof the referenced class or interface that may be loaded and resolved.- Specified by:
getLoadClassTypein interfaceLoadClass- Parameters:
cpg- A ConstantPoolGen.- Returns:
- object type that may be loaded or null if a primitive is referenced.
-