當前位置: 首頁>>代碼示例>>Java>>正文


Java IMethod.getSignature方法代碼示例

本文整理匯總了Java中org.eclipse.jdt.core.IMethod.getSignature方法的典型用法代碼示例。如果您正苦於以下問題:Java IMethod.getSignature方法的具體用法?Java IMethod.getSignature怎麽用?Java IMethod.getSignature使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.jdt.core.IMethod的用法示例。


在下文中一共展示了IMethod.getSignature方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initByIMethodBinding

import org.eclipse.jdt.core.IMethod; //導入方法依賴的package包/類
public void initByIMethodBinding(IMethodBinding mBinding) {
	IMethod iMethod = (IMethod) mBinding.getJavaElement();
	try {
		key = iMethod.getKey().substring(0, iMethod.getKey().indexOf("("))
				+ iMethod.getSignature();
		projectName = mBinding.getJavaElement().getJavaProject()
				.getElementName();
	} catch (Exception e) {
		projectName = "";
	}
	packageName = mBinding.getDeclaringClass().getPackage().getName();
	className = mBinding.getDeclaringClass().getName();
	name = mBinding.getName();

	parameters = new ArrayList<>();
	ITypeBinding[] parameterBindings = mBinding.getParameterTypes();
	for (int i = 0; i < parameterBindings.length; i++) {
		parameters.add(parameterBindings[i].getName());
	}
}
 
開發者ID:linzeqipku,項目名稱:SnowGraph,代碼行數:21,代碼來源:APIMethodData.java

示例2: resolveMethodSignature

import org.eclipse.jdt.core.IMethod; //導入方法依賴的package包/類
/**
 * Copied from org.eclipse.jdt.internal.debug.ui.actions.ToggleBreakpointAdapter
 * TODO: is there a public API to do this?
 *
 * Returns the resolved signature of the given method
 * @param method method to resolve
 * @return the resolved method signature or <code>null</code> if none
 * @throws JavaModelException
 * @since 3.4
 */
public static String resolveMethodSignature(IMethod method) throws JavaModelException {
	String signature = method.getSignature();
	String[] parameterTypes = Signature.getParameterTypes(signature);
	int length = parameterTypes.length;
	String[] resolvedParameterTypes = new String[length];
	for (int i = 0; i < length; i++) {
		resolvedParameterTypes[i] = resolveTypeSignature(method, parameterTypes[i]);
		if (resolvedParameterTypes[i] == null) {
			return null;
		}
	}
	String resolvedReturnType = resolveTypeSignature(method, Signature.getReturnType(signature));
	if (resolvedReturnType == null) {
		return null;
	}
	return Signature.createMethodSignature(resolvedParameterTypes, resolvedReturnType);
}
 
開發者ID:VisuFlow,項目名稱:visuflow-plugin,代碼行數:28,代碼來源:BreakpointLocator.java

示例3: setMethod

import org.eclipse.jdt.core.IMethod; //導入方法依賴的package包/類
public void setMethod(IMethod method, InvocationAction a) {
	String key = null;
	try {
		IType type = (IType) method.getParent();
		key = type.getFullyQualifiedName() + "|" + method.getElementName() + method.getSignature();
	} catch (JavaModelException e) {
		e.printStackTrace();
	}
	if(key != null) {
		StaticInvocationWidget2 inv = invWidgetsMap.get(key);
		if(inv == null) {
			inv = new StaticInvocationWidget2(this, null, method, a);
			invWidgetsMap.put(key, inv);
		}
		inv.refreshItems();
		layout.topControl = inv;
		layout();
	}
}
 
開發者ID:andre-santos-pt,項目名稱:pandionj,代碼行數:20,代碼來源:InvokeWidget.java

示例4: setMethod

import org.eclipse.jdt.core.IMethod; //導入方法依賴的package包/類
public void setMethod(IFile file, IMethod method, InvocationAction a) {
	String key = null;
	try {
		IType type = (IType) method.getParent();
		key = type.getFullyQualifiedName() + "|" + method.getElementName() + method.getSignature();
	} catch (JavaModelException e) {
		e.printStackTrace();
	}
	if(key != null) {
		StaticInvocationWidget inv = invWidgetsMap.get(key);
		if(inv == null) {
			inv = new StaticInvocationWidget(this, file, method, a);
			invWidgetsMap.put(key, inv);
		}
		inv.refreshItems(file);
		layout.topControl = inv;
		layout();
	}
}
 
開發者ID:andre-santos-pt,項目名稱:pandionj,代碼行數:20,代碼來源:InvocationArea.java

示例5: getMethodKey

import org.eclipse.jdt.core.IMethod; //導入方法依賴的package包/類
private String getMethodKey(IMethod method) {
	try {
		IType type = (IType) method.getParent();
		return type.getFullyQualifiedName() + "|" + method.getElementName() + method.getSignature();
	} catch (JavaModelException e) {
		e.printStackTrace();
		return null;
	}
}
 
開發者ID:andre-santos-pt,項目名稱:pandionj,代碼行數:10,代碼來源:StaticInvocationWidget.java


注:本文中的org.eclipse.jdt.core.IMethod.getSignature方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。