new version with WorkingCopy Management
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / core / IMember.java
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
7  * 
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11 package net.sourceforge.phpdt.core;
12
13 /**
14  * Common protocol for Java elements that can be members of types.
15  * This set consists of <code>IType</code>, <code>IMethod</code>, 
16  * <code>IField</code>, and <code>IInitializer</code>.
17  * <p>
18  * This interface is not intended to be implemented by clients.
19  * </p>
20  */
21 public interface IMember extends IJavaElement , ISourceReference, ISourceManipulation {
22 /**
23  * Returns the class file in which this member is declared, or <code>null</code>
24  * if this member is not declared in a class file (for example, a source type).
25  * This is a handle-only method.
26  * 
27  * @return the class file in which this member is declared, or <code>null</code>
28  * if this member is not declared in a class file (for example, a source type)
29  */
30 //IClassFile getClassFile();
31 /**
32  * Returns the compilation unit in which this member is declared, or <code>null</code>
33  * if this member is not declared in a compilation unit (for example, a binary type).
34  * This is a handle-only method.
35  * 
36  * @return the compilation unit in which this member is declared, or <code>null</code>
37  * if this member is not declared in a compilation unit (for example, a binary type)
38  */
39 ICompilationUnit getCompilationUnit();
40 /**
41  * Returns the type in which this member is declared, or <code>null</code>
42  * if this member is not declared in a type (for example, a top-level type).
43  * This is a handle-only method.
44  * 
45  * @return the type in which this member is declared, or <code>null</code>
46  * if this member is not declared in a type (for example, a top-level type)
47  */
48  IType getDeclaringType();
49 /**
50  * Returns the modifier flags for this member. The flags can be examined using class
51  * <code>Flags</code>.
52  * <p>
53  * Note that only flags as indicated in the source are returned. Thus if an interface
54  * defines a method <code>void myMethod();</code> the flags don't include the
55  * 'public' flag.
56  *
57  * @exception JavaModelException if this element does not exist or if an
58  *      exception occurs while accessing its corresponding resource.
59  * @return the modifier flags for this member
60  * @see Flags
61  */
62 int getFlags() throws JavaModelException;
63 /**
64  * Returns the source range of this member's simple name,
65  * or <code>null</code> if this member does not have a name
66  * (for example, an initializer), or if this member does not have
67  * associated source code (for example, a binary type).
68  *
69  * @exception JavaModelException if this element does not exist or if an
70  *      exception occurs while accessing its corresponding resource.
71  * @return the source range of this member's simple name,
72  * or <code>null</code> if this member does not have a name
73  * (for example, an initializer), or if this member does not have
74  * associated source code (for example, a binary type)
75  */
76 ISourceRange getNameRange() throws JavaModelException;
77 /**
78  * Returns whether this member is from a class file.
79  * This is a handle-only method.
80  *
81  * @return <code>true</code> if from a class file, and <code>false</code> if
82  *   from a compilation unit
83  */
84 boolean isBinary();
85 }