Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Java Live TemplateNew to Visual Studio Code? Get it now.
Java Live Template

Java Live Template

Preview

yangbaopan

|
907 installs
| (0) | Free
Java language extends and template
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Java Template

介绍

为当前Visual Studio Code适配增强插件,当前功能不多,后续会不断完善(替换了本人之前的Java Doll或Java Enhancement)。

功能清单

  • 自定义注释模板
    可在配置setting文件中重新设置,默认配置如下:
// 这个是类的
"java.live.template.typeComment": [
    "/**",
    " * 项目名称: ${project_name}",
    " *",
    " * @author ${author} ${email}",
    " * @className ${file_name}",
    " * @description ",
    " * @date ${date}",
    " */"
]
// 这个是方法注释
"java.live.template.methodComment": [
    "/**",
    " * 功能描述: ${description}",
    " *",
    " ${param}",
    " * @return ${return}",
    " * @author ${author} ${email}",
    " * @date ${date}",
    " */"
]
// 作者变量
"java.live.template.author": "Administritor"
// 邮箱
"java.live.template.email": "example@email.com"
// 日期格式
"java.live.template.datepattern": "YYYY/MM/DD HH:mm:ss"
  • 上述中的变量是系统定义的当前支持的,含义如下:
字段 说明
project_name 项目名称,系统默认区workspace名称
author 配置的作者,不设置取操作系统登录用户名
file_name 当前文件名称
date 日期
description 方法注释,默认为方法名称
param 参数
return 返回值
email 邮箱
  • 生成Getters()、Setters()
  • 生成toString()
  • 生成Constructors()
  • 添加类注释
  • 添加方法注释
  • Maven依赖分析

安装

Launch VS Code Quick Open (cmd/ctrl + p), paste the following command, and press enter.

ext install vscode-template
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft