本文整理汇总了Java中spoon.reflect.declaration.CtType.getQualifiedName方法的典型用法代码示例。如果您正苦于以下问题:Java CtType.getQualifiedName方法的具体用法?Java CtType.getQualifiedName怎么用?Java CtType.getQualifiedName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类spoon.reflect.declaration.CtType
的用法示例。
在下文中一共展示了CtType.getQualifiedName方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getInfo
import spoon.reflect.declaration.CtType; //导入方法依赖的package包/类
/**
* Convert the marker to String "methodName;sourceFile;line"
*/
public static String getInfo(final IMarker marker) {
String res = "";
CtExecutable<?> method = infoMapping.get(marker);
if(method != null) {
String sourceFile = method.getPosition().getFile().getName();
int line = method.getPosition().getLine();
int endline = method.getPosition().getEndLine();
String name;
CtType<?> parentType = method.getParent(CtType.class);
if(parentType==null)
name = method.getSimpleName();
else
name = parentType.getQualifiedName() + "." + method.getSimpleName();
res = name + ";" + sourceFile + ";" + line + ";" + endline;
}
return res;
}
示例2: ctTypeToFullQualifiedName
import spoon.reflect.declaration.CtType; //导入方法依赖的package包/类
/**
* Will convert a CtType into a list of test classes full qualified names
* in case of abstract test classes, otherwise returns only the full qualified name
**/
private String ctTypeToFullQualifiedName(CtType<?> testClass) {
if (testClass.getModifiers().contains(ModifierKind.ABSTRACT)) {
CtTypeReference<?> referenceOfSuperClass = testClass.getReference();
return testClass.getFactory().Class().getAll()
.stream()
.filter(ctType -> referenceOfSuperClass.equals(ctType.getSuperclass()))
.map(CtType::getQualifiedName)
.collect(Collectors.joining(","));
} else {
return testClass.getQualifiedName();
}
}
示例3: ctTypeToFullQualifiedName
import spoon.reflect.declaration.CtType; //导入方法依赖的package包/类
private String ctTypeToFullQualifiedName(CtType<?> testClass) {
if (testClass.getModifiers().contains(ModifierKind.ABSTRACT)) {
CtTypeReference<?> referenceOfSuperClass = testClass.getReference();
return testClass.getFactory().Class().getAll()
.stream()
.filter(ctType -> referenceOfSuperClass.equals(ctType.getSuperclass()))
.map(CtType::getQualifiedName)
.collect(Collectors.joining(","));
} else {
return testClass.getQualifiedName();
}
}
示例4: processModelledClasses
import spoon.reflect.declaration.CtType; //导入方法依赖的package包/类
protected synchronized void processModelledClasses(Collection<? extends CtType<?>> modelledClasses, Collection<? extends Processor<?>> processors) {
setProcessors(processors);
for (CtType<?> modelledClass : modelledClasses) {
String qualifiedName = modelledClass.getQualifiedName();
//logDebug(logger(), format("[Spoon processing of %s]", qualifiedName));
try {
processingManager().process(modelledClass);
} catch (ProcessInterruption e) {
continue;
}
}
compileModelledClasses(modelledClasses);
}
示例5: SpoonedClass
import spoon.reflect.declaration.CtType; //导入方法依赖的package包/类
public SpoonedClass(SpoonedProject parentProject, CtType<?> modelledClass, NopolContext nopolContext) {
super(new File[] { modelledClass.getPosition().getFile() }, nopolContext);
this.simpleType = modelledClass;
this.parentProject = parentProject;
qualifiedClassName = modelledClass.getQualifiedName();
compiledClasses().putAll(parentProject().compiledClasses());
}
示例6: getMethod
import spoon.reflect.declaration.CtType; //导入方法依赖的package包/类
public String getMethod(String stmtPosition) {//@
CtStatement stmt = inputProgram.findElement(CtStatement.class,stmtPosition,null);
if(stmt != null) {
CtMethod method = stmt.getParent(CtMethod.class);
if(method != null) {
CtType cla = method.getDeclaringType();
return cla.getQualifiedName() + "." + method.getSignature().split(" ")[1];
}
}
System.err.println("[Warning] Position: " + stmtPosition + " could not be found.");
return "not found";
}
示例7: PrType
import spoon.reflect.declaration.CtType; //导入方法依赖的package包/类
public PrType (CtType t) {
tname = t.getQualifiedName();
for(Object o : t.getMethods()) {
CtMethod<?> m = (CtMethod<?>) o;
methods.add(new PrMethod(m));
}
}