最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

IDEA添加Java類注釋模版的方法

 更新時間:2017年12月08日 13:43:35   作者:shengpli  
本篇文章主要介紹了IDEA添加Java類注釋模版的方法,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧

本文介紹了IDEA添加Java類注釋模版的方法,分享給大家,具體如下:

IDEA版本:IntelliJ IDEA 2017.2.5 x64

eclipse能在類上方輸入/**,回車添加類注釋模版,但idea沒有默認添加這個功能,需要做一些設(shè)置。下面介紹三種方法實現(xiàn):

  1. 創(chuàng)建類默認添加類注釋
  2. 手動添加類注釋
  3. 批量添加JavaDoc注釋

一、設(shè)置新建類默認添加注釋

依次點擊Setting|Editor|File and code templates,添加如圖配置

例子:

/**
*describe: 
*
*@author xxx
*@date ${YEAR}/${MONTH}/${DAY}
*/

支持的變量在描述內(nèi),找到需要配置即可!

二、利用Live Template手動添加注釋模版

依次點擊Setting|Editor|Live templates

1、點擊+添加templates group,如My Live Templates

2、點擊+添加live templates,修改abbreviation,再添加模版內(nèi)容,模版變量以$var$格式定義,如

/**
*describe: 
*
*@author xxx
*@date $date$
*/

 

3. 點擊define定義模版作用范圍,選擇Java

 

4. 點擊Edit variables定義變量,表達式解釋見附件

 

5. 保存后,在類任意位置輸入cc即可添加模版

三、批量添加注釋

安裝JavaDoc插件,alt+insert即可批量添加注釋,包括所有類和方法,但是不能定制化,注釋都是固定的。

附件

Item
Description
annotated("annotation qname")
Creates a symbol of type with an annotation that resides at the specified location. For an example, see Live Templates in the iterations group.
arrayVariable()
Suggests all array variables applicable in the current scope. For an example, see Live Templates in the iterations group.
anonymousSuper()
Suggests a supertype for a Kotlin object expression.
camelCase(String)
Returns the string passed as a parameter, converted to camel case. For example, my-text-file/my text file/my_text_file will be converted to myTextFile.
capitalize(String)
Capitalizes the first letter of the name passed as a parameter.
capitalizeAndUnderscore(sCamelCaseName)
Capitalizes the all letters of a CamelCase name passed as a parameter, and inserts an underscore between the parts. For example, if the string passed as a parameter is FooBar, then the function returns FOO_BAR.
castToLeftSideType()
Casts the right-side expression to the left-side expression type. It is used in the iterations group to have a single template for generating both raw-type and Generics Collections.
className(sClassName)
Returns the name of the current class (the class where the template is expanded).
classNameComplete()
This expression substitutes for the class name completion at the variable position.
clipboard()
Returns the contents of the system clipboard.
snakeCase(String)
Returns CamelCase string out of snake_case string. For example, if the string passed as a parameter is foo_bar, then the function returns fooBar.
complete()
This expression substitutes for the code completion invocation at the variable position.
completeSmart()
This expression substitutes for the smart type completion invocation at the variable position.
componentTypeOf (<array variable or array type>)
Returns component type of an array. For example, see the Live Templates in the iterations group in the other group.
currentPackage()
Returns the current package name.
date(sDate)
Returns the current system date in the specified format.
By default, the current date is returned in the default system format. However, if you specify date format in double quotes, the date will be presented in this format:

decapitalize(sName)
Replaces the first letter of the name passed as a parameter with the corresponding lowercase letter.
descendantClassEnum(<String>)
Shows the children of the class entered as a string parameter.
enum(sCompletionString1,sCompletionString2,...)
List of comma-delimited strings suggested for completion at the template invocation.
escapeString(sEscapeString)
Escapes the specified string.
expectedType()
Returns the type which is expected as a result of the whole template. Makes sense if the template is expanded in the right part of an assignment, after return, etc.
fileName(sFileName)
Returns file name with extension.
fileNameWithoutExtension()
Returns file name without extension.
firstWord(sFirstWord)
Returns the first word of the string passed as a parameter.
groovyScript("groovy code")
Returns Groovy script with the specified code.
You can use groovyScript macro with multiple arguments. The first argument is a script text that is executed or a path to the file that contains a script. The next arguments are bound to _1, _2, _3, ..._nvariables that are available inside your script. 
Also, _editor variable is available inside the script. This variable is bound to the current editor.
guessElementType (<container>)
Makes a guess on the type of elements stored in a java.util.Collection. To make a guess, IntelliJ IDEA tries to find the places where the elements were added to or extracted from the container.
iterableComponentType(<ArrayOrIterable>)
Returns the type of an iterable component, such as an array or a collection.
iterableVariable()
Returns the name of a variable that can be iterated.
lineNumber()
Returns the current line number.
lowercaseAndDash(String)
Returns lower case separated by dashes, of the string passed as a parameter. For example, the string MyExampleName is converted to my-example-name.
methodName()
Returns the name of the embracing method (where the template is expanded).
methodParameters()
Returns the list of parameters of the embracing method (where the template is expanded).
methodReturnType()
Returns the type of the value returned by the current method (the method within which the template is expanded).
qualifiedClassName()
Returns the fully qualified name of the current class (the class where the template is expanded).
Clear the Shorten FQ names check box.
rightSideType()
Declares the left-side variable with a type of the right-side expression. It is used in theiterations group to have a single template for generating both raw-type and Generics Collections.
snakeCase(sCamelCaseText)
Returns snake_case string out of CamelCase string passed as a parameter.
spaceSeparated(String)
Returns string separated with spaces out of CamelCase string passed as a parameter. For example, if the string passed as a parameter is fooBar, then the function returns foo bar.
subtypes(sType)
Returns the subtypes of the type passed as a parameter.
suggestIndexName()
Suggests the name of an index variable. Returns i if there is no such variable in scope, otherwise returns j if there is no such variable in scope, etc.
suggestVariableName()
Suggests the name for a variable based on the variable type and its initializer expression, according to your code style settings that refer to the variable naming rules.
For example, if it is a variable that holds an element within iteration, IntelliJ IDEA makes a guess on the most reasonable names, also taking into account the name of the container being iterated.
suggestFirstVariableName(sFirstVariableName)
Doesn't suggest true, false, this, super.
time(sSystemTime)
Returns the current system time.
typeOfVariable(VAR)
Returns the type of the variable passed as a parameter.
underscoresToCamelCase(sCamelCaseText)
Returns the string passed as a parameter with CamelHump letters substituting for underscores. For example, if the string passed as a parameter is foo_bar, then the function returns fooBar.
underscoresToSpaces(sParameterWithSpaces)
Returns the string passed as a parameter with spaces substituting for underscores.
user()
Returns the name of the current user.
variableOfType(<type>)
Suggests all variables that may be assigned to the type passed as a parameter, for example variableOfType("java.util.Vector"). If you pass an empty string ("") as a parameter, suggests all variables regardless of their types.
JsArrayVariable
Returns JavaScript array name.
jsClassName()
Returns the name of the current JavaScript class.
jsComponentType
Returns the JavaScript component type.
jsMethodName()
Returns the name of the current JavaScript method.
jsQualifiedClassName
Returns the complete name of the current JavaScript class.
jsSuggestIndexName
Returns a suggested name for an index.
jsSuggestVariableName
Returns a suggested name for a variable.

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • java語言圖形用戶登錄界面代碼

    java語言圖形用戶登錄界面代碼

    這篇文章主要為大家詳細介紹了java語言圖形用戶登錄界面代碼,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2016-06-06
  • java中讀寫Properties屬性文件公用方法詳解

    java中讀寫Properties屬性文件公用方法詳解

    在項目開發(fā)中我們會將很多環(huán)境特定的變量定義到一個配置文件中,比如properties文件,把數(shù)據(jù)庫的用戶名和密碼存放到此屬性文件中。下面這篇文章就主要介紹了java中讀寫Properties屬性文件公用方法,需要的朋友可以參考借鑒。
    2017-01-01
  • 詳解Java類動態(tài)加載和熱替換

    詳解Java類動態(tài)加載和熱替換

    本文主要介紹類加載器、自定義類加載器及類的加載和卸載等內(nèi)容,并舉例介紹了Java類的熱替換。
    2021-05-05
  • java中g(shù)et()方法和set()方法的作用淺析

    java中g(shù)et()方法和set()方法的作用淺析

    這篇文章主要給大家介紹了關(guān)于java中g(shù)et()方法和set()方法的作用,set是是對數(shù)據(jù)進行設(shè)置,而get是對數(shù)據(jù)進行獲取,文中通過實例代碼介紹的非常詳細,需要的朋友可以參考下
    2023-07-07
  • 簡單了解Java中多態(tài)的基礎(chǔ)知識

    簡單了解Java中多態(tài)的基礎(chǔ)知識

    這篇文章主要介紹了簡單了解Java中的多態(tài),文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友可以參考下
    2019-09-09
  • Spring注解開發(fā)@Bean和@ComponentScan使用案例

    Spring注解開發(fā)@Bean和@ComponentScan使用案例

    這篇文章主要介紹了Spring注解開發(fā)@Bean和@ComponentScan使用案例,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友可以參考下
    2020-09-09
  • Java線程池使用與原理詳解

    Java線程池使用與原理詳解

    這篇文章主要為大家詳細介紹了Java線程池使用與原理的相關(guān)資料,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2017-10-10
  • Java畢業(yè)設(shè)計實戰(zhàn)之學(xué)生管理系統(tǒng)的實現(xiàn)

    Java畢業(yè)設(shè)計實戰(zhàn)之學(xué)生管理系統(tǒng)的實現(xiàn)

    只學(xué)書上的理論是遠遠不夠的,只有在實戰(zhàn)中才能獲得能力的提升,本篇文章手把手帶你用java+Springboot+Maven+mybatis+Vue+Mysql實現(xiàn)學(xué)生管理系統(tǒng),大家可以在過程中查缺補漏,提升水平
    2022-03-03
  • 解決InputStream.available()獲取流大小問題

    解決InputStream.available()獲取流大小問題

    這篇文章主要介紹了解決InputStream.available()獲取流大小問題,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2023-06-06
  • springboot 如何修改默認端口及application.properties常用配置

    springboot 如何修改默認端口及application.properties常用配置

    這篇文章主要介紹了springboot 如何修改默認端口及application.properties常用配置操作,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2021-08-08

最新評論

林西县| 紫阳县| 阳曲县| 平安县| 马鞍山市| 莲花县| 辉县市| 江油市| 桂东县| 高唐县| 乐山市| 永定县| 正定县| 兴隆县| 鄂托克旗| 同心县| 广州市| 鄂托克前旗| 社会| 静海县| 海丰县| 泸州市| 汾阳市| 资阳市| 遂平县| 达尔| 宁都县| 崇州市| 军事| 海阳市| 元阳县| 临城县| 内乡县| 临猗县| 松滋市| 玛多县| 华宁县| 无极县| 呼伦贝尔市| 清镇市| 鹤庆县|