javadoc

Gradle, Javadoc and Android documentation

蹲街弑〆低调 提交于 2019-12-18 10:56:39
问题 I'm now using Gradle for all my projects, and even for javadoc generation. android.libraryVariants.all { variant -> task("generate${variant.name}Javadoc", type: Javadoc) { title = "$name $version API" source = variant.javaCompile.source ext.androidJar = "${android.plugin.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar" ext.googlePlayServicesJar = "${android.plugin.sdkDirectory}/extras/google/google_play_services/libproject/google-play-services_lib/libs/google-play-services

How to install javadoc for Android Compatibility Package?

流过昼夜 提交于 2019-12-18 10:46:07
问题 How to generate custom javadoc for android 1.4 compatibility package? The reference docs are available online (example), but is there some place where I can get a zip with javadoc available offline? I suppose using the javadoc would be pretty simple, just a matter of setting the javadoc location for the compatibility jar. 回答1: You can generate your javadoc offline on your own from the source code. Just navigate to your android sdk directory then do the following cd <path_to_android_sdk>

Change Author template in Android Studio

血红的双手。 提交于 2019-12-18 09:56:26
问题 I want to change the automatic author that appears when I create a file in AndroidStudio. /** * Created by a556520 on 16/01/14. */ public class POI { The author takes 'a556520' but I want that appears my name, and not the number of employee. Is that possible? I didn't find in the settings. 回答1: You can overwrite the ${USER} variable in the template file with the #set( $VARIABLE = "value") function. Go to Settings -> Editor -> File and Code Templates -> Includes -> File Header prepend the #set

Javadoc link to src/main/resource or src/test/resource file using relative path

馋奶兔 提交于 2019-12-18 04:39:08
问题 I would find it extremely useful if there was a way to put a link in javadoc to a standard resource file that resides in src/main/resources or src/test/resources so that another coder could quickly navigate to the resource file (in this case a JSON file). These files are used in unit tests and need to be modified often as the schema changes. The answer here Link to text file (resource) in Javadoc does not help as an absolute path would be too fragile. Is there a way to do the same thing as

Is there any disadvantage to putting API code into a JAR along with the classes?

混江龙づ霸主 提交于 2019-12-18 04:09:34
问题 In Java if you package the source code ( .java) files into the jar along with classes ( .class) most IDE's like eclipse will show the javadoc comments for code completion. IIRC there are few open-source projects that do this like JMock. Lets say I have cleanly separated my API code from implementation code so that I have something like myproject-api.jar and myproject-impl.jar is there any reason why I should not put the source code in my myproject-api.jar ? Because of Performance? Size? Why

Javadoc displaying value on an inner class constant using @value

青春壹個敷衍的年華 提交于 2019-12-18 03:49:21
问题 I have an inner class which declares a constant and want to display its value in Javadoc of the enclosing top-level class using the @value annotation. For example: /** * {@value #FOO_CONS} // this displays well * {@value #BAR_CONS} // this does not work (checked in the latest Eclipse) * {@value Bar#BAR_CONS} // this does not work, either */ public Foo { public static final int FOO_CONS = 1; static class Bar { public static final int BAR_CONS = 42; } } Any ideas how to display the value of BAR

Javadoc linking to a class in another package

无人久伴 提交于 2019-12-18 01:19:11
问题 I have two packages, Shapes and Fruits : com.myproject.Shapes. Circle Square Triangle com.myproject.Fruits. Apple Orange I am writing the JavaDoc for Apple and need to provide an {@link} to Square . I have tried all of the following, and none of them work: {@link Square} {@link com.myproject.Square} I've been able to find documentation for linking to: (a) classes within the same package, or (b) externals URLs, but not classes in another package. Any ideas what the correct syntax should be?

javadoc: @version and @since

只愿长相守 提交于 2019-12-17 22:13:33
问题 Is there a reason to include both @version and @since as part of a class? They seem to be mutually exclusive. Also, what does %I% and %G% mean, and how to set/use them? @version %I%, %G% Thanks 回答1: The @version tag should be the current version of the release or file in question. The %I% , %G% syntax are macros that the source control software would replace with the current version of the file and the date when the file is checked out. The @since tag should be used to define which version

Usage of @see in JavaDoc?

為{幸葍}努か 提交于 2019-12-17 17:55:20
问题 When do I use @see when dealing with JavaDocs? What is its usage? For example if MethodA calls MethodB then do I have to put @see in MethodB 's javadoc and reference MethodA because that is what called it, or do I have to put a reference to MethodB from MethodA because it's calling it. I've read the stuff about @see on the Oracle website and it seems to me to be incredibly vague, it says it means "see also" but not really what that means! 回答1: Yeah, it is quite vague. You should use it

Why am I getting a ClassCastException when generating javadocs?

半腔热情 提交于 2019-12-17 17:53:45
问题 I'm using ant to generate javadocs, but get this exception over and over - why? I'm using JDK version 1.6.0_06 . [javadoc] java.lang.ClassCastException: com.sun.tools.javadoc.ClassDocImpl cannot be cast to com.sun.javadoc.AnnotationTypeDoc [javadoc] at com.sun.tools.javadoc.AnnotationDescImpl.annotationType(AnnotationDescImpl.java:46) [javadoc] at com.sun.tools.doclets.formats.html.HtmlDocletWriter.getAnnotations(HtmlDocletWriter.java:1739) [javadoc] at com.sun.tools.doclets.formats.html