Annotation Type Operation


  • @Inherited
    @Target({CONSTRUCTOR,METHOD,TYPE,PACKAGE})
    @Retention(SOURCE)
    public @interface Operation

    Generates a Jeyzer analysis pattern operation entry.
    Example:

    <operation name="Process transactions" pattern="com.sample.Manager.processTransactions" priority="900" type="File" />

    Pattern entry is generated in the jeyzer_patterns.xml file located in the jeyzer directory under the target/generated-sources build directory.
    If file creation is not possible there, file will be created under the standard generated source code directory.

    Pattern operation attributes are :

    • Name. It is either provided as annotation attribute or deduced from the element name.
      For example, for a getOldVersion method, name will be set as Get old version.
      In the case of constructors, name will be set with the class name suffixed with instantiation
    • Code pattern. It is prefixed with the fully qualified package name.
      For example, if the annotation applies on the Manager class located in the com.sample package, pattern will be set as com.sample.Manager.
    • Contention type. It is optional. If specified, value must be generic recommended one. Examples : Collection, Exception, Resource pool, Synchro, File. See the Jeyzer documentation for the full list.
    • Priority. It is optional. If specified, value must be set between 101 and 1000.
    • Lowstack. It is optional and applies only to classes and packages. It is set to false by default.
      If enabled, the code pattern will be suffixed with a dot character, indicating that the pattern line will apply only on the last 2 lines of the scanned stack trace.
      For example, for a CustomList class, pattern will be set as "CustomList.".
      Low stack operations are generated at the end of the pattern operations list, meaning those have lower priority.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      String contentionType
      The operation contention type.
      boolean lowStack
      The operation low stack flag.
      String name
      The operation name.
      int priority
      The operation priority.
    • Element Detail

      • name

        String name
        The operation name. Optional
        Returns:
        the name
        Default:
        ""
      • contentionType

        String contentionType
        The operation contention type. Optional
        Returns:
        the contention type
        Default:
        ""
      • priority

        int priority
        The operation priority. Optional
        Returns:
        the priority
        Default:
        -1
      • lowStack

        boolean lowStack
        The operation low stack flag. Applies only to classes and packages. Set to false by default.
        Returns:
        true if the operation is low stack one
        Default:
        false