/** * Adds the given type declaration to the compilation unit. The list of * types will be initialized if it is <code>null</code>. * * @param cu * compilation unit * @param type * type declaration */ public static void addTypeDeclaration(CompilationUnit cu, TypeDeclaration type) { List<TypeDeclaration> types = cu.getTypes(); if (types == null) { types = new ArrayList<TypeDeclaration>(); cu.setTypes(types); } types.add(type); }
public CompilationUnit(PackageDeclaration pakage, List<ImportDeclaration> imports, List<TypeDeclaration> types) { setPackage(pakage); setImports(imports); setTypes(types); }
public CompilationUnit(int beginLine, int beginColumn, int endLine, int endColumn, PackageDeclaration pakage, List<ImportDeclaration> imports, List<TypeDeclaration> types) { super(beginLine, beginColumn, endLine, endColumn); setPackage(pakage); setImports(imports); setTypes(types); }