Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse JDT
Release 3.5

org.eclipse.jdt.core
Interface IMember

All Superinterfaces:
IAdaptable, IJavaElement, IParent, ISourceManipulation, ISourceReference
All Known Subinterfaces:
IField, IInitializer, IMethod, IType

public interface IMember
extends IJavaElement, ISourceReference, ISourceManipulation, IParent

Common protocol for Java elements that can be members of types. This set consists of IType, IMethod, IField, and IInitializer.

Restriction:
This interface is not intended to be implemented by clients.

Field Summary
 
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
  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).
  ICompilationUnit getCompilationUnit ()
          Returns the compilation unit in which this member is declared, or null if this member is not declared in a compilation unit (for example, a binary 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.
  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).
 int getOccurrenceCount ()
          Returns the position relative to the order this member is defined in the source.
  IType getType ( String name, int occurrenceCount)
          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.
 
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, isReadOnly, 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

getCategories


String[] getCategories()
                       throws 
JavaModelException
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.

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.
Since:
3.2

getClassFile


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). This is a handle-only method.

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)

getCompilationUnit


ICompilationUnit getCompilationUnit()
Returns the compilation unit in which this member is declared, or null if this member is not declared in a compilation unit (for example, a binary type). This is a handle-only method.

Returns:
the compilation unit in which this member is declared, or null if this member is not declared in a compilation unit (for example, a binary type)

getDeclaringType


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). This is a handle-only method.

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)

getFlags

int getFlags()
             throws 
JavaModelException
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.

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:
Flags

getJavadocRange


ISourceRange getJavadocRange()
                             throws 
JavaModelException
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.

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.
Since:
3.2
See Also:
IOpenable.isConsistent()

getNameRange


ISourceRange getNameRange()
                          throws 
JavaModelException
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).

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.

getOccurrenceCount

int getOccurrenceCount()
Returns the position relative to the order this member is defined in the source. Numbering starts at 1 (thus the first occurrence is occurrence 1, not occurrence 0).

Two members m1 and m2 that are equal (e.g. 2 fields with the same name in the same type) can be distinguished using their occurrence counts. If member m1 appears first in the source, it will have an occurrence count of 1. If member m2 appears right after member m1, it will have an occurrence count of 2.

The occurrence count can be used to distinguish initializers inside a type or anonymous types inside a method.

This is a handle-only method. The member may or may not be present.

Returns:
the position relative to the order this member is defined in the source
Since:
3.2

getTypeRoot


ITypeRoot getTypeRoot()
Returns the Java type root in which this member is declared. This is a handle-only method.

Returns:
the Java type root in which this member is declared.
Since:
3.3

getType


IType getType(
String name,
              int occurrenceCount)
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.

Parameters:
name - the given simple name
occurrenceCount - 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
Since:
3.0

isBinary

boolean isBinary()
Returns whether this member is from a class file. This is a handle-only method.

Returns:
true if from a class file, and false if from a compilation unit

Eclipse JDT
Release 3.5

Copyright (c) IBM Corp. and others 2000, 2008. All Rights Reserved.

 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire