Eclipse工具使用格式化模板应用

开发 后端
本篇文章讲述了eclipse工具使用格式化模板应用的方法。

在编写完代码后使用代码格式化程序对代码进行格式化,有利于版本冲突时进行对比和文件合并。想到当前代码编写格式多少有些太个性化,如果可以创建一份代码模板,将之导入到所有人的工具中,然后所有的代码在编写后都进行格式化,则避免了代码格式太混乱的情况,有利于大家阅读代码。

Comments
Files

/**
 * Copyright (C) aumy2008, ${year}
 */


Getters

/**
 * @return Returns the ${bare_field_name}.
 */

Setters

/**
 * @param ${param} The ${bare_field_name} to set.
 */

Constructors

/**
 * ${tags}
 */

Types

/**
 *
 * @author aumy2008(aumy2008@126.com) in ${date}
 * @since 1.0
 *
 * ${tags}
 */


Fields

/**
 *
 */


Methods

/**
 * ${tags}
 * @since 1.0
 */

Overriding methods


/* (non-Javadoc)
 * ${see_to_overridden}
 */


2.代码
New Java files

/**
 * Copyright (C) aumy2008, ${year}
 */
${package_declaration}
/**
 *
 * @author aumy2008(aumy2008@126.com) in ${date}
 * @since 1.0
 */
${typecomment}
${type_declaration}


Catch block body

// ${todo} Auto-generated catch block
${exception_var}.printStackTrace();


Method budy

// ${todo} Auto-generated method stub
${body_statement}

Constructor body

${body_statement}
// ${todo} Auto-generated constructor stub

Getter body

return ${field};

Setter body

${field} = ${param};

【编辑推荐】

  1. Eclipse or Netbeans
  2. eclipse中编码设置
  3. Eclipse用户中使用Linux的数量赶超Windows
  4. Eclipse中代码模版
  5. 谈在Eclipse中配置tomcat
责任编辑:book05 来源: blogbus
相关推荐

2010-08-10 13:35:26

Flex代码格式化

2019-05-17 13:20:57

Black格式化工具Python

2009-09-04 12:22:41

C#日期格式化

2011-09-13 18:09:15

Eclipse And

2010-08-03 10:46:41

Flex代码格式化

2020-09-02 07:19:41

printf 格式化输出Unix

2010-04-26 09:41:48

Oracle sqlp

2009-09-04 13:19:59

C#代码格式化

2020-11-03 10:21:33

MySQL

2022-06-26 08:39:19

Spring容器字段格式化

2009-08-03 14:25:59

C#日期格式化

2010-08-10 13:28:21

Flex代码格式化

2019-07-30 10:51:45

Markdown格式化文档Linux

2024-01-08 22:03:22

python代码开发

2022-05-09 08:17:37

InstantJava字符

2010-01-21 13:41:05

VB.NET磁盘格式化

2010-02-01 16:46:07

C++格式化字符串

2009-09-03 18:05:04

ASP.NET字符串格

2010-07-29 11:12:30

Flex日期格式化

2009-08-03 16:24:05

C#格式化
点赞
收藏

51CTO技术栈公众号