當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。