Package com.tngtech.jgiven.annotation
Interface TagDescriptionGenerator
-
public interface TagDescriptionGenerator
Is used as an attribute of theIsTag
annotation to dynamically generate a description for an annotation depending on its value.Implementations of this interface must be a public non-abstract class that is not a non-static inner class and must have a public default constructor.
- Since:
- 0.6.3
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
generateDescription(TagConfiguration tagConfiguration, java.lang.annotation.Annotation annotation, java.lang.Object value)
Implement this method to generate the description for the given annotation and its value.
-
-
-
Method Detail
-
generateDescription
java.lang.String generateDescription(TagConfiguration tagConfiguration, java.lang.annotation.Annotation annotation, java.lang.Object value)
Implement this method to generate the description for the given annotation and its value.Note that when the value of the annotation is an array and
IsTag.explodeArray()
istrue
, then this method is called for each value of the array and not once for the whole array. Otherwise it is called only once.- Parameters:
tagConfiguration
- the configuration of the tag. The values typically correspond to theannotation
. However, it is also possible to configure annotations to be tags usingJGivenConfiguration
, in which case there is noIsTag
annotation.annotation
- the actual annotation that was used as a tag. Note that this can benull
in the case of dynamically added tags.value
- the value of the annotation. If the annotation has no value the default value is passed (IsTag.value()
- Returns:
- the description of the annotation for the given value
-
-