Annotation Type MethodSpec


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

      Required Elements 
      Modifier and Type Required Element Description
      java.lang.String className
      The fully qualified class name of the method.
      java.lang.String methodName
      The name of the method.
      java.lang.String[] parameterTypes
      The array of all parameter types that the method declares.
      java.lang.String returnType
      The return type that the method declares.
    • Optional Element Summary

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

      • className

        java.lang.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

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

        java.lang.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

        java.lang.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