Annotation Interface IsTag
Note that the annotation must have retention policy RUNTIME
Example
@IsTag @Retention( RetentionPolicy.RUNTIME ) public @interface Issue { String[] value(); }
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionA color that should be used in reports for this tag.Sets a CSS class that should be used in the HTML report for this tag.An optional description of the tag that will appear in the generated report.Class<? extends TagDescriptionGenerator>
An optional description generator that is used to dynamically generate the description depending on the concrete value of an annotation.boolean
If the annotation has a value and the value is an array, whether or not to explode that array to multiple tags or not.An optional href of the tag that will appear in the generated report.Class<? extends TagHrefGenerator>
An optional href generator that is used to dynamically generate the href depending on the concrete value of an annotation.boolean
Whether values should be ignored.An optional name that overrides the default which is the name of the annotation.boolean
Whether the type should be prepended to the tag if the tag has a value.boolean
Whether the tag should be shown in the navigation part of the reportDefines an inline style that is used in the HTML report for this tag.An optional default value for the tag.
-
Element Details
-
explodeArray
boolean explodeArrayIf 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" } )
WhenexplodeArray
is set totrue
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 ignoreValueWhether 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:
- Default:
- false
-
value
String valueAn optional default value for the tag.- Default:
- ""
-
description
String descriptionAn optional description of the tag that will appear in the generated report.- Default:
- ""
-
descriptionGenerator
Class<? extends TagDescriptionGenerator> descriptionGeneratorAn 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
String nameAn 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 prependTypeWhether the type should be prepended to the tag if the tag has a value.- Default:
- false
-
cssClass
String cssClassSets 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 tagNon-HTML reports ignore this attribute
- Since:
- 0.7.2
- Default:
- ""
-
color
String colorA 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()
orstyle()
attributes instead.- Since:
- 0.7.2
- Default:
- ""
-
style
String styleDefines an inline style that is used in the HTML report for this tag.This is an alternative to the
For example, to given the tag a white color and a red background-color you could write:cssClass()
attribute.style = "background-color: red; color: white;"
Non-HTML reports ignore this attribute
- Since:
- 0.8.0
- Default:
- ""
-
href
String hrefAn optional href of the tag that will appear in the generated report.- Since:
- 0.9.5
- Default:
- ""
-
hrefGenerator
Class<? extends TagHrefGenerator> hrefGeneratorAn 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
-