List of usage examples for org.eclipse.jdt.core.dom TypeDeclaration setSuperclass
public void setSuperclass(Name superclassName)
From source file:org.eclipse.objectteams.otdt.ui.tests.dom.rewrite.ASTRewriteFlattenerTest.java
License:Open Source License
private TypeDeclaration createTeam(Javadoc javadoc, int modifiers, boolean isInterface, boolean isRole, String teamClassName, String superClassName, List superInterfaces, List bodyDeclarations) { TypeDeclaration newTypeDecl = _newAst.newTypeDeclaration(); newTypeDecl.setName(_newAst.newSimpleName(teamClassName)); newTypeDecl.setTeam(true);//from www . j a v a 2 s . co m newTypeDecl.modifiers().addAll(_newAst.newModifiers(modifiers)); newTypeDecl.setRole(isRole); newTypeDecl.setInterface(isInterface); if (javadoc != null) newTypeDecl.setJavadoc(javadoc); if (superClassName != null) newTypeDecl.setSuperclass(_newAst.newSimpleName(superClassName)); if (superInterfaces != null && superInterfaces.size() != 0) { List superInterfacesList = newTypeDecl.superInterfaces(); for (int idx = 0; idx < superInterfaces.size(); idx++) { SimpleName tmp = (SimpleName) superInterfaces.get(idx); superInterfacesList.add(tmp); } } if (bodyDeclarations != null && bodyDeclarations.size() != 0) { List bodyDeclarationList = newTypeDecl.bodyDeclarations(); for (int idx = 0; idx < bodyDeclarations.size(); idx++) { Object tmp = bodyDeclarations.get(idx); bodyDeclarationList.add(tmp); } } return newTypeDecl; }