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;
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 * 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
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
62 int getFlags() throws JavaModelException;
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).
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)
76 //ISourceRange getNameRange() throws JavaModelException;
78 * Returns whether this member is from a class file.
79 * This is a handle-only method.
81 * @return <code>true</code> if from a class file, and <code>false</code> if
82 * from a compilation unit