本文整理汇总了Java中spoon.reflect.reference.CtTypeReference.getQualifiedName方法的典型用法代码示例。如果您正苦于以下问题:Java CtTypeReference.getQualifiedName方法的具体用法?Java CtTypeReference.getQualifiedName怎么用?Java CtTypeReference.getQualifiedName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类spoon.reflect.reference.CtTypeReference
的用法示例。
在下文中一共展示了CtTypeReference.getQualifiedName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTypeDescriptor
import spoon.reflect.reference.CtTypeReference; //导入方法依赖的package包/类
public static String getTypeDescriptor(CtTypeReference<?> type) {
String name = type.getQualifiedName();
if (type.isPrimitive()) {
if (name.equals("boolean")) {
return "Z";
} else if (name.equals("int")) {
return "I";
} else if (name.equals("byte")) {
return "B";
} else if (name.equals("short")) {
return "S";
} else if (name.equals("char")) {
return "C";
} else if (name.equals("void")) {
return "V";
} else if (name.equals("float")) {
return "F";
} else if (name.equals("long")) {
return "J";
} else if (name.equals("double")) {
return "D";
} else {
return "V";
}
} else if (type instanceof CtArrayTypeReference) {
return "[" + getTypeDescriptor(((CtArrayTypeReference) type).getComponentType());
} else {
return "L" + name.replace(".", "/") + ";";
}
}
示例2: isToBeProcessed
import spoon.reflect.reference.CtTypeReference; //导入方法依赖的package包/类
@Override
public boolean isToBeProcessed(final CtTypeReference<?> type) {
String ty = type.getQualifiedName();
if(cacheTypeChecked.containsKey(ty)) {
return cacheTypeChecked.get(ty);
}else {
boolean ok = isASubTypeOf(type, controlType);
cacheTypeChecked.put(ty, ok);
return ok;
}
}
示例3: isNestedIn
import spoon.reflect.reference.CtTypeReference; //导入方法依赖的package包/类
public static boolean isNestedIn(CtTypeReference<?> nestingType, CtTypeReference<?> type) {
String simpleName = nestingType.getSimpleName();
String qualifiedName = type.getQualifiedName();
return qualifiedName.contains(simpleName + '$') && areFromSamePackage(nestingType, type);
}
示例4: isTypeRefAToolkitWidget
import spoon.reflect.reference.CtTypeReference; //导入方法依赖的package包/类
public boolean isTypeRefAToolkitWidget(final @NotNull CtTypeReference<?> typeref) {
final String qName = typeref.getQualifiedName();
return getWidgetPackages().stream().anyMatch(pkg -> qName.startsWith(pkg));
}