OSDN Git Service

Auto-generate docs based on annotations.
authorJeff Sharkey <jsharkey@android.com>
Thu, 20 Apr 2017 05:24:18 +0000 (23:24 -0600)
committerJeff Sharkey <jsharkey@android.com>
Thu, 20 Apr 2017 23:21:41 +0000 (17:21 -0600)
commit6503bd8e33dbf6e8357256d43c6e1158e32a0268
tree5d07a07cb8251b6a0653edea4a61b084a95e584d
parent4132f860419584bf4aefa7b6a3a708b25643675b
Auto-generate docs based on annotations.

We have a handful of annotations that we've been sprinkling across
the platform APIs, such as @Nullable, @NonNull, @IntDef, etc.  It
would be really helpful to surface these contracts to developers
through the SDK docs.

This change allows annotations like those mentioned above to declare
the following new javadoc fields:

@memberDoc: docs to append to a field or method definition.
@paramDoc: docs to append to a @param definition.
@returnDoc: docs to append to a @return definition.

This change also builds a docstring to describe the list of all
constants listed in an @IntDef annotation.  Sadly AnnotationDesc
only passes along raw constant values, so we need the help of the
new "prefix" annotation argument to help find the field names.

Test: builds
Bug: 37526420
Change-Id: I4cfc00dd904e5dfa945b406d546e36846b7c0c28
16 files changed:
core/java/android/annotation/BytesLong.java [new file with mode: 0644]
core/java/android/annotation/CurrentTimeMillisLong.java [new file with mode: 0644]
core/java/android/annotation/DurationMillisLong.java [new file with mode: 0644]
core/java/android/annotation/ElapsedRealtimeLong.java [new file with mode: 0644]
core/java/android/annotation/IntDef.java
core/java/android/annotation/MainThread.java
core/java/android/annotation/NonNull.java
core/java/android/annotation/Nullable.java
core/java/android/annotation/SuppressAutoDoc.java [new file with mode: 0644]
core/java/android/annotation/WorkerThread.java
core/java/android/app/Activity.java
core/java/android/app/NotificationChannel.java
core/java/android/app/NotificationManager.java
core/java/android/app/Service.java
core/java/android/content/Context.java
core/java/android/content/Intent.java