當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。