org.eclipse.jdt.internal.core
Class Member

java.lang.Object
  extended by org.eclipse.core.runtime.PlatformObject
      extended by org.eclipse.jdt.internal.core.JavaElement
          extended by org.eclipse.jdt.internal.core.SourceRefElement
              extended by org.eclipse.jdt.internal.core.Member
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, IJavaElement, IMember, IParent, ISourceManipulation, ISourceReference
Direct Known Subclasses:
Initializer, NamedMember

public abstract class Member
extends SourceRefElement
implements IMember

See Also:
IMember

Field Summary
 
Fields inherited from class org.eclipse.jdt.internal.core.SourceRefElement
occurrenceCount
 
Fields inherited from class org.eclipse.jdt.internal.core.JavaElement
JEM_ANNOTATION, JEM_CLASSFILE, JEM_COMPILATIONUNIT, JEM_COUNT, JEM_ESCAPE, JEM_FIELD, JEM_IMPORTDECLARATION, JEM_INITIALIZER, JEM_JAVAPROJECT, JEM_LOCALVARIABLE, JEM_METHOD, JEM_PACKAGEDECLARATION, JEM_PACKAGEFRAGMENT, JEM_PACKAGEFRAGMENTROOT, JEM_TYPE, JEM_TYPE_PARAMETER
 
Fields inherited from interface org.eclipse.jdt.core.IJavaElement
ANNOTATION, CLASS_FILE, COMPILATION_UNIT, FIELD, IMPORT_CONTAINER, IMPORT_DECLARATION, INITIALIZER, JAVA_MODEL, JAVA_PROJECT, LOCAL_VARIABLE, METHOD, PACKAGE_DECLARATION, PACKAGE_FRAGMENT, PACKAGE_FRAGMENT_ROOT, TYPE, TYPE_PARAMETER
 
Method Summary
static IMethod[] findMethods(IMethod method, IMethod[] methods)
           
 java.lang.String[] getCategories()
          Returns the categories defined by this member's Javadoc.
 IClassFile getClassFile()
          Returns the class file in which this member is declared, or null if this member is not declared in a class file (for example, a source type).
 IType getDeclaringType()
          Returns the type in which this member is declared, or null if this member is not declared in a type (for example, a top-level type).
 int getFlags()
          Returns the modifier flags for this member.
 IJavaElement getHandleFromMemento(java.lang.String token, MementoTokenizer memento, WorkingCopyOwner workingCopyOwner)
           
 ISourceRange getJavadocRange()
          Returns the Javadoc range if this element is from source or if this element is a binary element with an attached source, null otherwise.
 ISourceRange getNameRange()
          Returns the source range of this member's simple name, or null if this member does not have a name (for example, an initializer), or if this member does not have associated source code (for example, a binary type).
 Member getOuterMostLocalContext()
           
 IType getType(java.lang.String typeName, int count)
          Returns the local or anonymous type declared in this source member with the given simple name and/or with the specified position relative to the order they are defined in the source.
 ITypeRoot getTypeRoot()
          Returns the Java type root in which this member is declared.
 boolean isBinary()
          Returns whether this member is from a class file.
 boolean isReadOnly()
          Returns whether this Java element is read-only.
 java.lang.String readableName()
           
 
Methods inherited from class org.eclipse.jdt.internal.core.SourceRefElement
copy, delete, equals, findNode, getAnnotation, getAnnotations, getCompilationUnit, getCorrespondingResource, getHandleUpdatingCountFromMemento, getOccurrenceCount, getOpenableParent, getPath, getSource, getSourceRange, getUnderlyingResource, hasChildren, isStructureKnown, move, rename, resource
 
Methods inherited from class org.eclipse.jdt.internal.core.JavaElement
close, exists, getAncestor, getAttachedJavadoc, getChildren, getChildrenOfType, getElementInfo, getElementInfo, getElementName, getHandleFromMemento, getHandleIdentifier, getHandleMemento, getJavaModel, getJavaProject, getOpenable, getParent, getPrimaryElement, getPrimaryElement, getResource, getSchedulingRule, getSourceMapper, hashCode, isAncestorOf, newJavaModelException, newNotPresentException, resolved, toDebugString, toString, toStringInfo, toStringWithAncestors, toStringWithAncestors, unresolved
 
Methods inherited from class org.eclipse.core.runtime.PlatformObject
getAdapter
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.jdt.core.IMember
getCompilationUnit, getOccurrenceCount
 
Methods inherited from interface org.eclipse.jdt.core.IJavaElement
exists, getAncestor, getAttachedJavadoc, getCorrespondingResource, getElementName, getElementType, getHandleIdentifier, getJavaModel, getJavaProject, getOpenable, getParent, getPath, getPrimaryElement, getResource, getSchedulingRule, getUnderlyingResource, isStructureKnown
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 
Methods inherited from interface org.eclipse.jdt.core.ISourceReference
exists, getSource, getSourceRange
 
Methods inherited from interface org.eclipse.jdt.core.ISourceManipulation
copy, delete, move, rename
 
Methods inherited from interface org.eclipse.jdt.core.IParent
getChildren, hasChildren
 

Method Detail

findMethods

public static IMethod[] findMethods(IMethod method,
                                    IMethod[] methods)

getCategories

public java.lang.String[] getCategories()
                                 throws JavaModelException
Description copied from interface: IMember
Returns the categories defined by this member's Javadoc. A category is the identifier following the tag @category in the member's Javadoc. Returns an empty array if no category is defined in this member's Javadoc.

Specified by:
getCategories in interface IMember
Returns:
the categories defined by this member's doc
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.

getClassFile

public IClassFile getClassFile()
Description copied from interface: IMember
Returns the class file in which this member is declared, or null if this member is not declared in a class file (for example, a source type). This is a handle-only method.

Specified by:
getClassFile in interface IMember
Overrides:
getClassFile in class JavaElement
Returns:
the class file in which this member is declared, or null if this member is not declared in a class file (for example, a source type)
See Also:
IMember

getDeclaringType

public IType getDeclaringType()
Description copied from interface: IMember
Returns the type in which this member is declared, or null if this member is not declared in a type (for example, a top-level type). This is a handle-only method.

Specified by:
getDeclaringType in interface IMember
Returns:
the type in which this member is declared, or null if this member is not declared in a type (for example, a top-level type)
See Also:
IMember

getFlags

public int getFlags()
             throws JavaModelException
Description copied from interface: IMember
Returns the modifier flags for this member. The flags can be examined using class Flags.

Note that only flags as indicated in the source are returned. Thus if an interface defines a method void myMethod(); the flags don't include the 'public' flag.

Specified by:
getFlags in interface IMember
Returns:
the modifier flags for this member
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.
See Also:
IMember

getHandleFromMemento

public IJavaElement getHandleFromMemento(java.lang.String token,
                                         MementoTokenizer memento,
                                         WorkingCopyOwner workingCopyOwner)
Overrides:
getHandleFromMemento in class SourceRefElement

getOuterMostLocalContext

public Member getOuterMostLocalContext()

getJavadocRange

public ISourceRange getJavadocRange()
                             throws JavaModelException
Description copied from interface: IMember
Returns the Javadoc range if this element is from source or if this element is a binary element with an attached source, null otherwise.

If this element is from source, the javadoc range is extracted from the corresponding source.

If this element is from a binary, the javadoc is extracted from the attached source if present.

If this element's openable is not consistent, then null is returned.

Specified by:
getJavadocRange in interface IMember
Returns:
a source range corresponding to the javadoc source or null if no source is available, this element has no javadoc comment or this element's openable is not consistent
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.
See Also:
IOpenable.isConsistent()

getNameRange

public ISourceRange getNameRange()
                          throws JavaModelException
Description copied from interface: IMember
Returns the source range of this member's simple name, or null if this member does not have a name (for example, an initializer), or if this member does not have associated source code (for example, a binary type).

Specified by:
getNameRange in interface IMember
Returns:
the source range of this member's simple name, or null if this member does not have a name (for example, an initializer), or if this member does not have associated source code (for example, a binary type)
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.
See Also:
IMember

getType

public IType getType(java.lang.String typeName,
                     int count)
Description copied from interface: IMember
Returns the local or anonymous type declared in this source member with the given simple name and/or with the specified position relative to the order they are defined in the source. The name is empty if it is an anonymous type. Numbering starts at 1 (thus the first occurrence is occurrence 1, not occurrence 0). This is a handle-only method. The type may or may not exist. Throws a RuntimeException if this member is not a source member.

Specified by:
getType in interface IMember
Parameters:
typeName - the given simple name
count - the specified position
Returns:
the type with the given name and/or with the specified position relative to the order they are defined in the source
See Also:
IMember

getTypeRoot

public ITypeRoot getTypeRoot()
Description copied from interface: IMember
Returns the Java type root in which this member is declared. This is a handle-only method.

Specified by:
getTypeRoot in interface IMember
Returns:
the Java type root in which this member is declared.
See Also:
IMember.getTypeRoot()

isBinary

public boolean isBinary()
Description copied from interface: IMember
Returns whether this member is from a class file. This is a handle-only method.

Specified by:
isBinary in interface IMember
Returns:
true if from a class file, and false if from a compilation unit
See Also:
IMember

isReadOnly

public boolean isReadOnly()
Description copied from interface: IJavaElement
Returns whether this Java element is read-only. An element is read-only if its structure cannot be modified by the java model.

Note this is different from IResource.isReadOnly(). For example, .jar files are read-only as the java model doesn't know how to add/remove elements in this file, but the underlying IFile can be writable.

This is a handle-only method.

Specified by:
isReadOnly in interface IJavaElement
Overrides:
isReadOnly in class JavaElement
Returns:
true if this element is read-only
See Also:
IJavaElement

readableName

public java.lang.String readableName()
Overrides:
readableName in class JavaElement