Skip to content
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
This repository was archived by the owner on Feb 26, 2023. It is now read-only.

Copy JavaDoc to @SharedPref class and @DefaultXXX methods #1551

Description

@WonderCsabo

We do not override @DefaultXXX annotated methods, but generate a totally new class with new methods. This is why JavaDoc on the original methods cannot be inherited, and needed to be copied to the generated methods.

Activity

  1. WonderCsabo commented on Sep 15, 2015

    @WonderCsabo
    MemberAuthor

    I assign this issue to @dodgex .

  2. dodgex commented on Sep 17, 2015

    @dodgex
    Member

    how to handle the user provided @return ?

    e.g.

        /**
         * The Age!
         *
         * @return the age as int
         */
        @DefaultInt(42)
        int age();

    generates:

        /**
         * The Age!
         * 
         *  @return the age as int
         */
        public IntPrefField age() {
            return intField("age", 42);
        }

    what is actually not correct.

    also i'd like to add something like * Defaults to: 42 but that should be above the @return and other tags

  3. dodgex commented on Sep 17, 2015

    @dodgex
    Member

    i think we should just copy the javadoc and ignore the default value. or we have to add the default value to the top of the javadoc

  4. dodgex commented on Sep 17, 2015

    @dodgex
    Member

    in my current implementation i add <p><b>Defaults to</b>: 42</p> before the given javadoc comment

  5. WonderCsabo commented on Sep 17, 2015

    @WonderCsabo
    MemberAuthor

    I think:

      /**
         * The Age!
         * 
         *  @return The PrefField object for chaining calls to work with the preference
         */
        public IntPrefField age() {

    And for the editor methods:

    @return The PrefEditorField object for chaining calls to edit the preference

    Otherwise i think your proposal is OK, @dodgex .

  6. dodgex commented on Sep 17, 2015

    @dodgex
    Member

    the problem is, that depending on compiler/ide configuration the javadoc on the interface has to be valid -> requires @return

    we would need to remove/replace the @return if we want to add that message on the age()

  7. WonderCsabo commented on Sep 17, 2015

    @WonderCsabo
    MemberAuthor

    You are right. Then stick with your proposal.

  8. WonderCsabo commented on Sep 17, 2015

    @WonderCsabo
    MemberAuthor

    I think we should copy the javadoc to the editor methods as well.

  9. dodgex commented on Sep 17, 2015

    @dodgex
    Member

    oh. i did not realize that there are more methods. :/ i'll add them.

  10. dodgex commented on Sep 17, 2015

    @dodgex
    Member

    i updated the PR btw :)

  11. WonderCsabo commented on Sep 18, 2015

    @WonderCsabo
    MemberAuthor

    Implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions