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


Java SimpleName.isDeclaration方法代码示例

本文整理汇总了Java中org.eclipse.jdt.core.dom.SimpleName.isDeclaration方法的典型用法代码示例。如果您正苦于以下问题:Java SimpleName.isDeclaration方法的具体用法?Java SimpleName.isDeclaration怎么用?Java SimpleName.isDeclaration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jdt.core.dom.SimpleName的用法示例。


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

示例1: endVisit

import org.eclipse.jdt.core.dom.SimpleName; //导入方法依赖的package包/类
@Override
public void endVisit(SimpleName node) {
	if (skipNode(node) || node.isDeclaration()) {
		return;
	}
	IBinding binding = node.resolveBinding();
	if (binding instanceof IVariableBinding) {
		IVariableBinding variable = (IVariableBinding) binding;
		if (!variable.isField()) {
			setFlowInfo(node, new LocalFlowInfo(variable, FlowInfo.READ, fFlowContext));
		}
	} else if (binding instanceof ITypeBinding) {
		ITypeBinding type = (ITypeBinding) binding;
		if (type.isTypeVariable()) {
			setFlowInfo(node, new TypeVariableFlowInfo(type, fFlowContext));
		}
	}
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:19,代码来源:FlowAnalyzer.java

示例2: visit

import org.eclipse.jdt.core.dom.SimpleName; //导入方法依赖的package包/类
@Override
public boolean visit(SimpleName node) {
	if (currentMethod == null)
		return false;
	IBinding binding = node.resolveBinding();
	if (binding == null)
		return false;
	if (node.isDeclaration())
		return true;
	if (node.resolveBinding() instanceof IVariableBinding) {
		IVariableBinding iVariableBinding = (IVariableBinding) node.resolveBinding();
		if (iVariableBinding.isField()) {
			IVariableBinding variableDeclarationBinding = iVariableBinding.getVariableDeclaration();
			if (variableDeclarationBinding.getDeclaringClass() != null) {
				IJavaElement accessedField = variableDeclarationBinding.getJavaElement();
				if (accessedField instanceof IField) {
					if (!((IField) accessedField).isReadOnly())
						methodDetails.addAccess((IField) accessedField);
				}
			}
		}
	}
	return true;
}
 
开发者ID:ioanaverebi,项目名称:Sparrow,代码行数:25,代码来源:OutCodeVisitor.java

示例3: match

import org.eclipse.jdt.core.dom.SimpleName; //导入方法依赖的package包/类
@Override
public boolean match(SimpleName candidate, Object s) {
	if (!(s instanceof SimpleName)) {
		return false;
	}

	SimpleName snippet = (SimpleName) s;
	if (candidate.isDeclaration() != snippet.isDeclaration()) {
		return false;
	}

	IBinding cb = candidate.resolveBinding();
	IBinding sb = snippet.resolveBinding();
	if (cb == null || sb == null) {
		return false;
	}
	IVariableBinding vcb = ASTNodes.getVariableBinding(candidate);
	IVariableBinding vsb = ASTNodes.getVariableBinding(snippet);
	if (vcb == null || vsb == null) {
		return Bindings.equals(cb, sb);
	}
	if (!vcb.isField() && !vsb.isField() && Bindings.equals(vcb.getType(), vsb.getType())) {
		SimpleName mapped = fMatch.getMappedName(vsb);
		if (mapped != null) {
			IVariableBinding mappedBinding = ASTNodes.getVariableBinding(mapped);
			if (!Bindings.equals(vcb, mappedBinding)) {
				return false;
			}
		}
		fMatch.addLocal(vsb, candidate);
		return true;
	}
	return Bindings.equals(cb, sb);
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:35,代码来源:SnippetFinder.java

示例4: visit

import org.eclipse.jdt.core.dom.SimpleName; //导入方法依赖的package包/类
@Override
public boolean visit(SimpleName node) {
	if (node.isDeclaration()) {
		return true;
	}
	IBinding binding = node.resolveBinding();
	if (binding instanceof ITypeBinding) {
		processLocalTypeBinding((ITypeBinding) binding, fSelection.getVisitSelectionMode(node));
	}

	return true;
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:13,代码来源:LocalTypeAnalyzer.java

示例5: visit

import org.eclipse.jdt.core.dom.SimpleName; //导入方法依赖的package包/类
@Override
public boolean visit(SimpleName node) {
	IVariableBinding binding = null;
	if (node.isDeclaration() || !considerNode(node) || (binding = ASTNodes.getLocalVariableBinding(node)) == null) {
		return false;
	}
	handleReferenceToLocal(node, binding);
	return true;
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:10,代码来源:LocalDeclarationAnalyzer.java


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