Annotation Type IsTag


  • @Retention(RUNTIME)
    @Target(ANNOTATION_TYPE)
    public @interface IsTag
    Marks an annotation to be used as a tag in JGiven reports. The name and a possible value will be stored. A value can be an array in which case it is either translated into multiple tags, one for each array element, or a comma-separated list of values.

    Note that the annotation must have retention policy RUNTIME

    Example

     @IsTag
     @Retention( RetentionPolicy.RUNTIME )
     public @interface Issue {
      String[] value();
     }
     
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.String color
      A color that should be used in reports for this tag.
      java.lang.String cssClass
      Sets a CSS class that should be used in the HTML report for this tag.
      java.lang.String description
      An optional description of the tag that will appear in the generated report.
      java.lang.Class<? extends TagDescriptionGenerator> descriptionGenerator
      An optional description generator that is used to dynamically generate the description depending on the concrete value of an annotation.
      boolean explodeArray
      If the annotation has a value and the value is an array, whether or not to explode that array to multiple tags or not.
      java.lang.String href
      An optional href of the tag that will appear in the generated report.
      java.lang.Class<? extends TagHrefGenerator> hrefGenerator
      An optional href generator that is used to dynamically generate the href depending on the concrete value of an annotation.
      boolean ignoreValue
      Whether values should be ignored.
      java.lang.String name
      An optional name that overrides the default which is the name of the annotation.
      boolean prependType
      Whether the type should be prepended to the tag if the tag has a value.
      boolean showInNavigation
      Whether the tag should be shown in the navigation part of the report
      java.lang.String style
      Defines an inline style that is used in the HTML report for this tag.
      java.lang.String value
      An optional default value for the tag.
    • Element Detail

      • explodeArray

        boolean explodeArray
        If the annotation has a value and the value is an array, whether or not to explode that array to multiple tags or not.

        Example

        Take the following tag annotation
           @Issue( { "#23", "#12" } )
         
        When explodeArray is set to true Then in the report there will be two tags 'Issue-#23' and 'Issue-#12' instead of one tag 'Issue-#23,#12'
        Default:
        true
      • ignoreValue

        boolean ignoreValue
        Whether values should be ignored. If true only a single tag is created for the annotation and the value does not appear in the report. This is useful if the value is used as an internal comment
        See Also:
        Pending
        Default:
        false
      • value

        java.lang.String value
        An optional default value for the tag.
        Default:
        ""
      • description

        java.lang.String description
        An optional description of the tag that will appear in the generated report.
        Default:
        ""
      • descriptionGenerator

        java.lang.Class<? extends TagDescriptionGenerator> descriptionGenerator
        An optional description generator that is used to dynamically generate the description depending on the concrete value of an annotation.

        The class that implements TagDescriptionGenerator interface must be a public non-abstract class that is not a non-static inner class and must have a public default constructor.

        If this attribute is set, the description() attribute is ignored.

        Since:
        0.7.0
        Default:
        com.tngtech.jgiven.impl.tag.DefaultTagDescriptionGenerator.class
      • name

        java.lang.String name
        An optional name that overrides the default which is the name of the annotation.

        It is possible that multiple annotations have the same type name. However, in this case every annotation must have a specified value that must be unique.

        Since:
        0.7.4
        Default:
        ""
      • prependType

        boolean prependType
        Whether the type should be prepended to the tag if the tag has a value.
        Default:
        false
      • cssClass

        java.lang.String cssClass
        Sets a CSS class that should be used in the HTML report for this tag.

        The default CSS class is 'tag-<name>' where <name> is the type of the tag

        Non-HTML reports ignore this attribute

        Since:
        0.7.2
        Default:
        ""
      • color

        java.lang.String color
        A color that should be used in reports for this tag.

        It depends on the type of the report whether and how this value is interpreted. HTML reports take this value as the background color for the tag.

        Example values for the HTML report are 'red', '#ff0000', 'rgba(100,0,0,0.5)'

        This attribute is for simple use cases. For advanced styling options use the cssClass() or style() attributes instead.

        Since:
        0.7.2
        Default:
        ""
      • style

        java.lang.String style
        Defines an inline style that is used in the HTML report for this tag.

        This is an alternative to the cssClass() attribute.

        For example, to given the tag a white color and a red background-color you could write: style = "background-color: red; color: white;"

        Non-HTML reports ignore this attribute

        Since:
        0.8.0
        Default:
        ""
      • href

        java.lang.String href
        An optional href of the tag that will appear in the generated report.
        Since:
        0.9.5
        Default:
        ""
      • hrefGenerator

        java.lang.Class<? extends TagHrefGenerator> hrefGenerator
        An optional href generator that is used to dynamically generate the href depending on the concrete value of an annotation.

        The class that implements TagHrefGenerator interface must be a public non-abstract class that is not a non-static inner class and must have a public default constructor.

        If this attribute is set, the href() attribute is ignored.

        Since:
        0.9.5
        Default:
        com.tngtech.jgiven.impl.tag.DefaultTagHrefGenerator.class
      • showInNavigation

        boolean showInNavigation
        Whether the tag should be shown in the navigation part of the report
        Since:
        0.12.0
        Default:
        true