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 for Activity @Extra and @FragmentArg to thier builder #1525

Description

@dodgex

if it is possible to read javadoc comments from processed elements/fields it would be nice to copy the javadoc for Activity @Extra and @FragmentArg to the related builder. that allows to have a documented "api".

e.g.

/**
 * [any javadoc]
 */
@Extra("MY_EXTRA_KEY")
protected String myExtra;

->

/**
 * [any javadoc]
 */
public MyActivity_.IntentBuilder_ myExtra(long myExtra) {
    return super.extra(MY_EXTRA, myExtra);
}

dependeing on the possibilities of the code generation extend the javadoc to be valid:

/**
 * [any javadoc]
 *
 * @param myExtra The value to set
 * @return The IntentBuilder to chain calls
 */

thoughts?

Activity

  1. dodgex commented on Aug 19, 2015

    @dodgex
    MemberAuthor

    maybe even generate the javadoc all the time, but add the text from the field ?

    /**
     * [optional: copy field javadoc]
     *
     * Intent/Extra Key: "MY_EXTRA_KEY".
     * 
     * @param myExtra The value to set
     * @return The IntentBuilder to chain calls
     */
  2. yDelouis commented on Aug 19, 2015

    @yDelouis
    Contributor

    Shall we count on you to submit a PR as soon as the project is not frozen due to the plugin refacto any more ?

  3. dodgex commented on Aug 19, 2015

    @dodgex
    MemberAuthor

    If this enhancement is welcome i'll try to get a PR up. Any eta on the plugin refactoring?

  4. yDelouis commented on Aug 19, 2015

    @yDelouis
    Contributor

    It's hard to give an ETA for the plugin refacto but I think we are close to the end. All it remains, I think, is to define the API for plugins.

  5. dodgex commented on Aug 19, 2015

    @dodgex
    MemberAuthor

    Okay, so I still got some time for this PR. ;)

  6. WonderCsabo commented on Aug 19, 2015

    @WonderCsabo
    Member
  7. dodgex commented on Aug 19, 2015

    @dodgex
    MemberAuthor

    @WonderCsabo it passes.

    String comment = processingEnv.getElementUtils().getDocComment(element);
  8. dodgex commented on Aug 19, 2015

    @dodgex
    MemberAuthor

    is there another annotation beside @Extra and @FragementArg that creates a method for a builder?

  9. WonderCsabo commented on Aug 22, 2015

    @WonderCsabo
    Member
  10. dodgex commented on Aug 23, 2015

    @dodgex
    MemberAuthor

    @ServiceAction uses the same code to generate the methods as @Extra so there is the javadoc with the @param and @return already. only having additional custom javadoc text is not possible there as the setter methods are generated by parameters

  11. WonderCsabo commented on Sep 1, 2015

    @WonderCsabo
    Member

    Great, thanks for looking into this!

  12. WonderCsabo commented on Sep 15, 2015

    @WonderCsabo
    Member

    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