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