本文整理汇总了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;
}
示例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*");
}
}
}
示例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;
}