1 /*******************************************************************************
2 * Copyright (c) 2000, 2003 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v10.html
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package net.sourceforge.phpdt.core.jdom;
14 * Represents a Java compilation unit (<code>.java</code> source file). The
15 * corresponding syntactic unit is CompilationUnit (JLS2 7.3). Allowable child
16 * types for a compilation unit are <code>IDOMPackage</code>,
17 * <code>IDOMImport</code>, and <code>IDOMType</code>.
19 * This interface is not intended to be implemented by clients.
22 public interface IDOMCompilationUnit extends IDOMNode {
24 * Returns the header comment for this compilation unit. The header comment
25 * appears before the first declaration in a compilation unit. The syntax
26 * for a comment corresponds to Comments (JLS2 3.7), <b>including</b>
29 * @return the header comment for this compilation unit, or
30 * <code>null</code> if no header comment is present
32 public String getHeader();
35 * The <code>IDOMCompilationNode</code> refinement of this
36 * <code>IDOMNode</code> method returns the name of this compilation unit.
39 * The name of a compilation unit is the name of the first top-level public
40 * type defined in the compilation unit, suffixed with ".java". For example,
41 * if the first top-level public type defined in this compilation unit has
42 * the name "Hanoi", then name of this compilation unit is "Hanoi.java".
46 * In the absence of a public top-level type, the name of the first
47 * top-level type is used. In the absence of any type, the name of the
48 * compilation unit is <code>null</code>.
51 * @return the name of this compilation unit, or <code>null</code> if none
53 public String getName();
56 * Sets the header comment for this compilation unit. The header comment
57 * appears before the first declaration in a compilation unit. The syntax
58 * for a comment corresponds to Comments (JLS2 3.7), <b>including</b>
62 * the header comment for this compilation unit, or
63 * <code>null</code> if indicating no header comment
65 public void setHeader(String comment);
68 * The <code>IDOMCompilationNode</code> refinement of this
69 * <code>IDOMNode</code> method has no effect (the name is computed from
70 * the types declared within it).
72 public void setName(String name);