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


Java Name.isQualifiedName方法代码示例

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


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

示例1: getSimpleNameIdentifier

import org.eclipse.jdt.core.dom.Name; //导入方法依赖的package包/类
public static String getSimpleNameIdentifier(Name name) {
	if (name.isQualifiedName()) {
		return ((QualifiedName) name).getName().getIdentifier();
	} else {
		return ((SimpleName) name).getIdentifier();
	}
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:8,代码来源:ASTNodes.java

示例2: isDeclaration

import org.eclipse.jdt.core.dom.Name; //导入方法依赖的package包/类
public static boolean isDeclaration(Name name) {
	if (name.isQualifiedName()) {
		return ((QualifiedName) name).getName().isDeclaration();
	} else {
		return ((SimpleName) name).isDeclaration();
	}
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:8,代码来源:ASTNodes.java

示例3: typeRefFound

import org.eclipse.jdt.core.dom.Name; //导入方法依赖的package包/类
private void typeRefFound(Name node) {
	if (node != null) {
		while (node.isQualifiedName()) {
			node= ((QualifiedName) node).getQualifier();
		}
		addReference((SimpleName) node);
	}
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:9,代码来源:ImportReferencesCollector.java

示例4: possibleTypeRefFound

import org.eclipse.jdt.core.dom.Name; //导入方法依赖的package包/类
private void possibleTypeRefFound(Name node) {
	while (node.isQualifiedName()) {
		node= ((QualifiedName) node).getQualifier();
	}
	IBinding binding= node.resolveBinding();
	if (binding == null || binding.getKind() == IBinding.TYPE) {
		// if the binding is null, we cannot determine if
		// we have a type binding or not, so we will assume
		// we do.
		addReference((SimpleName) node);
	}
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:13,代码来源:ImportReferencesCollector.java

示例5: testNameEquals

import org.eclipse.jdt.core.dom.Name; //导入方法依赖的package包/类
private boolean testNameEquals(final Class<?> expected, final Name actual)
{
	if( actual.isQualifiedName() ) { //qualifiziert angegeben => teste gegen kanonischen Namen
		return actual.getFullyQualifiedName().equals(expected.getCanonicalName());
	} else { //simple Name, ohne qualifier => teste gegen simpleName aus class
		return actual.getFullyQualifiedName().equals(expected.getSimpleName());
	}
}
 
开发者ID:Ragnaroek,项目名称:eclipse-astparser,代码行数:9,代码来源:MethodExpression.java

示例6: typeRefFound

import org.eclipse.jdt.core.dom.Name; //导入方法依赖的package包/类
private void typeRefFound(Name node) {
  if (node != null) {
    while (node.isQualifiedName()) {
      node = ((QualifiedName) node).getQualifier();
    }
    addReference((SimpleName) node);
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:9,代码来源:ImportReferencesCollector.java

示例7: possibleTypeRefFound

import org.eclipse.jdt.core.dom.Name; //导入方法依赖的package包/类
private void possibleTypeRefFound(Name node) {
  while (node.isQualifiedName()) {
    node = ((QualifiedName) node).getQualifier();
  }
  IBinding binding = node.resolveBinding();
  if (binding == null || binding.getKind() == IBinding.TYPE) {
    // if the binding is null, we cannot determine if
    // we have a type binding or not, so we will assume
    // we do.
    addReference((SimpleName) node);
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:13,代码来源:ImportReferencesCollector.java

示例8: getSimpleNameIdentifier

import org.eclipse.jdt.core.dom.Name; //导入方法依赖的package包/类
public static String getSimpleNameIdentifier(Name name) {
  if (name.isQualifiedName()) {
    return ((QualifiedName) name).getName().getIdentifier();
  } else {
    return ((SimpleName) name).getIdentifier();
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:8,代码来源:ASTNodes.java

示例9: getQualifier

import org.eclipse.jdt.core.dom.Name; //导入方法依赖的package包/类
public static String getQualifier(Name name) {
	if (name.isQualifiedName()) {
		return ((QualifiedName) name).getQualifier().getFullyQualifiedName();
	}
	return ""; //$NON-NLS-1$
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:7,代码来源:ASTNodes.java

示例10: findSimilarElement

import org.eclipse.jdt.core.dom.Name; //导入方法依赖的package包/类
public static SimilarElement[] findSimilarElement(ICompilationUnit cu, Name name, int kind) throws JavaModelException {
	int pos= name.getStartPosition();
	int nArguments= -1;

	String identifier= ASTNodes.getSimpleNameIdentifier(name);
	String returnType= null;
	ICompilationUnit preparedCU= null;

	try {
		if (name.isQualifiedName()) {
			pos= ((QualifiedName) name).getName().getStartPosition();
		} else {
			pos= name.getStartPosition() + 1; // first letter must be included, other
		}
		Javadoc javadoc=  (Javadoc) ASTNodes.getParent(name, ASTNode.JAVADOC);
		if (javadoc != null) {
			preparedCU= createPreparedCU(cu, javadoc, name.getStartPosition());
			cu= preparedCU;
		}

		SimilarElementsRequestor requestor= new SimilarElementsRequestor(identifier, kind, nArguments, returnType);
		requestor.setIgnored(CompletionProposal.ANONYMOUS_CLASS_DECLARATION, true);
		requestor.setIgnored(CompletionProposal.ANONYMOUS_CLASS_CONSTRUCTOR_INVOCATION, true);
		requestor.setIgnored(CompletionProposal.KEYWORD, true);
		requestor.setIgnored(CompletionProposal.LABEL_REF, true);
		requestor.setIgnored(CompletionProposal.METHOD_DECLARATION, true);
		requestor.setIgnored(CompletionProposal.PACKAGE_REF, true);
		requestor.setIgnored(CompletionProposal.VARIABLE_DECLARATION, true);
		requestor.setIgnored(CompletionProposal.METHOD_REF, true);
		requestor.setIgnored(CompletionProposal.CONSTRUCTOR_INVOCATION, true);
		requestor.setIgnored(CompletionProposal.METHOD_REF_WITH_CASTED_RECEIVER, true);
		requestor.setIgnored(CompletionProposal.FIELD_REF, true);
		requestor.setIgnored(CompletionProposal.FIELD_REF_WITH_CASTED_RECEIVER, true);
		requestor.setIgnored(CompletionProposal.LOCAL_VARIABLE_REF, true);
		requestor.setIgnored(CompletionProposal.VARIABLE_DECLARATION, true);
		requestor.setIgnored(CompletionProposal.VARIABLE_DECLARATION, true);
		requestor.setIgnored(CompletionProposal.POTENTIAL_METHOD_DECLARATION, true);
		requestor.setIgnored(CompletionProposal.METHOD_NAME_REFERENCE, true);
		return requestor.process(cu, pos);
	} finally {
		if (preparedCU != null) {
			preparedCU.discardWorkingCopy();
		}
	}
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:46,代码来源:SimilarElementsRequestor.java

示例11: findSimilarElement

import org.eclipse.jdt.core.dom.Name; //导入方法依赖的package包/类
public static SimilarElement[] findSimilarElement(ICompilationUnit cu, Name name, int kind)
    throws JavaModelException {
  int pos = name.getStartPosition();
  int nArguments = -1;

  String identifier = ASTNodes.getSimpleNameIdentifier(name);
  String returnType = null;
  ICompilationUnit preparedCU = null;

  try {
    if (name.isQualifiedName()) {
      pos = ((QualifiedName) name).getName().getStartPosition();
    } else {
      pos = name.getStartPosition() + 1; // first letter must be included, other
    }
    Javadoc javadoc = (Javadoc) ASTNodes.getParent(name, ASTNode.JAVADOC);
    if (javadoc != null) {
      preparedCU = createPreparedCU(cu, javadoc, name.getStartPosition());
      cu = preparedCU;
    }

    SimilarElementsRequestor requestor =
        new SimilarElementsRequestor(identifier, kind, nArguments, returnType);
    requestor.setIgnored(CompletionProposal.ANONYMOUS_CLASS_DECLARATION, true);
    requestor.setIgnored(CompletionProposal.ANONYMOUS_CLASS_CONSTRUCTOR_INVOCATION, true);
    requestor.setIgnored(CompletionProposal.KEYWORD, true);
    requestor.setIgnored(CompletionProposal.LABEL_REF, true);
    requestor.setIgnored(CompletionProposal.METHOD_DECLARATION, true);
    requestor.setIgnored(CompletionProposal.PACKAGE_REF, true);
    requestor.setIgnored(CompletionProposal.VARIABLE_DECLARATION, true);
    requestor.setIgnored(CompletionProposal.METHOD_REF, true);
    requestor.setIgnored(CompletionProposal.CONSTRUCTOR_INVOCATION, true);
    requestor.setIgnored(CompletionProposal.METHOD_REF_WITH_CASTED_RECEIVER, true);
    requestor.setIgnored(CompletionProposal.FIELD_REF, true);
    requestor.setIgnored(CompletionProposal.FIELD_REF_WITH_CASTED_RECEIVER, true);
    requestor.setIgnored(CompletionProposal.LOCAL_VARIABLE_REF, true);
    requestor.setIgnored(CompletionProposal.VARIABLE_DECLARATION, true);
    requestor.setIgnored(CompletionProposal.VARIABLE_DECLARATION, true);
    requestor.setIgnored(CompletionProposal.POTENTIAL_METHOD_DECLARATION, true);
    requestor.setIgnored(CompletionProposal.METHOD_NAME_REFERENCE, true);
    return requestor.process(cu, pos);
  } finally {
    if (preparedCU != null) {
      preparedCU.discardWorkingCopy();
    }
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:48,代码来源:SimilarElementsRequestor.java


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