1 /*******************************************************************************
2 * Copyright (c) 2000, 2001, 2002 International Business Machines Corp. and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v0.5
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v05.html
9 * IBM Corporation - initial API and implementation
10 ******************************************************************************/
11 package net.sourceforge.phpdt.core;
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>.
18 * This interface is not intended to be implemented by clients.
21 public interface IMember extends IJavaElement, ISourceReference, ISourceManipulation {
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.
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)
30 // IClassFile getClassFile();
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.
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)
39 ICompilationUnit getCompilationUnit();
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.
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)
48 IType getDeclaringType();
50 * Returns the modifier flags for this member. The flags can be examined using class
53 * @exception JavaModelException if this element does not exist or if an
54 * exception occurs while accessing its corresponding resource.
55 * @return the modifier flags for this member
58 int getFlags() throws JavaModelException;
60 * Returns the source range of this member's simple name,
61 * or <code>null</code> if this member does not have a name
62 * (for example, an initializer), or if this member does not have
63 * associated source code (for example, a binary type).
65 * @exception JavaModelException if this element does not exist or if an
66 * exception occurs while accessing its corresponding resource.
67 * @return the source range of this member's simple name,
68 * or <code>null</code> if this member does not have a name
69 * (for example, an initializer), or if this member does not have
70 * associated source code (for example, a binary type)
72 ISourceRange getNameRange() throws JavaModelException;
74 * Returns whether this member is from a class file.
75 * This is a handle-only method.
77 * @return <code>true</code> if from a class file, and <code>false</code> if
78 * from a compilation unit