01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.jdt.core.jdom;
11:
12: /**
13: * Represents a Java compilation unit (source file with one of the
14: * {@link org.eclipse.jdt.core.JavaCore#getJavaLikeExtensions()
15: * Java-like extensions}).
16: * The corresponding syntactic unit is CompilationUnit (JLS2 7.3).
17: * Allowable child types for a compilation unit are <code>IDOMPackage</code>, <code>IDOMImport</code>,
18: * and <code>IDOMType</code>.
19: * <p>
20: * This interface is not intended to be implemented by clients.
21: * </p>
22: * @deprecated The JDOM was made obsolete by the addition in 2.0 of the more
23: * powerful, fine-grained DOM/AST API found in the
24: * org.eclipse.jdt.core.dom package.
25: */
26: public interface IDOMCompilationUnit extends IDOMNode {
27: /**
28: * Returns the header comment for this compilation unit. The header comment
29: * appears before the first declaration in a compilation unit.
30: * The syntax for a comment corresponds to Comments (JLS2 3.7), <b>including</b>
31: * comment delimiters.
32: *
33: * @return the header comment for this compilation unit, or <code>null</code> if
34: * no header comment is present
35: */
36: public String getHeader();
37:
38: /**
39: * The <code>IDOMCompilationNode</code> refinement of this <code>IDOMNode</code>
40: * method returns the name of this compilation unit.
41: *
42: * <p>The name of a compilation unit is the name of the first top-level public type
43: * defined in the compilation unit, suffixed with one of the
44: * {@link org.eclipse.jdt.core.JavaCore#getJavaLikeExtensions()
45: * Java-like extensions}. For example, if the first
46: * top-level public type defined in this compilation unit has the name "Hanoi",
47: * then name of this compilation unit is "Hanoi.java".</p>
48: *
49: * <p>In the absence of a public top-level type, the name of the first top-level
50: * type is used. In the absence of any type, the name of the compilation unit
51: * is <code>null</code>.</p>
52: *
53: * @return the name of this compilation unit, or <code>null</code> if none
54: */
55: public String getName();
56:
57: /**
58: * Sets the header comment for this compilation unit. The header comment
59: * appears before the first declaration in a compilation unit.
60: * The syntax for a comment corresponds to Comments (JLS2 3.7), <b>including</b>
61: * comment delimiters.
62: *
63: * @param comment the header comment for this compilation unit, or <code>null</code> if
64: * indicating no header comment
65: */
66: public void setHeader(String comment);
67:
68: /**
69: * The <code>IDOMCompilationNode</code> refinement of this <code>IDOMNode</code>
70: * method has no effect (the name is computed from the types declared within it).
71: *
72: * @param name the given name
73: */
74: public void setName(String name);
75: }
|