Annotation Interface MethodSpec


public @interface MethodSpec
Specification of the intercepted method.
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The fully qualified class name of the method.
    The name of the method.
    The array of all parameter types that the method declares.
    The return type that the method declares.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    If false, only the method contained in className() will be instrumented.
  • Element Details

    • className

      String className
      The fully qualified class name of the method. Can be an empty string if you would like to instrument all methods with the given name and signature. Packages are separated with dots, inner classes with '$'.
      Returns:
      the class name
    • methodName

      String methodName
      The name of the method. If you would like to instrument a constructor, use <init>.
      Returns:
      the method name
    • parameterTypes

      String[] parameterTypes
      The array of all parameter types that the method declares. The types must be fully qualified. Packages are separated with dots, inner classes with '$'. Arrays are specified with a trailing '[]'.
      Returns:
      the array of the declared types of all parameters
    • returnType

      String returnType
      The return type that the method declares. The type must be fully qualified. Packages are separated with dots, inner classes with '$'. Arrays are specified with a trailing '[]'.
      Returns:
      the return type
    • subtypes

      boolean subtypes
      If false, only the method contained in className() will be instrumented. If true, the matching methods in className() and all its subtypes will be instrumented.
      Returns:
      if methods from subtypes should be instrumented, too
      Default:
      false