本文整理汇总了Java中org.gsonformat.intellij.common.CheckUtil类的典型用法代码示例。如果您正苦于以下问题:Java CheckUtil类的具体用法?Java CheckUtil怎么用?Java CheckUtil使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CheckUtil类属于org.gsonformat.intellij.common包,在下文中一共展示了CheckUtil类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setValueAt
import org.gsonformat.intellij.common.CheckUtil; //导入依赖的package包/类
@Override
public void setValueAt(int column, String text) {
switch (column) {
case 2:
break;
case 3:
String result;
if (!TextUtils.isEmpty(fieldTypeSuffix)) {
result = fieldTypeSuffix + "." + text;
} else {
result = text;
}
if (CheckUtil.getInstant().containsDeclareClassName(result)) {
return;
}
CheckUtil.getInstant().removeDeclareClassName(getQualifiedName());
setClassName(text);
break;
}
}
示例2: collectPackAllClassName
import org.gsonformat.intellij.common.CheckUtil; //导入依赖的package包/类
private void collectPackAllClassName() {
File packageFile = PsiClassUtil.getPackageFile(file, packageName);
if (packageFile != null) {
File[] files = packageFile.listFiles();
if (files != null) {
for (File file1 : files) {
if (packageName == null) {
CheckUtil.getInstant().addDeclareClassName(file1.getName());
} else {
CheckUtil.getInstant().addDeclareClassName(packageName + "." + file1.getName());
}
}
}
}
}
示例3: collectClassAttribute
import org.gsonformat.intellij.common.CheckUtil; //导入依赖的package包/类
private ClassEntity collectClassAttribute(PsiClass psiClass, boolean collectInnerClass) {
if (psiClass == null) {
return null;
}
ClassEntity innerClass = new ClassEntity();
innerClass.setLock(true);
declareClass.put(psiClass.getQualifiedName(), innerClass);
CheckUtil.getInstant().addDeclareClassName(psiClass.getQualifiedName());
innerClass.setClassName(psiClass.getName());
innerClass.addAllFields(collectDeclareFields(psiClass));
innerClass.setPsiClass(psiClass);
innerClass.setPackName(getPackName(psiClass));
if (collectInnerClass) {
recursionInnerClass(innerClass);
}
return innerClass;
}
示例4: recursionInnerClass
import org.gsonformat.intellij.common.CheckUtil; //导入依赖的package包/类
private void recursionInnerClass(ClassEntity classEntity) {
PsiClass[] innerClassArray = classEntity.getPsiClass().getAllInnerClasses();
for (PsiClass psiClass : innerClassArray) {
ClassEntity item = new ClassEntity();
item.setLock(true);
if (declareClass.containsKey(psiClass.getQualifiedName())) {
return;
}
declareClass.put(psiClass.getQualifiedName(), item);
CheckUtil.getInstant().addDeclareClassName(psiClass.getQualifiedName());
item.setClassName(psiClass.getName());
item.addAllFields(collectDeclareFields(psiClass));
item.setPsiClass(psiClass);
item.setPackName(getPackName(psiClass));
recursionInnerClass(item);
}
}
示例5: checkAndSetType
import org.gsonformat.intellij.common.CheckUtil; //导入依赖的package包/类
public void checkAndSetType(String text) {
if (type != null && CheckUtil.getInstant().checkSimpleType(type.trim())) {
//基本类型
if (CheckUtil.getInstant().checkSimpleType(text.trim())) {
this.type = text.trim();
}
} else {
//实体类:
if (targetClass != null && !targetClass.isLock()) {
if (!TextUtils.isEmpty(text)) {
targetClass.setClassName(text);
}
}
}
}
示例6: setValueAt
import org.gsonformat.intellij.common.CheckUtil; //导入依赖的package包/类
@Override
public void setValueAt(int column, String text) {
switch (column) {
case 2:
checkAndSetType(text);
break;
case 3:
if(CheckUtil.getInstant().containsDeclareFieldName(text)){
return;
}
CheckUtil.getInstant().removeDeclareFieldName(getFieldName());
setFieldName(text);
break;
}
}
示例7: ConvertBridge
import org.gsonformat.intellij.common.CheckUtil; //导入依赖的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*");
}
}
}
示例8: createField
import org.gsonformat.intellij.common.CheckUtil; //导入依赖的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;
}
示例9: handleDeclareClassName
import org.gsonformat.intellij.common.CheckUtil; //导入依赖的package包/类
private boolean handleDeclareClassName(ClassEntity classEntity, String appendName) {
classEntity.setClassName(classEntity.getClassName() + appendName);
if (CheckUtil.getInstant().containsDeclareClassName(classEntity.getQualifiedName())) {
return handleDeclareClassName(classEntity, "X");
}
return true;
}
示例10: handleDeclareFieldName
import org.gsonformat.intellij.common.CheckUtil; //导入依赖的package包/类
private String handleDeclareFieldName(String fieldName, String appendName) {
fieldName += appendName;
if (CheckUtil.getInstant().containsDeclareFieldName(fieldName)) {
return handleDeclareFieldName(fieldName, "X");
}
return fieldName;
}
示例11: getGenerateFieldName
import org.gsonformat.intellij.common.CheckUtil; //导入依赖的package包/类
public String getGenerateFieldName() {
return CheckUtil.getInstant().handleArg(fieldName);
}
示例12: setClassName
import org.gsonformat.intellij.common.CheckUtil; //导入依赖的package包/类
public void setClassName(String className) {
this.className = CheckUtil.getInstant().handleArg(className);
}
示例13: createInnerClass
import org.gsonformat.intellij.common.CheckUtil; //导入依赖的package包/类
/**
* @param className
* @param json
* @param parentClass
* @return
*/
private ClassEntity createInnerClass(String className, JSONObject json, ClassEntity parentClass) {
if (Config.getInstant().isSplitGenerate()) {
String qualifiedName = packageName == null ? className : packageName + "." + className;
if (CheckUtil.getInstant().containsDeclareClassName(qualifiedName)) {
//存在同名。
PsiClass psiClass = PsiClassUtil.exist(file, qualifiedName);
if (psiClass != null) {
ClassEntity classEntity = collectClassAttribute(psiClass, false);
classEntity.setLock(true);
if (classEntity.isSame(json)) {
// if (Config.getInstant().isReuseEntity()) {
declareClass.put(classEntity.getQualifiedName(), classEntity);
// }
return classEntity;
}
}
}
}
ClassEntity subClassEntity = new ClassEntity();
Set<String> set = json.keySet();
List<String> list = new ArrayList<String>(set);
List<FieldEntity> fields = createFields(json, list, subClassEntity);
subClassEntity.addAllFields(fields);
if (Config.getInstant().isSplitGenerate()) {
subClassEntity.setPackName(packageName);
} else {
subClassEntity.setPackName(parentClass.getQualifiedName());
}
subClassEntity.setClassName(className);
if (handleDeclareClassName(subClassEntity, "")) {
CheckUtil.getInstant().addDeclareClassName(subClassEntity.getQualifiedName());
}
if (Config.getInstant().isReuseEntity()) {
declareClass.put(subClassEntity.getQualifiedName(), subClassEntity);
}
parentClass.addInnerClass(subClassEntity);
return subClassEntity;
}