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


Java StringUtils类代码示例

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


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

示例1: createSubClassName

import org.gsonformat.intellij.common.StringUtils; //导入依赖的package包/类
private String createSubClassName(String key, Object o) {
    String name = "";
    if (o instanceof JSONObject) {
        if (TextUtils.isEmpty(key)) {
            return key;
        }
        String[] strings = key.split("_");
        StringBuilder stringBuilder = new StringBuilder();
        for (int i = 0; i < strings.length; i++) {
            stringBuilder.append(StringUtils.captureName(strings[i]));
        }
        name = stringBuilder.toString() + Config.getInstant().getSuffixStr();
    }
    return name;

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

示例2: ConvertBridge

import org.gsonformat.intellij.common.StringUtils; //导入依赖的package包/类
public ConvertBridge(Operator operator,
                     String jsonStr, PsiFile file, Project project,
                     PsiClass targetClass,
                     PsiClass currentClass, String generateClassName) {

    factory = JavaPsiFacade.getElementFactory(project);
    this.file = file;
    this.generateClassName = generateClassName;
    this.operator = operator;
    this.jsonStr = jsonStr;
    this.project = project;
    this.targetClass = targetClass;
    this.currentClass = currentClass;
    declareFields = new HashMap<>();
    declareClass = new HashMap<>();
    packageName = StringUtils.getPackage(generateClassName);
    fullFilterRegex = new StringBuilder();
    briefFilterRegex = new StringBuilder();
    CheckUtil.getInstant().cleanDeclareData();
    String[] arg = Config.getInstant().getAnnotationStr().replace("{filed}", "(\\w+)").split("\\.");

    for (int i = 0; i < arg.length; i++) {
        String s = arg[i];
        if (i == arg.length - 1) {
            briefFilterRegex.append(s);
            fullFilterRegex.append(s);
            Matcher matcher = Pattern.compile("\\w+").matcher(s);
            if (matcher.find()) {
                filterRegex = matcher.group();
            }
        } else {
            fullFilterRegex.append(s).append("\\s*\\.\\s*");
        }
    }


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

示例3: createField

import org.gsonformat.intellij.common.StringUtils; //导入依赖的package包/类
private FieldEntity createField(ClassEntity parentClass, String key, Object type) {
    //过滤 不符合规则的key
    String fieldName = CheckUtil.getInstant().handleArg(key);
    if (Config.getInstant().isUseSerializedName()) {
        fieldName = StringUtils.captureStringLeaveUnderscore(convertSerializedName(fieldName));
    }
    fieldName = handleDeclareFieldName(fieldName, "");

    FieldEntity fieldEntity = typeByValue(parentClass, key, type);
    fieldEntity.setFieldName(fieldName);
    return fieldEntity;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:13,代码来源:ConvertBridge.java


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