当前位置: 首页>>代码示例>>Java>>正文


Java Constant类代码示例

本文整理汇总了Java中org.gsonformat.intellij.config.Constant的典型用法代码示例。如果您正苦于以下问题:Java Constant类的具体用法?Java Constant怎么用?Java Constant使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Constant类属于org.gsonformat.intellij.config包,在下文中一共展示了Constant类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: generateField

import org.gsonformat.intellij.config.Constant; //导入依赖的package包/类
@Override
protected void generateField(PsiElementFactory factory, FieldEntity fieldEntity, PsiClass cls, ClassEntity classEntity) {
    if (fieldEntity.isGenerate()) {
        Try.run(new Try.TryListener() {
            @Override
            public void run() {
                cls.add(factory.createFieldFromText(generateLombokFieldText(classEntity, fieldEntity,null), cls));
            }

            @Override
            public void runAgain() {
                fieldEntity.setFieldName(FieldHelper.generateLuckyFieldName(fieldEntity.getFieldName()));
                cls.add(factory.createFieldFromText(generateLombokFieldText(classEntity, fieldEntity, Constant.FIXME), cls));
            }

            @Override
            public void error() {
                cls.addBefore(factory.createCommentFromText("// FIXME generate failure  field " + fieldEntity.getFieldName(), cls), cls.getChildren()[0]);
            }
        });
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:23,代码来源:LombokProcessor.java

示例2: generateField

import org.gsonformat.intellij.config.Constant; //导入依赖的package包/类
@Override
public void generateField(PsiElementFactory factory, FieldEntity fieldEntity, PsiClass cls, ClassEntity classEntity) {

    if (fieldEntity.isGenerate()) {

        Try.run(new Try.TryListener() {
            @Override
            public void run() {
                cls.add(factory.createMethodFromText(generateFieldText(classEntity, fieldEntity, null), cls));
            }

            @Override
            public void runAgain() {
                fieldEntity.setFieldName(FieldHelper.generateLuckyFieldName(fieldEntity.getFieldName()));
                cls.add(factory.createMethodFromText(generateFieldText(classEntity, fieldEntity, Constant.FIXME), cls));
            }

            @Override
            public void error() {
                cls.addBefore(factory.createCommentFromText("// FIXME generate failure  field " + fieldEntity.getFieldName(), cls), cls.getChildren()[0]);
            }
        });

    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:26,代码来源:AutoValueProcessor.java

示例3: generateFieldText

import org.gsonformat.intellij.config.Constant; //导入依赖的package包/类
private String generateFieldText(ClassEntity classEntity, FieldEntity fieldEntity, String fixme) {
    fixme = fixme == null ? "" : fixme;
    StringBuilder fieldSb = new StringBuilder();
    String fieldName = fieldEntity.getGenerateFieldName();
    if (!TextUtils.isEmpty(classEntity.getExtra())) {
        fieldSb.append(classEntity.getExtra()).append("\n");
        classEntity.setExtra(null);
    }
    if (!fieldName.equals(fieldEntity.getKey()) || Config.getInstant().isUseSerializedName()) {
        fieldSb.append(Constant.gsonFullNameAnnotation.replaceAll("\\{filed\\}", fieldEntity.getKey()));
    }
    if (fieldEntity.getTargetClass() != null) {
        fieldEntity.getTargetClass().setGenerate(true);
    }
    return fieldSb.append(String.format("public abstract %s %s(); " + fixme, fieldEntity.getFullNameType(), fieldName)).toString();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:17,代码来源:AutoValueProcessor.java

示例4: generateField

import org.gsonformat.intellij.config.Constant; //导入依赖的package包/类
protected void generateField(PsiElementFactory factory, FieldEntity fieldEntity, PsiClass cls, ClassEntity classEntity) {

        if (fieldEntity.isGenerate()) {
            Try.run(new Try.TryListener() {
                @Override
                public void run() {
                    cls.add(factory.createFieldFromText(generateFieldText(classEntity, fieldEntity, null), cls));

                }

                @Override
                public void runAgain() {
                    fieldEntity.setFieldName(FieldHelper.generateLuckyFieldName(fieldEntity.getFieldName()));
                    cls.add(factory.createFieldFromText(generateFieldText(classEntity, fieldEntity, Constant.FIXME), cls));
                }

                @Override
                public void error() {
                    cls.addBefore(factory.createCommentFromText("// FIXME generate failure  field " + fieldEntity.getFieldName(), cls), cls.getChildren()[0]);
                }
            });

        }

    }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:26,代码来源:Processor.java

示例5: resetAction

import org.gsonformat.intellij.config.Constant; //导入依赖的package包/类
private void resetAction() {

        switch (type) {
            case OBJECT_FROM_DATA:
                editTP.setText(Constant.objectFromObject);
                break;
            case OBJECT_FROM_DATA1:
                System.out.println(Constant.objectFromObject1);
                editTP.setText(Constant.objectFromObject1);
                break;
            case ARRAY_FROM_DATA:
                editTP.setText(Constant.arrayFromData);
                break;
            case ARRAY_FROM_DATA1:
                editTP.setText(Constant.arrayFromData1);
                break;
        }
    }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:19,代码来源:EditDialog.java

示例6: generateLuckyFieldName

import org.gsonformat.intellij.config.Constant; //导入依赖的package包/类
public static String generateLuckyFieldName(String name) {

        if (name == null) {
            return Constant.DEFAULT_PREFIX + new Random().nextInt(333);
        }
        Matcher matcher = Pattern.compile("(\\w+)").matcher(name);
        StringBuilder sb = new StringBuilder("_$");
        while (matcher.find()) {
            sb.append(StringUtils.captureName(matcher.group(1)));
        }
        return sb.append(new Random().nextInt(333)).toString();
    }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:13,代码来源:FieldHelper.java

示例7: handleArg

import org.gsonformat.intellij.config.Constant; //导入依赖的package包/类
public String handleArg(String arg) {

        arg = arg.replaceAll("-", "");
        Matcher matcher = sPattern.matcher(arg);
        if (matcher.find()) {
            return Constant.DEFAULT_PREFIX + arg;
        } else {
            if (CheckUtil.getInstant().checkKeyWord(arg)) {
                return arg + "X";
            }
            return arg;
        }
    }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:14,代码来源:CheckUtil.java


注:本文中的org.gsonformat.intellij.config.Constant类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。