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