本文整理汇总了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));
}
}
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}