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


Java TypeDeclaration.superInterfaceTypes方法代码示例

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


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

示例1: getAllSuperTypes

import org.eclipse.jdt.core.dom.TypeDeclaration; //导入方法依赖的package包/类
public List getAllSuperTypes(TypeDeclaration typeDeclaration) {
	List list = new ArrayList();

	Type superclassType = typeDeclaration.getSuperclassType();
	if (superclassType != null) {
		list.add(superclassType);
	}

	List superInterfaceTypes = typeDeclaration.superInterfaceTypes();

	for (Iterator itSuperInterfacesIterator = superInterfaceTypes.iterator(); itSuperInterfacesIterator.hasNext();) {
		Object next = itSuperInterfacesIterator.next();
		if (next instanceof SimpleType) {
			list.add(next);
		}
	}
	return list;
}
 
开发者ID:aroog,项目名称:code,代码行数:19,代码来源:SaveAnnotations.java

示例2: visitInterface

import org.eclipse.jdt.core.dom.TypeDeclaration; //导入方法依赖的package包/类
private boolean visitInterface(TypeDeclaration node) {

        InterfaceInfo interfaceInfo = new InterfaceInfo();
        interfaceInfo.name = node.getName().getFullyQualifiedName();
        interfaceInfo.fullName = NameResolver.getFullName(node);
        interfaceInfo.visibility = getVisibility(node);
        List<Type> superInterfaceList = node.superInterfaceTypes();
        for (Type superInterface : superInterfaceList)
            interfaceInfo.superInterfaceTypeList.add(NameResolver.getFullName(superInterface));
        if (node.getJavadoc() != null)
            interfaceInfo.comment = sourceContent.substring(node.getJavadoc().getStartPosition(), node.getJavadoc().getStartPosition() + node.getJavadoc().getLength());
        interfaceInfo.content = sourceContent.substring(node.getStartPosition(), node.getStartPosition() + node.getLength());
        elementInfoPool.interfaceInfoMap.put(interfaceInfo.fullName, interfaceInfo);

        MethodDeclaration[] methodDeclarations = node.getMethods();
        for (MethodDeclaration methodDeclaration : methodDeclarations) {
            MethodInfo methodInfo = createMethodInfo(methodDeclaration, interfaceInfo.fullName);
            elementInfoPool.methodInfoMap.put(methodInfo.hashName(), methodInfo);
        }

        FieldDeclaration[] fieldDeclarations = node.getFields();
        for (FieldDeclaration fieldDeclaration : fieldDeclarations) {
            List<FieldInfo> fieldInfos = createFieldInfos(fieldDeclaration, interfaceInfo.fullName);
            for (FieldInfo fieldInfo : fieldInfos)
                elementInfoPool.fieldInfoMap.put(fieldInfo.hashName(), fieldInfo);
        }
        return true;
    }
 
开发者ID:linzeqipku,项目名称:SnowGraph,代码行数:29,代码来源:JavaASTVisitor.java

示例3: visitClass

import org.eclipse.jdt.core.dom.TypeDeclaration; //导入方法依赖的package包/类
private boolean visitClass(TypeDeclaration node) {

        ClassInfo classInfo = new ClassInfo();
        classInfo.name = node.getName().getFullyQualifiedName();
        classInfo.fullName = NameResolver.getFullName(node);
        classInfo.visibility = getVisibility(node);
        classInfo.isAbstract = isAbstract(node);
        classInfo.isFinal = isFinal(node);
        classInfo.superClassType = node.getSuperclassType() == null ? "java.lang.Object" : NameResolver.getFullName(node.getSuperclassType());
        List<Type> superInterfaceList = node.superInterfaceTypes();
        for (Type superInterface : superInterfaceList)
            classInfo.superInterfaceTypeList.add(NameResolver.getFullName(superInterface));
        if (node.getJavadoc() != null)
            classInfo.comment = sourceContent.substring(node.getJavadoc().getStartPosition(), node.getJavadoc().getStartPosition() + node.getJavadoc().getLength());
        classInfo.content = sourceContent.substring(node.getStartPosition(), node.getStartPosition() + node.getLength());
        elementInfoPool.classInfoMap.put(classInfo.fullName, classInfo);

        MethodDeclaration[] methodDeclarations = node.getMethods();
        for (MethodDeclaration methodDeclaration : methodDeclarations) {
            MethodInfo methodInfo = createMethodInfo(methodDeclaration, classInfo.fullName);
            elementInfoPool.methodInfoMap.put(methodInfo.hashName(), methodInfo);
        }

        FieldDeclaration[] fieldDeclarations = node.getFields();
        for (FieldDeclaration fieldDeclaration : fieldDeclarations) {
            List<FieldInfo> fieldInfos = createFieldInfos(fieldDeclaration, classInfo.fullName);
            for (FieldInfo fieldInfo : fieldInfos)
                elementInfoPool.fieldInfoMap.put(fieldInfo.hashName(), fieldInfo);
        }
        return true;
    }
 
开发者ID:linzeqipku,项目名称:SnowGraph,代码行数:32,代码来源:JavaASTVisitor.java


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