Class Location.VariableAccessLocation

  • Enclosing class:
    Location

    private static class Location.VariableAccessLocation
    extends Location.AccessLocation
    location identifying a variable access trigger point
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean isIndex
      flag which is true if the name is a method parameter index such as $0, $1 etc otherwise false
      private java.lang.String variableName
      the name of the variable being accessed at the point where the trigger point should be inserted
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected VariableAccessLocation​(java.lang.String variablename, int count, int flags, boolean whenComplete)
      construct a location identifying a variable read trigger point
    • Field Detail

      • variableName

        private java.lang.String variableName
        the name of the variable being accessed at the point where the trigger point should be inserted
      • isIndex

        private boolean isIndex
        flag which is true if the name is a method parameter index such as $0, $1 etc otherwise false
    • Constructor Detail

      • VariableAccessLocation

        protected VariableAccessLocation​(java.lang.String variablename,
                                         int count,
                                         int flags,
                                         boolean whenComplete)
        construct a location identifying a variable read trigger point
        Parameters:
        variablename - the name of the variable being read
        count - count identifying which access should be taken as the trigger point
        flags - bit field comprising one or other of flags ACCESS_READ and ACCESS_WRITE identifying whether this specifies field READ or WRITE operations
        whenComplete - false if the trigger should be inserted before the access is performed and true if it should be inserted after
    • Method Detail

      • getRuleCheckAdapter

        public RuleCheckAdapter getRuleCheckAdapter​(org.objectweb.asm.ClassVisitor cv,
                                                    TransformContext transformContext)
        return an adapter which can be used to check whether a method contains a trigger point whose position matches this location
        Specified by:
        getRuleCheckAdapter in class Location
        Parameters:
        cv - the current class visitor
        transformContext - the current transform context
        Returns:
        the required adapter
      • getRuleAdapter

        public RuleTriggerAdapter getRuleAdapter​(org.objectweb.asm.ClassVisitor cv,
                                                 TransformContext transformContext)
        return an adapter which can be used to insert a trigger call in a method containing a trigger point whose position matches this location
        Specified by:
        getRuleAdapter in class Location
        Parameters:
        cv - the current class visitor
        transformContext - the current transform context
        Returns:
        the required adapter
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object