Class DuringScope

  • All Implemented Interfaces:
    Scope

    public final class DuringScope
    extends Object
    implements Scope
    Scope limited to events during execution of specific methods.
    • Constructor Detail

      • DuringScope

        public DuringScope​(String methodPattern,
                           boolean isClinit,
                           ClassScope classFilter)
        Creates a during scope.
        Parameters:
        methodPattern - the method name pattern events must occur in
        isClinit - whether the scope targets static initializers
        classFilter - optional class filter, may be null
    • Method Detail

      • methodPattern

        public String methodPattern()
        Returns:
        the method name pattern
      • isClinit

        public boolean isClinit()
        Returns:
        whether the scope targets static initializers
      • classFilter

        public ClassScope classFilter()
        Returns:
        the class filter, or null when unrestricted
      • clinitOf

        public static DuringScope clinitOf​(ClassScope classFilter)
        Creates a scope covering static initializers of the filtered classes.
        Parameters:
        classFilter - the classes whose clinit methods are in scope
        Returns:
        the clinit scope
      • method

        public static DuringScope method​(String methodPattern)
        Creates a scope covering methods matching a pattern, with no class filter.
        Parameters:
        methodPattern - the method name pattern
        Returns:
        the method scope
      • accept

        public <T> T accept​(ScopeVisitor<T> visitor)
        Description copied from interface: Scope
        Dispatches to the visitor hook for this scope variant.
        Specified by:
        accept in interface Scope
        Type Parameters:
        T - the visitor's result type
        Parameters:
        visitor - the visitor to dispatch to
        Returns:
        whatever the visitor returns for this variant
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object