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).
15 * The corresponding syntactic unit is CompilationUnit (JLS2 7.3).
16 * Allowable child types for a compilation unit are <code>IDOMPackage</code>, <code>IDOMImport</code>,
17 * 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.
26 * The syntax for a comment corresponds to Comments (JLS2 3.7), <b>including</b>
29 * @return the header comment for this compilation unit, or <code>null</code> if
30 * no header comment is present
32 public String getHeader();
34 * The <code>IDOMCompilationNode</code> refinement of this <code>IDOMNode</code>
35 * method returns the name of this compilation unit.
37 * <p>The name of a compilation unit is the name of the first top-level public type
38 * defined in the compilation unit, suffixed with ".java". For example, if the first
39 * top-level public type defined in this compilation unit has the name "Hanoi",
40 * then name of this compilation unit is "Hanoi.java".</p>
42 * <p>In the absence of a public top-level type, the name of the first top-level
43 * type is used. In the absence of any type, the name of the compilation unit
44 * is <code>null</code>.</p>
46 * @return the name of this compilation unit, or <code>null</code> if none
48 public String getName();
50 * Sets the header comment for this compilation unit. The header comment
51 * appears before the first declaration in a compilation unit.
52 * The syntax for a comment corresponds to Comments (JLS2 3.7), <b>including</b>
55 * @param comment the header comment for this compilation unit, or <code>null</code> if
56 * indicating no header comment
58 public void setHeader(String comment);
60 * The <code>IDOMCompilationNode</code> refinement of this <code>IDOMNode</code>
61 * method has no effect (the name is computed from the types declared within it).
63 public void setName(String name);