1 package com.sun.org.apache.bcel.internal.generic; 2 3 56 57 64 public class INSTANCEOF extends CPInstruction 65 implements LoadClass, ExceptionThrower, StackProducer, StackConsumer { 66 70 INSTANCEOF() {} 71 72 public INSTANCEOF(int index) { 73 super(com.sun.org.apache.bcel.internal.Constants.INSTANCEOF, index); 74 } 75 76 public Class [] getExceptions() { 77 return com.sun.org.apache.bcel.internal.ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION; 78 } 79 80 public ObjectType getLoadClassType(ConstantPoolGen cpg) { 81 Type t = getType(cpg); 82 83 if(t instanceof ArrayType) 84 t = ((ArrayType) t).getBasicType(); 85 86 return (t instanceof ObjectType)? (ObjectType) t : null; 87 } 88 89 97 public void accept(Visitor v) { 98 v.visitLoadClass(this); 99 v.visitExceptionThrower(this); 100 v.visitStackProducer(this); 101 v.visitStackConsumer(this); 102 v.visitTypedInstruction(this); 103 v.visitCPInstruction(this); 104 v.visitINSTANCEOF(this); 105 } 106 } 107 | Popular Tags |