当前位置: 首页>>代码示例>>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;未经允许,请勿转载。