Package org.mapstruct

Annotation Type Javadoc


  • @Target(TYPE)
    @Retention(SOURCE)
    public @interface Javadoc
    Allows the definition of Javadoc comments in the MapStruct Mapper generated class.

    The annotation provides support for the usual Javadoc comments elements by defining analogous attributes.

    Please, note that at least one of these attributes must be specified.

    For instance, the following definition;

    
     @Javadoc(
         value = "This is the description",
         authors = { "author1", "author2" },
         deprecated = "Use {@link OtherMapper} instead",
         since = "0.1"
     )
     

    will generate:

    
     /**
     * This is the description
     *
     * @author author1
     * @author author2
     *
     * @deprecated Use {@link OtherMapper} instead
     * @since 0.1
     */
     

    The entire Javadoc comment block can be passed directly:

    
     @Javadoc("This is the description\n"
                + "\n"
                + "@author author1\n"
                + "@author author2\n"
                + "\n"
                + "@deprecated Use {@link OtherMapper} instead\n"
                + "@since 0.1\n"
     )
     
    
     // or using Text Blocks
     @Javadoc(
         """
         This is the description
    
         @author author1
         @author author2
    
         @deprecated Use {@link OtherMapper} instead
         @since 0.1
         """
     )
     
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      String[] authors
      List of authors of the code that it is being documented.
      String deprecated
      Specifies that the functionality that is being documented is deprecated.
      String since
      Specifies the version since the functionality that is being documented is available.
      String value
      Main Javadoc comment text block.
    • Element Detail

      • value

        String value
        Main Javadoc comment text block.
        Returns:
        Main Javadoc comment text block.
        Default:
        ""
      • authors

        String[] authors
        List of authors of the code that it is being documented.

        It will generate a list of the Javadoc tool comment element @author with the different values and in the order provided.

        Returns:
        array of javadoc authors.
        Default:
        {}
      • deprecated

        String deprecated
        Specifies that the functionality that is being documented is deprecated.

        Corresponds to the @deprecated Javadoc tool comment element.

        Returns:
        Deprecation message about the documented functionality
        Default:
        ""
      • since

        String since
        Specifies the version since the functionality that is being documented is available.

        Corresponds to the @since Javadoc tool comment element.

        Returns:
        Version since the functionality is available
        Default:
        ""