Class InnerClassAccessMap.InstructionCallback

    • Constructor Summary

      Constructors 
      Constructor Description
      InstructionCallback​(org.apache.bcel.classfile.JavaClass javaClass, java.lang.String methodName, java.lang.String methodSig, byte[] instructionList)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      InnerClassAccess getAccess()
      Get the InnerClassAccess object representing the method.
      void handleInstruction​(int opcode, int index)
      Called to indicate that a particular bytecode has been scanned.
      private boolean isValidAccessMethod​(java.lang.String methodSig, XField field, boolean isLoad)
      Determine if the method appears to be an accessor of the expected form.
      private void setField​(int cpIndex, boolean isStatic, boolean isLoad)
      Called to indicate that a field load or store was encountered.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • javaClass

        private final org.apache.bcel.classfile.JavaClass javaClass
      • methodName

        private final java.lang.String methodName
      • methodSig

        private final java.lang.String methodSig
      • instructionList

        private final byte[] instructionList
      • accessCount

        private int accessCount
    • Constructor Detail

      • InstructionCallback

        public InstructionCallback​(org.apache.bcel.classfile.JavaClass javaClass,
                                   java.lang.String methodName,
                                   java.lang.String methodSig,
                                   byte[] instructionList)
        Constructor.
        Parameters:
        javaClass - the class containing the access method
        methodName - the name of the access method
        methodSig - the signature of the access method
        instructionList - the bytecode of the method
    • Method Detail

      • handleInstruction

        public void handleInstruction​(int opcode,
                                      int index)
        Description copied from interface: BytecodeScanner.Callback
        Called to indicate that a particular bytecode has been scanned.
        Specified by:
        handleInstruction in interface BytecodeScanner.Callback
        Parameters:
        opcode - the opcode of the instruction
        index - the bytecode offset of the instruction
      • getAccess

        public InnerClassAccess getAccess()
        Get the InnerClassAccess object representing the method.
        Returns:
        the InnerClassAccess, or null if the method was not found to be a simple load or store in the expected form
      • setField

        private void setField​(int cpIndex,
                              boolean isStatic,
                              boolean isLoad)
        Called to indicate that a field load or store was encountered.
        Parameters:
        cpIndex - the constant pool index of the fieldref
        isStatic - true if it is a static field access
        isLoad - true if the access is a load
      • isValidAccessMethod

        private boolean isValidAccessMethod​(java.lang.String methodSig,
                                            XField field,
                                            boolean isLoad)
        Determine if the method appears to be an accessor of the expected form. This has only been tested with the Sun JDK 1.4 javac (definitely) and jikes 1.18 (I think).
        Parameters:
        methodSig - the method's signature
        field - the field accessed by the method
        isLoad - true if the access is a load