1.Plain(简单缩写)
prsf==>private static final
psf==>public static final
psfi==>public static final int
psfs==>public static final String
St==>String
thr==>throw new
2.表达式生成
对象类型
起步:Object msg;
msg.arg==>插入(msg) 用于将指定对象作为参数括起来
msg.cast==>((插入)msg); 类型转换
msg.castvar==>插入1= (插入1) msg; 类型转换生成临时变量
msg.field==>
private Object msg;
this.msg=msg; 生成对应的成员变量,常用于函数中添加成员变量并初始化
msg.inst==>msg instanceof ? ((插入) msg) : null; 生成instanceof关键字
msg.nn==>if(msg !=null) {插入 } 生成不为空判断
msg.notnull==>if(msg !=null) { 插入 } 同上
msg.null==>if(msg==null) {插入 } 生成null判断
msg.opt==>Optional.ofNullab_le(msg); ** 生成Optional包裹的对象
msg.par==>(msg) 加括号
msg.reqnonnull==>Objects._requireNon_Null(msg) **生成调用Objects.requireNonNull()方法的非空判断
_msg._return==>return msg; 生成返回
_msg._serr==>System.err.println(msg); 生成对象的错误打印
msg.souf==>System.out.printf(“”, msg); 生成对象的格式化打印
msg.sout==>System.out.println(msg); 生成换行输出
msg.soutv==>System.out.println(“msg = “ + msg); 生成变量名打印
msg.synchronized==>synchronized(msg) {**插入_ } **生成synchronized表达式
msg.try 生成try/catch包裹
msg.var==>Object msg1=msg; 生成一个临时变量
boolean类型
起步:boolean b;
b.assert==>assert b 调出assert关键字
b.if==>if(b) {插入 } 生成b的if判断
b.else==>if(!b) {插入 } 生成b的相反if判断
b.not==>!b 生成非b
b.while==>while(b) {插入 } 生成while判断包裹
其他类型
数组/集合.for 生成增强for
数组/Iterable.iter 同上
数组/集合/整型.fori 生成普通for
数组/集合/整型.forr 生成倒转的普通for,从末尾到开头进行遍历
数组.stream==>Arrays.stream(数组) 数组转成stream
字符串.format==>String.format(msg2,插入 ) 生成格式化String
switch支持的类型.switch==>switch(表达式) {插入} 生成switch表达式
函数().lamdba==>()=>函数() 生成lambda表达式;
类名.new==>new 类名() 生成新的new实例
new 异常类().throw==>throw new 异常类() 生成抛出异常
3.迭代
fori==> 生成普通for循环
for (int i = 0; i <插入1; i++) {//插入2}
itar==> 生成普通数组的for循环并临时赋值
for (int i = 0; i < array.length; i++) {int value = array[i];//插入}
itco==> 为集合生成iterator迭代
for (Iterator iterator = collection.iterator(); iterator.hasNext(); ) {Object next = iterator.next();//插入}
iten==> 为枚举类型生成迭代
while (enumeration.hasMoreElements()) {Object o = enumeration.nextElement();//插入}
iter==> 为数组和实现了Itearble接口的类型生成迭代
for (int value : values) {//插入}
itit==> 生成iterator迭代
while (iterator.hasNext()) {Object next = iterator.next();//插入}
itli==> 为List生成迭代
for (int i = 0; i < list.size(); i++) {Object o = list.get(i);//插入}
ritar==> 为数组生成倒序遍历
for (int i = values.length - 1; i >= 0; i--) {int value = values[i];//插入}
4.输出
serr==>System.err.println(插入); 生成err输出
souf==>System.out.printf(“插入“); 生成字符串格式输出
sout==>System.out.println(插入); 生成换行输出
soutm==>System.out.println(“MyTest.m1”); 输出当前方法的名字 格式:类名.方法名
soutp==>System.out.println(“msg = “ + msg); 生成方法的参数输出
soutv==>System.out.println(“values = “ + values); 生成最近的变量输出
5.maven
dep==> 生成依赖格式
<dependency><groupId></groupId><artifactId></artifactId><version></version></dependency
pl==> 生成插件格式
<plugin><groupId></groupId><artifactId></artifactId><version></version></plugin>
repo==> 生成repository 格式
<repository><id></id><name></name><url></url></repository>
6.SQL
col==> 生成创建列语句
create table test(列名 类型 not null)
ins==> 生成insert语句
insert into 表名(列名) values (值);
sel==> 生成简单select语句
select * from 表名;
selc==> 生成select count where语句
select count(*)from 表名 别名where 别名.列名;
selw==> 生成sqlect where语句
select *from 表名 别名where 别名.列名;
tab==> 生成创表语句
create table new_table(col int not null);
upd==> 生成update语句
update 表名set 列名= 列值where 条件;
7.其他
CD==> xml中使用生成CDATA用于一些特殊符号的格式转换,如”<”识别成小于号而不是标签开头
<![CDATA[ 插入]]>
geti==> 用于在声明函数的时候使用,会生成一个静态的getInstance函数,可用于单例模式的使用
public static MyTest getInstance() {return 插入;}
ifn==> 判断最近可使用变量为空
if (msg == null) {//插入}
inn==> 判断最近可使用变量不为空
if (msg != null) {// 插入}
inst==> 生成最近可使用变量instanceof关键字判断并转型
if (msg instanceof Object) {Object o = (Object) msg;// 插入}
lazy==> 生成最近可使用变量初始化
if (msg == null) {msg = new Object();// 插入}
lst==> 获取最近可使用数组的最末尾
int[] array=new int[9];array[array.length - 1]
main/psvm==>生成main函数
public static void main(String[] args) {// 插入}
mn==> 快速生成Math.min()
mx==> 快速生成Math.max()
int x=0,y=0;x = Math.min(x, y);y = Math.max(y, x);
toar==>快速生成集合转数组(需自己定义里面的new Object[]数组进行转换)
List<String> list=new ArrayList<>();list.toArray(new Object[list.size()])
