1 17 package org.apache.bcel.generic; 18 19 import org.apache.bcel.Constants; 20 import org.apache.bcel.ExceptionConstants; 21 22 31 public class GETSTATIC extends FieldInstruction implements PushInstruction, ExceptionThrower { 32 33 37 GETSTATIC() { 38 } 39 40 41 public GETSTATIC(int index) { 42 super(Constants.GETSTATIC, index); 43 } 44 45 46 public int produceStack( ConstantPoolGen cpg ) { 47 return getFieldSize(cpg); 48 } 49 50 51 public Class [] getExceptions() { 52 Class [] cs = new Class [1 + ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length]; 53 System.arraycopy(ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION, 0, cs, 0, 54 ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length); 55 cs[ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length] = ExceptionConstants.INCOMPATIBLE_CLASS_CHANGE_ERROR; 56 return cs; 57 } 58 59 60 68 public void accept( Visitor v ) { 69 v.visitStackProducer(this); 70 v.visitPushInstruction(this); 71 v.visitExceptionThrower(this); 72 v.visitTypedInstruction(this); 73 v.visitLoadClass(this); 74 v.visitCPInstruction(this); 75 v.visitFieldOrMethod(this); 76 v.visitFieldInstruction(this); 77 v.visitGETSTATIC(this); 78 } 79 } 80 | Popular Tags |