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