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


Java CtType.getQualifiedName方法代码示例

本文整理汇总了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;
}
 
开发者ID:diverse-project,项目名称:InspectorGuidget,代码行数:25,代码来源:DetectGUIListenerAction.java

示例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();
	}
}
 
开发者ID:STAMP-project,项目名称:dspot,代码行数:17,代码来源:MavenAutomaticBuilder.java

示例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();
    }
}
 
开发者ID:STAMP-project,项目名称:dspot,代码行数:13,代码来源:GradleAutomaticBuilder.java

示例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);
}
 
开发者ID:SpoonLabs,项目名称:nopol,代码行数:14,代码来源:SpoonedFile.java

示例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());
}
 
开发者ID:SpoonLabs,项目名称:nopol,代码行数:8,代码来源:SpoonedClass.java

示例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";
}
 
开发者ID:DIVERSIFY-project,项目名称:sosiefier,代码行数:13,代码来源:TestBaseInfo.java

示例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));
    }
}
 
开发者ID:DIVERSIFY-project,项目名称:sosiefier,代码行数:8,代码来源:AddMethodInvocationStatsQuery.java


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