public class BinaryModule extends BinaryMember implements AbstractModule
AbstractModule.AutoModulenameoccurrenceCountJEM_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| Constructor and Description |
|---|
BinaryModule(JavaElement parent,
IBinaryModule info)
For creating a populated handle from a class file.
|
BinaryModule(JavaElement parent,
java.lang.String name)
For creating a pure handle from its memento.
|
| Modifier and Type | Method and Description |
|---|---|
IAnnotation[] |
getAnnotations()
Returns the annotations for this element.
|
java.lang.String |
getAttachedJavadoc(IProgressMonitor monitor)
Returns the Javadoc as HTML source if this element has attached Javadoc,
null otherwise. |
IJavaElement[] |
getChildren()
Returns the immediate children of this element.
|
int |
getFlags()
Returns the modifier flags for this member.
|
char |
getHandleMementoDelimiter()
Returns the
char that marks the start of this handles
contribution to a memento. |
JavadocContents |
getJavadocContents(IProgressMonitor monitor) |
java.lang.String |
getKey(boolean forceOpen) |
IModule |
getModuleInfo() |
ISourceRange |
getSourceRange()
Returns the source range associated with this element.
|
boolean |
isBinary()
Returns whether this member is from a class file.
|
boolean |
isSystemModule() |
java.lang.String |
toString(java.lang.String lineDelimiter) |
copy, getAnnotations, getCategories, getKey, getNameRange, getStandardAnnotations, isStructureKnown, move, rename, setContentsgetElementName, getFullyQualifiedName, getFullyQualifiedParameterizedName, getKey, getKey, getKey, getKey, getOccurrenceCountSignature, getPackageFragment, getTypeParameters, getTypeQualifiedName, resolveType, resolveTypeareSimilarMethods, convertConstant, findMethods, getClassFile, getDeclaringType, getHandleFromMemento, getJavadocRange, getOuterMostLocalContext, getType, getTypeRoot, isMainMethod, isReadOnly, readableNameclosing, createElementInfo, delete, equals, findNode, generateInfos, getAnnotation, getCompilationUnit, getCorrespondingResource, getHandleMemento, getHandleUpdatingCountFromMemento, getOccurrenceCount, getOpenableParent, getPath, getSource, getUnderlyingResource, hasChildren, resource, toStringNameappendEscapedDelimiter, close, escapeMementoName, exists, getAncestor, 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, waitgetElementInfo, getElementType, getExportedPackageNames, getExportedPackages, getOpenedPackageNames, getOpenedPackages, getProvidedServiceNames, getProvidedServices, getRequiredModuleNames, getRequiredModules, getUsedServiceNames, getUsedServices, toStringContentisAutoModulegetCategories, getClassFile, getCompilationUnit, getDeclaringType, getJavadocRange, getOccurrenceCount, getType, getTypeRootexists, getAncestor, getCorrespondingResource, getElementName, getHandleIdentifier, getJavaModel, getJavaProject, getOpenable, getParent, getPath, getPrimaryElement, getResource, getSchedulingRule, getUnderlyingResource, isReadOnly, isStructureKnownexists, getNameRange, getSourcecopy, delete, move, renamehasChildrengetAnnotationpublic BinaryModule(JavaElement parent, java.lang.String name)
public BinaryModule(JavaElement parent, IBinaryModule info)
public IModule getModuleInfo() throws JavaModelException
getModuleInfo in interface AbstractModuleJavaModelExceptionpublic IAnnotation[] getAnnotations() throws JavaModelException
IAnnotatablegetAnnotations in interface IAnnotatablegetAnnotations in class SourceRefElementJavaModelException - if this element does not exist or if an
exception occurs while accessing its corresponding resource.public IJavaElement[] getChildren() throws JavaModelException
IParentgetChildren in interface IParentgetChildren in class JavaElementJavaModelException - if this element does not exist or if an
exception occurs while accessing its corresponding resourceIParentpublic boolean isBinary()
IMemberisBinary in interface IMemberisBinary in class BinaryMembertrue if from a class file, and false if
from a compilation unitIMemberpublic boolean isSystemModule()
isSystemModule in interface IModuleDescriptionpublic int getFlags()
throws JavaModelException
IMemberFlags.
For binary members, flags from the class file
as well as derived flags Flags.AccAnnotationDefault and Flags.AccDefaultMethod are included.
For source members, 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. Source flags include Flags.AccAnnotationDefault as well.
public char getHandleMementoDelimiter()
JavaElementchar that marks the start of this handles
contribution to a memento.getHandleMementoDelimiter in class MemberJavaElement.getHandleMemento()public java.lang.String getKey(boolean forceOpen)
throws JavaModelException
getKey in class BinaryMemberJavaModelExceptionBinding.computeUniqueKey()public 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 BinaryMembernull or [-1, 0] if this element has no
associated source codeJavaModelException - if an exception occurs while accessing its corresponding resourceISourceReferencepublic java.lang.String getAttachedJavadoc(IProgressMonitor monitor)
throws JavaModelException
IJavaElementReturns the Javadoc as HTML source if this element has attached Javadoc,
null otherwise.
This should be used only for binary elements. Source elements will always return null.
The encoding used to read the Javadoc is the one defined by the content type of the file. If none is defined, then the project's encoding of this Java element is used. If the project's encoding cannot be retrieved, then the platform encoding is used.
In case the Javadoc doesn't exist for this element, null is returned.
The HTML is extracted from the attached Javadoc and provided as is. No transformation or validation is done.
getAttachedJavadoc in interface IJavaElementgetAttachedJavadoc in class JavaElementmonitor - the given progress monitor, can be nullnull if noneJavaModelException - if:IClasspathAttribute.JAVADOC_LOCATION_ATTRIBUTE_NAMEpublic JavadocContents getJavadocContents(IProgressMonitor monitor) throws JavaModelException
JavaModelExceptionpublic java.lang.String toString(java.lang.String lineDelimiter)
toString in interface AbstractModule