|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.core.runtime.PlatformObject
org.eclipse.jdt.internal.core.JavaElement
org.eclipse.jdt.internal.core.SourceRefElement
org.eclipse.jdt.internal.core.Member
org.eclipse.jdt.internal.core.NamedMember
org.eclipse.jdt.internal.core.BinaryMember
public abstract class BinaryMember
Common functionality for Binary member handles.
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 | |
---|---|
void |
copy(IJavaElement container,
IJavaElement sibling,
java.lang.String rename,
boolean force,
org.eclipse.core.runtime.IProgressMonitor monitor)
Copies this element to the given container. |
java.lang.String[] |
getCategories()
Returns the categories defined by this member's Javadoc. |
java.lang.String |
getKey()
|
abstract java.lang.String |
getKey(boolean forceOpen)
|
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). |
ISourceRange |
getSourceRange()
Returns the source range associated with this element. |
boolean |
isBinary()
Returns whether this member is from a class file. |
boolean |
isStructureKnown()
Returns whether the structure of this element is known. |
void |
move(IJavaElement container,
IJavaElement sibling,
java.lang.String rename,
boolean force,
org.eclipse.core.runtime.IProgressMonitor monitor)
Moves this element to the given container. |
void |
rename(java.lang.String newName,
boolean force,
org.eclipse.core.runtime.IProgressMonitor monitor)
Renames this element to the given name. |
void |
setContents(java.lang.String contents,
org.eclipse.core.runtime.IProgressMonitor monitor)
|
Methods inherited from class org.eclipse.jdt.internal.core.NamedMember |
---|
getElementName, getFullyQualifiedName, getTypeQualifiedName, resolveType, resolveType |
Methods inherited from class org.eclipse.jdt.internal.core.Member |
---|
findMethods, getClassFile, getDeclaringType, getFlags, getHandleFromMemento, getJavadocRange, getOuterMostLocalContext, getType, getTypeRoot, isReadOnly, readableName |
Methods inherited from class org.eclipse.jdt.internal.core.SourceRefElement |
---|
delete, equals, findNode, getAnnotation, getAnnotations, getCompilationUnit, getCorrespondingResource, getHandleUpdatingCountFromMemento, getOccurrenceCount, getOpenableParent, getPath, getSource, getUnderlyingResource, hasChildren, resource |
Methods inherited from class org.eclipse.jdt.internal.core.JavaElement |
---|
close, exists, getAncestor, getAttachedJavadoc, getChildren, getChildrenOfType, getElementInfo, getElementInfo, 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, getElementType, getHandleIdentifier, getJavaModel, getJavaProject, getOpenable, getParent, getPath, getPrimaryElement, getResource, getSchedulingRule, getUnderlyingResource |
Methods inherited from interface org.eclipse.core.runtime.IAdaptable |
---|
getAdapter |
Methods inherited from interface org.eclipse.jdt.core.ISourceReference |
---|
exists, getSource |
Methods inherited from interface org.eclipse.jdt.core.ISourceManipulation |
---|
delete |
Methods inherited from interface org.eclipse.jdt.core.IParent |
---|
getChildren, hasChildren |
Method Detail |
---|
public void copy(IJavaElement container, IJavaElement sibling, java.lang.String rename, boolean force, org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException
ISourceManipulation
copy
in interface ISourceManipulation
copy
in class SourceRefElement
container
- the containersibling
- the sibling element before which the copy should be inserted,
or null
if the copy should be inserted as the last child of
the containerrename
- the new name for the element, or null
if the copy
retains the name of this elementforce
- true
if any existing child in the container with
the target name should be replaced, and false
to throw an
exception in the event of a name collisionmonitor
- a progress monitor
JavaModelException
- if this element could not be copied. Reasons include:
CoreException
occurred while updating an underlying resource
replace
has been specified as false
ISourceManipulation
public java.lang.String[] getCategories() throws JavaModelException
IMember
@category
in the member's Javadoc.
Returns an empty array if no category is defined in this member's Javadoc.
getCategories
in interface IMember
getCategories
in class Member
JavaModelException
- if this element does not exist or if an
exception occurs while accessing its corresponding resource.public java.lang.String getKey()
public abstract java.lang.String getKey(boolean forceOpen) throws JavaModelException
JavaModelException
Binding.computeUniqueKey()
public ISourceRange getNameRange() throws JavaModelException
IMember
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).
getNameRange
in interface IMember
getNameRange
in class Member
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)
JavaModelException
- if this element does not exist or if an
exception occurs while accessing its corresponding resource.IMember
public ISourceRange getSourceRange() throws JavaModelException
ISourceReference
For class files, this returns the range of the entire compilation unit associated with the class file (if there is one).
If this element has no associated source code null
is either returned,
or a source range with a -1 offset and a 0 length.
getSourceRange
in interface ISourceReference
getSourceRange
in class SourceRefElement
null
or [-1, 0] if this element has no
associated source code
JavaModelException
- if an exception occurs while accessing its corresponding resourceISourceReference
public boolean isBinary()
IMember
isBinary
in interface IMember
isBinary
in class Member
true
if from a class file, and false
if
from a compilation unitIMember
public boolean isStructureKnown() throws JavaModelException
IJavaElement
false
is returned.
If the structure of an element is unknown, navigations will return reasonable
defaults. For example, getChildren
for a compilation unit with
syntax errors will return a collection of the children that could be parsed.
Note: This does not imply anything about consistency with the underlying resource/buffer contents.
isStructureKnown
in interface IJavaElement
isStructureKnown
in class SourceRefElement
true
if the structure of this element is known
JavaModelException
- if this element does not exist or if an
exception occurs while accessing its corresponding resourceIJavaElement
public void move(IJavaElement container, IJavaElement sibling, java.lang.String rename, boolean force, org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException
ISourceManipulation
move
in interface ISourceManipulation
move
in class SourceRefElement
container
- the containersibling
- the sibling element before which the element should be inserted,
or null
if the element should be inserted as the last child of
the containerrename
- the new name for the element, or null
if the
element retains its nameforce
- true
if any existing child in the container with
the target name should be replaced, and false
to throw an
exception in the event of a name collisionmonitor
- a progress monitor
JavaModelException
- if this element could not be moved. Reasons include:
CoreException
occurred while updating an underlying resource
replace
has been specified as false
ISourceManipulation
public void rename(java.lang.String newName, boolean force, org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException
ISourceManipulation
rename
in interface ISourceManipulation
rename
in class SourceRefElement
newName
- the new name for the elementforce
- true
if any existing element with the target name
should be replaced, and false
to throw an exception in the
event of a name collisionmonitor
- a progress monitor
JavaModelException
- if this element could not be renamed. Reasons include:
CoreException
occurred while updating an underlying resource
replace
has been specified as false
ISourceManipulation
public void setContents(java.lang.String contents, org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException
JavaModelException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |