Annotation Type AnnotationPattern


  • @Target(ANNOTATION_TYPE)
    @Retention(CLASS)
    public @interface AnnotationPattern
    A pattern structure for matching annotations.

    If no properties are set, the default pattern matches any annotation with a runtime retention policy.

    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.Class<?> constant
      Define the annotation-name pattern by reference to a Class constant.
      java.lang.String name
      Define the annotation-name pattern by fully qualified class name.
      ClassNamePattern namePattern
      Define the annotation-name pattern by reference to a class-name pattern.
      java.lang.annotation.RetentionPolicy[] retention
      Specify which retention policies must be set for the annotations.
    • Element Detail

      • name

        java.lang.String name
        Define the annotation-name pattern by fully qualified class name.

        Mutually exclusive with the following other properties defining annotation-name:

        • constant
        • namePattern

        If none are specified the default is to match any annotation name.

        Returns:
        The qualified class name that defines the annotation.
        Default:
        ""
      • constant

        java.lang.Class<?> constant
        Define the annotation-name pattern by reference to a Class constant.

        Mutually exclusive with the following other properties defining annotation-name:

        • name
        • namePattern

        If none are specified the default is to match any annotation name.

        Returns:
        The Class constant that defines the annotation.
        Default:
        java.lang.Object.class
      • namePattern

        ClassNamePattern namePattern
        Define the annotation-name pattern by reference to a class-name pattern.

        Mutually exclusive with the following other properties defining annotation-name:

        • name
        • constant

        If none are specified the default is to match any annotation name.

        Returns:
        The class-name pattern that defines the annotation.
        Default:
        @com.android.tools.r8.keepanno.annotations.ClassNamePattern(unqualifiedName="")
      • retention

        java.lang.annotation.RetentionPolicy[] retention
        Specify which retention policies must be set for the annotations.

        Matches annotations with matching retention policies

        Returns:
        Retention policies. By default RetentionPolicy.RUNTIME.
        Default:
        {java.lang.annotation.RetentionPolicy.RUNTIME}