當前位置: 首頁>>代碼示例>>Java>>正文


Java TypeDeclaration.resolveBinding方法代碼示例

本文整理匯總了Java中org.eclipse.jdt.core.dom.TypeDeclaration.resolveBinding方法的典型用法代碼示例。如果您正苦於以下問題:Java TypeDeclaration.resolveBinding方法的具體用法?Java TypeDeclaration.resolveBinding怎麽用?Java TypeDeclaration.resolveBinding使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.jdt.core.dom.TypeDeclaration的用法示例。


在下文中一共展示了TypeDeclaration.resolveBinding方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: visit

import org.eclipse.jdt.core.dom.TypeDeclaration; //導入方法依賴的package包/類
@Override
public boolean visit(TypeDeclaration node) {

	ITypeBinding resolveBinding = node.resolveBinding();
	for (ITypeBinding a : newExpression) {
		isInstantiated = true;
		isNewExpression.put(a, String.valueOf(isInstantiated));
	}

	if (!newExpression.contains(resolveBinding.getQualifiedName())) {
		isInstantiated = false;
		isNewExpression.put(resolveBinding, String.valueOf(isInstantiated));
	}
	
	//System.out.println("sdfgfg" + isNewExpression);
	return super.visit(node);
}
 
開發者ID:aroog,項目名稱:code,代碼行數:18,代碼來源:NoAnnotatMetrics.java

示例2: traverseTypeDecl

import org.eclipse.jdt.core.dom.TypeDeclaration; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
private void traverseTypeDecl(TypeDeclaration declaration) {

	// Create the types from the ITypeBinding
	ITypeBinding typeBinding = declaration.resolveBinding();
	Type astType = Type.createFrom(typeBinding);
	typeInfo.reviveTypeFromBinding(astType, typeBinding);
}
 
開發者ID:aroog,項目名稱:code,代碼行數:9,代碼來源:NoAnnotatMetrics.java

示例3: traverseType

import org.eclipse.jdt.core.dom.TypeDeclaration; //導入方法依賴的package包/類
private void traverseType(TypeDeclaration declaration, boolean takesParams) {

		// Add default mapping to model
		String typeName = null;
		ITypeBinding tb = declaration.resolveBinding();
		if (Config.USE_QUALIFIED_TYPENAME) {
			typeName = tb.getQualifiedName();
		}
		else {
			typeName = declaration.getName().toString();
		}
		// Add the interfaces and the classes without superClass to the map
		// file.
		// HACK: This is a very bad idea. The tool does not generate
		// @DomainParams for classes that inherit from a
		// built-in type! Fix it!
		// This is an example of a premature optimization (minimizing the size
		// of the map) gone bad. The focus should be
		// on correctness first.
		if (!model.hasMapping(typeName) && getAllSuperTypes(declaration).size() == 0) {
			model.addMapping(new Entry(typeName));
		}

		List<Type> allSuperTypes = getAllSuperTypes(declaration);
		for (Type type : allSuperTypes) {
			ITypeBinding stb = type.resolveBinding();
			String superTypeName = stb.getQualifiedName();
			if (!model.hasMapping(superTypeName)) {
				model.addMapping(new Entry(superTypeName));
			}
		}

		TypeDeclaration[] nestedTypes = declaration.getTypes();
		for (int i = 0; i < nestedTypes.length; i++) {
			TypeDeclaration nestedType = nestedTypes[i];
			traverseType(nestedType, false);
		}
	}
 
開發者ID:aroog,項目名稱:code,代碼行數:39,代碼來源:GenerateDefaultMap.java

示例4: visit

import org.eclipse.jdt.core.dom.TypeDeclaration; //導入方法依賴的package包/類
@Override
   public boolean visit(TypeDeclaration node) {
	ITypeBinding typeBinding = node.resolveBinding();
	addNewBinding(typeBinding, node);
	addNewTypeBinding(typeBinding);
	
	return true;
}
 
開發者ID:aroog,項目名稱:code,代碼行數:9,代碼來源:WorkspaceUtilities.java

示例5: findEnclosingClassName

import org.eclipse.jdt.core.dom.TypeDeclaration; //導入方法依賴的package包/類
/**
 * 
 * @param node: ASTNode corresponding to the TAC instruction that is being analyzed
 * @return The qualified name of the enclosing class of the TAC instruction that is being analyzed
 */
private String findEnclosingClassName(ASTNode node) {
	while(!(node instanceof TypeDeclaration)){
		node=node.getParent();
	}
	TypeDeclaration enclosingType = (TypeDeclaration)node;
	ITypeBinding enclosingClass = enclosingType.resolveBinding();
	String encClassName = enclosingClass.getQualifiedName();
	return encClassName;
}
 
開發者ID:aroog,項目名稱:code,代碼行數:15,代碼來源:PushIntoOwnedTransferFunctions.java

示例6: findEnclosingClassName

import org.eclipse.jdt.core.dom.TypeDeclaration; //導入方法依賴的package包/類
/**
 * 
 * @param node: ASTNode corresponding to the TAC instruction that is being analyzed
 * @return The qualified name of the enclosing class of the TAC instruction that is being analyzed
 */
public static String findEnclosingClassName(ASTNode node) {
	while(!(node instanceof TypeDeclaration)){
		node=node.getParent();
	}
	TypeDeclaration enclosingType = (TypeDeclaration)node;
	ITypeBinding enclosingClass = enclosingType.resolveBinding();
	String encClassName = enclosingClass.getQualifiedName();
	return encClassName;
}
 
開發者ID:aroog,項目名稱:code,代碼行數:15,代碼來源:Utils.java

示例7: findEnclosingClassBinding

import org.eclipse.jdt.core.dom.TypeDeclaration; //導入方法依賴的package包/類
/**
 * 
 * @param node: ASTNode corresponding to the TAC instruction that is being analyzed
 * @return The type binding of the enclosing class of the TAC instruction that is being analyzed
 */
public static ITypeBinding findEnclosingClassBinding(ASTNode node) {
	while(!(node instanceof TypeDeclaration)){
		node=node.getParent();
	}
	TypeDeclaration enclosingType = (TypeDeclaration)node;
	ITypeBinding enclosingClass = enclosingType.resolveBinding();
	return enclosingClass;
}
 
開發者ID:aroog,項目名稱:code,代碼行數:14,代碼來源:Utils.java

示例8: visit

import org.eclipse.jdt.core.dom.TypeDeclaration; //導入方法依賴的package包/類
@Override
public boolean visit(TypeDeclaration typeDeclaration) {
	ITypeBinding binding = typeDeclaration.resolveBinding();
	if (binding != null) {
		IType type = (IType) binding.getJavaElement();
		TypeDetails typeDetails = new TypeDetails();
		typeDetails.setModifiers(typeDeclaration.getModifiers());
		allDetails.put(type.getHandleIdentifier(), typeDetails);
	}
	return true;
}
 
開發者ID:ioanaverebi,項目名稱:Sparrow,代碼行數:12,代碼來源:OutCodeVisitor.java


注:本文中的org.eclipse.jdt.core.dom.TypeDeclaration.resolveBinding方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。