qin*_*zou 191 javadoc android-studio
我可以在Android studio中使用快捷键来生成javadoc注释吗?
如果没有,生成javadoc注释的最简单方法是什么?
Dou*_*ouO 370
我找不到任何生成javadoc注释的快捷方式.但是如果/**
在方法声明之前键入并按Enter键,则会自动生成javadoc注释块.
阅读本文以获取更多信息.
小智 107
/**
在方法声明之前按下注释类型键并按Enter
.它将生成javadoc评论.
例:
/**
* @param a
* @param b
*/
public void add(int a, int b) {
//code here
}
Run Code Online (Sandbox Code Playgroud)
有关更多信息,请访问https://www.jetbrains.com/idea/features/javadoc.html链接
Sur*_*gch 34
/**
* Returns an Image object that can then be painted on the screen.
* The url argument must specify an absolute {@link URL}. The name
* argument is a specifier that is relative to the url argument.
* <p>
* This method always returns immediately, whether or not the
* image exists. When this applet attempts to draw the image on
* the screen, the data will be loaded. The graphics primitives
* that draw the image will incrementally paint on the screen.
*
* @param url an absolute URL giving the base location of the image
* @param name the location of the image, relative to the url argument
* @return the image at the specified URL
* @see Image
*/
public Image getImage(URL url, String name) {
try {
return getImage(new URL(url, name));
} catch (MalformedURLException e) {
return null;
}
}
Run Code Online (Sandbox Code Playgroud)
基本格式可以通过以下任一方式自动生成:
在这里,我们可以这样的东西.而不是使用任何快捷方式,我们可以在类/包/项目级别编写"默认"注释.并根据要求进行修改
*** Install JavaDoc Plugin ***
1.Press shift twice and Go to Plugins.
2. search for JavaDocs plugin
3. Install it.
4. Restart Android Studio.
5. Now, rightclick on Java file/package and goto
JavaDocs >> create javadocs for all elements
It will generate all default comments.
Run Code Online (Sandbox Code Playgroud)
优点是,您可以为其创建注释块 all the methods at a time.
可以使用IDE的自动完成功能自动附加Javadoc注释。尝试键入/**
并单击Enter以生成示例Javadoc注释。
/**
*
* @param action The action to execute.
* @param args The exec() arguments.
* @param callbackContext The callback context used when calling back into JavaScript.
* @return
* @throws JSONException
*/
Run Code Online (Sandbox Code Playgroud)
小智 5
在Android Studio中,您不需要插件.在Mac上只需打开Android Studio - >单击顶部栏中的Android Studio - >单击Prefrences - >在列表中查找文件和代码模板 - >选择包含 - >构建它并将坚持你的所有项目
归档时间: |
|
查看次数: |
134404 次 |
最近记录: |