模板设置说明
类和接口模板
参数
| 参数名 | 描述 | 类型 |
|---|---|---|
| className | 类名字 | String |
示例
/**
* ${className}
*
* @author 作者名
*/
成员变量模板
参数
| 参数名 | 描述 | 类型 |
|---|---|---|
| fieldName | 变量名字 | String |
示例
/**
* ${fieldName}
*/
方法模板
参数
| 参数名 | 描述 | 类型 |
|---|---|---|
| methodName | 方法名字 | String |
| parameters | 方法入参列表 | Array<Parameter> |
| typeParameters | 方法类型参数列表 | Array<TypeParameter> |
| exceptions | 方法异常列表 | Array<Exception> |
| returnName | 方法出参名字 | String |
Parameter
| 参数名 | 描述 | 类型 |
|---|---|---|
| name | 名字 | String |
TypeParameter
| 参数名 | 描述 | 类型 |
|---|---|---|
| name | 名字 | String |
Exception
| 参数名 | 描述 | 类型 |
|---|---|---|
| name | 名字 | String |
示例
/**
* ${methodName}
*
#foreach($parameter in ${parameters})
* @param ${parameter.name} ${parameter.name}
#end
#foreach($typeParameter in $typeParameters)
* @param <${typeParameter.name}> ${typeParameter.name}
#end
#if($returnName)
* @return ${returnName}
#end
#foreach($exception in ${exceptions})
* @throws ${exception.name} ${exception.name}
#end
*/