android studio 代码模板

作者:韩梦飞沙

Author:han_meng_fei_sha

邮箱:313134555@qq.com

E-mail: 313134555 @qq.com

android studio 代码模板 

android studio 方法 加入 注释  快捷键 

android studio 方法 注释模板 javaDoc

(一)通常javadoc模版注释产生方法:

在函数名上面一行输入/**<Enter>,自动会生成如下注释格式:

/**

*这里可以简单介绍函数功能

*@param 

*@param

*@return

*/

(二)生成javadoc:

点击android studio菜单栏Tools->Generate JavaDoc->选择Whole project或者Custom scope->选择Output directory作为javadoc生成位置->OK。

注:若提示编码错误,则在Other command line arguments中输入:-encoding utf-8 -charset utf-8 

按照以上方法,基本的javadoc就可以生成了。

这是一个内置的模板。
它包含一个代码片段,可以在解析指令的帮助下包含到文件模板(模板附签)中。
模板是可编辑的。
除了静态文本、代码和注释,还可以使用预定义的变量,这些变量随后将像宏一样扩展到相应的值中。
预定义的变量将采用以下值:

This is a built-in template. It contains a code fragment that can be included into file templates (Templates tab) with the help of the #parse directive. The template is editable. Along with static text, code and comments, you can also use predefined variables that will then be expanded like macros into the corresponding values. 

Predefined variables will take the following values:

$ { PACKAGE_NAME }

创建新文件的包的名称

$ { USER }

当前用户系统登录名

$ {日期}

当前系统日期

$ {时间}

当前系统时间

$ {年}

$ {月}

$ { MONTH_NAME_SHORT }

前3个月的名字。例子:1月、2月等。

$ { MONTH_NAME_FULL }

月的全称。例子:1月、2月,等等。

$ {年}

月日

$ {小时}

当前的小时

$ {一}

当前的分钟

$ { PROJECT_NAME }

当前项目的名称

使用Apache Velocity模板语言

====

在这个模板中,您可以在解析指令的帮助下,指定一个代码片段被包含到文件模板(模板选项卡)中。
一个模板可以由多个文件模板共享。

In this template, you can specify a code fragment to be included into file templates (Templates tab) with the help of the #parse directive. One template can be shared by several file templates.

 ====

===

====

 

 ======

增加 方法 函数 注释 快捷键

 

我设置的是 斜杠 。

鼠标放到方法上,按“/”,这样就自动生成注释了

 

 ========

安卓 android 文档注释 模板

idea 文档注释 模板

idea javadoc注释 模板

@param:每一个参数一行,都获取取来 ,像javadoc一样。

groovyScript("def result=''; def params="${_1}".replaceAll('[\\[|\\]|\\s]', '').split(',').toList(); for(i = 0; i < params.size(); i++) {result+=' * @param ' + params[i] + ((i < params.size() - 1) ? '\n\b' : '')}; return result", methodParameters())

这种写法,第一个参数有链接。 第二个参数没有链接,没有下划线。

Jindent——让intellij idea 像eclipse一样生成模版化的javadoc注释

========

原文地址:https://www.cnblogs.com/yue31313/p/7326261.html