当前位置: 首页>>代码示例>>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;未经允许,请勿转载。