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