com.tngtech.jgiven.annotation
Annotation Type IsTag


@Retention(value=RUNTIME)
@Target(value=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
 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 HTML reports 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.
 boolean ignoreValue
          Whether values should be ignored.
 boolean prependType
          Whether the type should be prepended to the tag if the tag has a value.
 java.lang.String type
          An optional type description that overrides the default which is the name of the annotation.
 java.lang.String value
          An optional default value for the tag.
 

explodeArray

public abstract 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

public abstract 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:
NotImplementedYet
Default:
false

value

public abstract java.lang.String value
An optional default value for the tag.

Default:
""

description

public abstract java.lang.String description
An optional description of the tag that will appear in the generated report.

Default:
""

descriptionGenerator

public abstract 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.annotation.DefaultTagDescriptionGenerator.class

type

public abstract java.lang.String type
An optional type description that overrides the default which is the name of the annotation.

Default:
""

prependType

public abstract boolean prependType
Whether the type should be prepended to the tag if the tag has a value.

Default:
false

cssClass

public abstract java.lang.String cssClass
Sets a CSS class that should be used in HTML reports 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

public abstract 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() attribute instead.

Since:
0.7.2
Default:
""