Organized imports
[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 /**
15  * Common protocol for Java elements that can be members of types.
16  * This set consists of <code>IType</code>, <code>IMethod</code>, 
17  * <code>IField</code>, and <code>IInitializer</code>.
18  * <p>
19  * This interface is not intended to be implemented by clients.
20  * </p>
21  */
22 public interface IMember extends IJavaElement , ISourceReference, ISourceManipulation, IParent {
23 /**
24  * Returns the class file in which this member is declared, or <code>null</code>
25  * if this member is not declared in a class file (for example, a source type).
26  * This is a handle-only method.
27  * 
28  * @return the class file in which this member is declared, or <code>null</code>
29  * if this member is not declared in a class file (for example, a source type)
30  */
31 //IClassFile getClassFile();
32 /**
33  * Returns the compilation unit in which this member is declared, or <code>null</code>
34  * if this member is not declared in a compilation unit (for example, a binary type).
35  * This is a handle-only method.
36  * 
37  * @return the compilation unit in which this member is declared, or <code>null</code>
38  * if this member is not declared in a compilation unit (for example, a binary type)
39  */
40 ICompilationUnit getCompilationUnit();
41 /**
42  * Returns the type in which this member is declared, or <code>null</code>
43  * if this member is not declared in a type (for example, a top-level type).
44  * This is a handle-only method.
45  * 
46  * @return the type in which this member is declared, or <code>null</code>
47  * if this member is not declared in a type (for example, a top-level type)
48  */
49  IType getDeclaringType();
50 /**
51  * Returns the modifier flags for this member. The flags can be examined using class
52  * <code>Flags</code>.
53  * <p>
54  * Note that only flags as indicated in the source are returned. Thus if an interface
55  * defines a method <code>void myMethod();</code> the flags don't include the
56  * 'public' flag.
57  *
58  * @exception JavaModelException if this element does not exist or if an
59  *      exception occurs while accessing its corresponding resource.
60  * @return the modifier flags for this member
61  * @see Flags
62  */
63 int getFlags() throws JavaModelException;
64 /**
65  * Returns the source range of this member's simple name,
66  * or <code>null</code> if this member does not have a name
67  * (for example, an initializer), or if this member does not have
68  * associated source code (for example, a binary type).
69  *
70  * @exception JavaModelException if this element does not exist or if an
71  *      exception occurs while accessing its corresponding resource.
72  * @return the source range of this member's simple name,
73  * or <code>null</code> if this member does not have a name
74  * (for example, an initializer), or if this member does not have
75  * associated source code (for example, a binary type)
76  */
77 ISourceRange getNameRange() throws JavaModelException;
78 /**
79  * Returns the local or anonymous type declared in this source member with the given simple name and/or
80  * with the specified position relative to the order they are defined in the source.
81  * The name is empty if it is an anonymous type.
82  * Numbering starts at 1 (thus the first occurrence is occurrence 1, not occurrence 0).
83  * This is a handle-only method. The type may or may not exist.
84  * Throws a <code>RuntimeException</code> if this member is not a source member.
85  * 
86  * @param name the given simple name
87  * @param occurrenceCount the specified position
88  * @return the type with the given name and/or with the specified position relative to the order they are defined in the source
89  * @since 3.0
90  */
91 IType getType(String name, int occurrenceCount);
92 /**
93  * Returns whether this member is from a class file.
94  * This is a handle-only method.
95  *
96  * @return <code>true</code> if from a class file, and <code>false</code> if
97  *   from a compilation unit
98  */
99 boolean isBinary();
100 }