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


Java MethodInvocation类代码示例

本文整理汇总了Java中org.eclipse.gmt.modisco.java.MethodInvocation的典型用法代码示例。如果您正苦于以下问题:Java MethodInvocation类的具体用法?Java MethodInvocation怎么用?Java MethodInvocation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MethodInvocation类属于org.eclipse.gmt.modisco.java包,在下文中一共展示了MethodInvocation类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: queryUnusedMethodsWithLoop

import org.eclipse.gmt.modisco.java.MethodInvocation; //导入依赖的package包/类
public static Query<Integer> queryUnusedMethodsWithLoop(Resource resource) {
    return () -> {
        List<MethodDeclaration> unusedMethods = new BasicEList<>();

        Iterable<MethodInvocation> methodInvocations = getAllInstances(resource, JavaPackage.eINSTANCE.getMethodInvocation());

        Iterable<MethodDeclaration> methodDeclarations = getAllInstances(resource, JavaPackage.eINSTANCE.getMethodDeclaration());
        for (MethodDeclaration method : methodDeclarations) {
            if (nonNull(method.getModifier())) {
                if (method.getModifier().getVisibility() == VisibilityKind.PRIVATE) {
                    if (!hasBeenInvoked(methodInvocations, method)) {
                        unusedMethods.add(method);
                    }
                }
            }
        }

        return unusedMethods.size();
    };
}
 
开发者ID:atlanmod,项目名称:NeoEMF,代码行数:21,代码来源:QueryFactory.java

示例2: hasBeenInvoked

import org.eclipse.gmt.modisco.java.MethodInvocation; //导入依赖的package包/类
private static boolean hasBeenInvoked(Iterable<MethodInvocation> methodInvocations, EObject method) {
    for (MethodInvocation methodInvocation : methodInvocations) {
        if (Objects.equals(methodInvocation.getMethod(), method)) {
            return true;
        }
    }
    return false;
}
 
开发者ID:atlanmod,项目名称:NeoEMF,代码行数:9,代码来源:QueryFactory.java

示例3: createCallMethodInstruction

import org.eclipse.gmt.modisco.java.MethodInvocation; //导入依赖的package包/类
/**
 * Create a method call instruction from a caller
 * 
 * @param caller
 *            the caller of the method.
 * @param methodName
 *            the name of the method to call.
 * @return the created method call instruction from the specified caller.
 */
public static AbstractMethodInstruction createCallMethodInstruction(IElementaryInstruction caller, String methodName) {
	MethodDeclaration methodDeclaration = MethodDeclarationBuilder.builder().setName(methodName).build();
	MethodInvocation methodInvocation = MethodInvocationBuilder.builder().setMethod(methodDeclaration)
			.setExpression(caller.getExpression()).build();
	return new AbstractMethodInstruction(methodInvocation);
}
 
开发者ID:awltech,项目名称:eclipse-optimus,代码行数:16,代码来源:CallInstructionHelper.java

示例4: AbstractMethodInstruction

import org.eclipse.gmt.modisco.java.MethodInvocation; //导入依赖的package包/类
/**
 * Constructor of abstract method instruction
 * 
 * @param methodInvocation
 *            the method invocation statement.
 */
public AbstractMethodInstruction(MethodInvocation methodInvocation) {
	super(ExpressionStatementBuilder.builder().setExpression(methodInvocation).build());
	this.abstractMethodInvocation = methodInvocation;
}
 
开发者ID:awltech,项目名称:eclipse-optimus,代码行数:11,代码来源:AbstractMethodInstruction.java

示例5: build

import org.eclipse.gmt.modisco.java.MethodInvocation; //导入依赖的package包/类
/**
 * Build a method invocation of modisco model
 * 
 * @return a new method invocation of modisco model.
 */
public MethodInvocation build() {
	return this.buildMethodInvocation;
}
 
开发者ID:awltech,项目名称:eclipse-optimus,代码行数:9,代码来源:MethodInvocationBuilder.java


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