Annotation Type DocStringType


  • @Retention(RUNTIME)
    @Target(METHOD)
    @API(status=STABLE)
    public @interface DocStringType
    Register doc string type.

    The method must have this signature:

    • String -> Author
    NOTE: Author is an example of the type of the parameter type.

    Each docstring has a content type (text, json, ect) and type. The When not provided in the annotation the content type is the name of the annotated method. The type is the return type of the annotated. method.

    Cucumber selects the doc string type to convert a docstring to the target used in a step definition by:

    1. Searching for an exact match of content type and target type
    2. Searching for a unique match for target type
    3. Throw an exception of zero or more then one docstring type was found
    By default, Cucumber registers a docstring type for the anonymous content type (i.e. no content type) and type String.
    See Also:
    DocStringType
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      String contentType
      Name of the content type.
    • Element Detail

      • contentType

        String contentType
        Name of the content type.

        When not provided this will default to the name of the annotated method.

        Returns:
        content type
        Default:
        ""