public abstract class BinaryMember extends NamedMember
nameoccurrenceCountJEM_ANNOTATION, JEM_CLASSFILE, JEM_COMPILATIONUNIT, JEM_COUNT, JEM_DELIMITER_ESCAPE, JEM_ESCAPE, JEM_FIELD, JEM_IMPORTDECLARATION, JEM_INITIALIZER, JEM_JAVAPROJECT, JEM_LAMBDA_EXPRESSION, JEM_LAMBDA_METHOD, JEM_LOCALVARIABLE, JEM_METHOD, JEM_MODULAR_CLASSFILE, JEM_MODULE, JEM_PACKAGEDECLARATION, JEM_PACKAGEFRAGMENT, JEM_PACKAGEFRAGMENTROOT, JEM_STRING, JEM_TYPE, JEM_TYPE_PARAMETER, NO_ELEMENTS, NO_INFO, NO_STRINGS, parentANNOTATION, CLASS_FILE, COMPILATION_UNIT, FIELD, IMPORT_CONTAINER, IMPORT_DECLARATION, INITIALIZER, JAVA_MODEL, JAVA_MODULE, JAVA_PROJECT, LOCAL_VARIABLE, METHOD, PACKAGE_DECLARATION, PACKAGE_FRAGMENT, PACKAGE_FRAGMENT_ROOT, TYPE, TYPE_PARAMETER| Modifier | Constructor and Description |
|---|---|
protected |
BinaryMember(JavaElement parent,
java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
void |
copy(IJavaElement container,
IJavaElement sibling,
java.lang.String rename,
boolean force,
IProgressMonitor monitor)
Copies this element to the given container.
|
protected IAnnotation[] |
getAnnotations(IBinaryAnnotation[] binaryAnnotations,
long tagBits) |
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 name range associated with this element.
|
ISourceRange |
getSourceRange()
Returns the source range associated with this element.
|
protected IAnnotation[] |
getStandardAnnotations(long tagBits) |
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,
IProgressMonitor monitor)
Moves this element to the given container.
|
void |
rename(java.lang.String newName,
boolean force,
IProgressMonitor monitor)
Renames this element to the given name.
|
void |
setContents(java.lang.String contents,
IProgressMonitor monitor) |
getElementName, getFullyQualifiedName, getFullyQualifiedParameterizedName, getKey, getKey, getKey, getKey, getOccurrenceCountSignature, getPackageFragment, getTypeParameters, getTypeQualifiedName, resolveType, resolveTypeareSimilarMethods, convertConstant, findMethods, getClassFile, getDeclaringType, getFlags, getHandleFromMemento, getHandleMementoDelimiter, getJavadocRange, getOuterMostLocalContext, getType, getTypeRoot, isMainMethod, isReadOnly, readableNameclosing, createElementInfo, delete, equals, findNode, generateInfos, getAnnotation, getAnnotations, getCompilationUnit, getCorrespondingResource, getHandleMemento, getHandleUpdatingCountFromMemento, getOccurrenceCount, getOpenableParent, getPath, getSource, getUnderlyingResource, hasChildren, resource, toStringNameappendEscapedDelimiter, close, escapeMementoName, exists, getAncestor, getAttachedJavadoc, getChildren, getChildrenOfType, getElementInfo, getElementInfo, getHandleFromMemento, getHandleIdentifier, getHandleMemento, getJavadocBaseLocation, getJavaModel, getJavaProject, getLibraryJavadocLocation, getOpenable, getParent, getPrimaryElement, getPrimaryElement, getResource, getSchedulingRule, getSourceElementAt, getSourceMapper, getURLContents, hashCode, isAncestorOf, newDoesNotExistStatus, newJavaModelException, newNotPresentException, openWhenClosed, resolved, tabString, toDebugString, toString, toString, toStringAncestors, toStringChildren, toStringInfo, toStringInfo, toStringWithAncestors, toStringWithAncestors, unresolved, validateAndCacheclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetCompilationUnit, getOccurrenceCountexists, getAncestor, getAttachedJavadoc, getCorrespondingResource, getElementType, getHandleIdentifier, getJavaModel, getJavaProject, getOpenable, getParent, getPath, getPrimaryElement, getResource, getSchedulingRule, getUnderlyingResourceexists, getSourcedeletegetChildren, hasChildrenprotected BinaryMember(JavaElement parent, java.lang.String name)
public void copy(IJavaElement container, IJavaElement sibling, java.lang.String rename, boolean force, IProgressMonitor monitor) throws JavaModelException
ISourceManipulationcopy in interface ISourceManipulationcopy in class SourceRefElementcontainer - 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 monitorJavaModelException - if this element could not be copied. Reasons include:
CoreException occurred while updating an underlying resource
replace has been specified as false
ISourceManipulationprotected IAnnotation[] getAnnotations(IBinaryAnnotation[] binaryAnnotations, long tagBits)
protected IAnnotation[] getStandardAnnotations(long tagBits)
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 IMembergetCategories in class MemberJavaModelException - 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
JavaModelExceptionBinding.computeUniqueKey()public ISourceRange getNameRange() throws JavaModelException
ISourceReferenceIf the element is an IMember, it 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).
If this element is an IImportDeclaration, the source range
of this import declaration's name, or null if this import
declaration does not have associated source code (for example, a binary type).
The source range for the name includes the trailing '*' if the call to
IImportDeclaration.isOnDemand() returns true.
If this element is an IPackageDeclaration, the source range of
this package declaration's name, or null if this package
declaration does not have associated source code (for example, a binary type).
If this element is an IAnnotation, the source range of
this annotation's name, or null if this annotation does not have
associated source code (for example, in a binary type).
If this element is an ITypeParameter, the source range of this
type parameter's name, or null if this type parameter does not have
associated source code (for example, in a binary type).
If this element is an ITypeRoot or IImportContainer, it
returns null.
getNameRange in interface ISourceReferencegetNameRange in class Membernull if
not availableJavaModelExceptionIMemberpublic ISourceRange getSourceRange() throws JavaModelException
ISourceReferenceFor 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, either null is returned,
or a source range with a -1 offset and a 0 length. SourceRange.isAvailable(ISourceRange)
can be used to detect that case.
getSourceRange in interface ISourceReferencegetSourceRange in class SourceRefElementnull or [-1, 0] if this element has no
associated source codeJavaModelException - if an exception occurs while accessing its corresponding resourceISourceReferencepublic boolean isBinary()
IMemberpublic boolean isStructureKnown()
throws JavaModelException
IJavaElementfalse 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 IJavaElementisStructureKnown in class SourceRefElementtrue if the structure of this element is knownJavaModelException - if this element does not exist or if an
exception occurs while accessing its corresponding resourceIJavaElementpublic void move(IJavaElement container, IJavaElement sibling, java.lang.String rename, boolean force, IProgressMonitor monitor) throws JavaModelException
ISourceManipulationmove in interface ISourceManipulationmove in class SourceRefElementcontainer - 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 monitorJavaModelException - if this element could not be moved. Reasons include:
CoreException occurred while updating an underlying resource
replace has been specified as false
ISourceManipulationpublic void rename(java.lang.String newName,
boolean force,
IProgressMonitor monitor)
throws JavaModelException
ISourceManipulationrename in interface ISourceManipulationrename in class SourceRefElementnewName - 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 monitorJavaModelException - if this element could not be renamed. Reasons include:
CoreException occurred while updating an underlying resource
replace has been specified as false
ISourceManipulationpublic void setContents(java.lang.String contents,
IProgressMonitor monitor)
throws JavaModelException
JavaModelException