org.eclipse.jdt.internal.core
Class ExternalPackageFragmentRoot
java.lang.Object
org.eclipse.core.runtime.PlatformObject
org.eclipse.jdt.internal.core.JavaElement
org.eclipse.jdt.internal.core.Openable
org.eclipse.jdt.internal.core.PackageFragmentRoot
org.eclipse.jdt.internal.core.ExternalPackageFragmentRoot
- All Implemented Interfaces:
- org.eclipse.core.runtime.IAdaptable, IBufferChangedListener, IJavaElement, IOpenable, IPackageFragmentRoot, IParent
public class ExternalPackageFragmentRoot
- extends PackageFragmentRoot
A package fragment root that corresponds to an external class folder.
NOTE: An external package fragment root never has an associated resource.
- See Also:
IPackageFragmentRoot,
PackageFragmentRootInfo
| 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 |
boolean |
equals(java.lang.Object o)
Returns true if this handle represents the same external folder
as the given handle. |
java.lang.String |
getElementName()
Returns the name of this element. |
int |
getKind()
Returns this package fragment root's kind encoded as an integer. |
org.eclipse.core.runtime.IPath |
getPath()
Returns the path to the innermost resource enclosing this element. |
IResource |
getUnderlyingResource()
Returns the smallest underlying resource that contains
this element, or null if this element is not contained
in a resource. |
int |
hashCode()
Returns the hash code for this Java element. |
boolean |
isExternal()
Returns whether this package fragment root is external
to the workbench (that is, a local file), and has no
underlying resource. |
IResource |
resource(PackageFragmentRoot root)
|
| Methods inherited from class org.eclipse.jdt.internal.core.PackageFragmentRoot |
attachSource, copy, createPackageFragment, delete, fullExclusionPatternChars, fullInclusionPatternChars, getElementType, getHandleFromMemento, getNonJavaResources, getPackageFragment, getPackageFragment, getRawClasspathEntry, getSourceAttachmentPath, getSourceAttachmentRootPath, getSourceMapper, hasChildren, internalPath, isArchive, move, resource, setSourceMapper |
| Methods inherited from class org.eclipse.jdt.internal.core.Openable |
bufferChanged, canBeRemovedFromCache, canBufferBeRemovedFromCache, exists, findRecommendedLineSeparator, getBuffer, getBufferFactory, getCorrespondingResource, getOpenable, getPackageFragmentRoot, getResource, hasUnsavedChanges, isConsistent, isOpen, isStructureKnown, makeConsistent, open, save |
| Methods inherited from class org.eclipse.jdt.internal.core.JavaElement |
close, findNode, getAncestor, getAttachedJavadoc, getChildren, getChildrenOfType, getClassFile, getCompilationUnit, getElementInfo, getElementInfo, getHandleFromMemento, getHandleIdentifier, getHandleMemento, getJavaModel, getJavaProject, getOpenableParent, getParent, getPrimaryElement, getPrimaryElement, getSchedulingRule, isAncestorOf, isReadOnly, newJavaModelException, newNotPresentException, readableName, 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.IJavaElement |
exists, getAncestor, getAttachedJavadoc, getCorrespondingResource, getHandleIdentifier, getJavaModel, getJavaProject, getOpenable, getParent, getPrimaryElement, getResource, getSchedulingRule, isReadOnly, isStructureKnown |
| Methods inherited from interface org.eclipse.core.runtime.IAdaptable |
getAdapter |
equals
public boolean equals(java.lang.Object o)
- Returns true if this handle represents the same external folder
as the given handle.
- Overrides:
equals in class PackageFragmentRoot
- See Also:
Object.equals(java.lang.Object)
getElementName
public java.lang.String getElementName()
- Description copied from interface:
IJavaElement
- Returns the name of this element. This is a handle-only method.
- Specified by:
getElementName in interface IJavaElement- Overrides:
getElementName in class PackageFragmentRoot
- Returns:
- the element name
- See Also:
IAdaptable
getKind
public int getKind()
- Description copied from interface:
IPackageFragmentRoot
- Returns this package fragment root's kind encoded as an integer.
A package fragment root can contain source files (i.e. files with one
of the
Java-like extensions,
or .class files, but not both.
If the underlying folder or archive contains other kinds of files, they are ignored.
In particular, .class files are ignored under a source package fragment root,
and source files are ignored under a binary package fragment root.
- Specified by:
getKind in interface IPackageFragmentRoot- Overrides:
getKind in class PackageFragmentRoot
- Returns:
- this package fragment root's kind encoded as an integer
- See Also:
IPackageFragmentRoot
getPath
public org.eclipse.core.runtime.IPath getPath()
- Description copied from interface:
IJavaElement
- Returns the path to the innermost resource enclosing this element.
If this element is not included in an external library,
the path returned is the full, absolute path to the underlying resource,
relative to the workbench.
If this element is included in an external library,
the path returned is the absolute path to the archive in the file system.
This is a handle-only method.
- Specified by:
getPath in interface IJavaElement- Overrides:
getPath in class PackageFragmentRoot
- Returns:
- the path to the innermost resource enclosing this element
- See Also:
IPackageFragmentRoot
getUnderlyingResource
public IResource getUnderlyingResource()
throws JavaModelException
- Description copied from interface:
IJavaElement
- Returns the smallest underlying resource that contains
this element, or
null if this element is not contained
in a resource.
- Specified by:
getUnderlyingResource in interface IJavaElement- Overrides:
getUnderlyingResource in class PackageFragmentRoot
- Returns:
- the underlying resource, or
null if none
- Throws:
JavaModelException - if this element does not exist or if an
exception occurs while accessing its underlying resource- See Also:
IJavaElement
hashCode
public int hashCode()
- Description copied from class:
JavaElement
- Returns the hash code for this Java element. By default,
the hash code for an element is a combination of its name
and parent's hash code. Elements with other requirements must
override this method.
- Overrides:
hashCode in class PackageFragmentRoot
isExternal
public boolean isExternal()
- Description copied from interface:
IPackageFragmentRoot
- Returns whether this package fragment root is external
to the workbench (that is, a local file), and has no
underlying resource.
This is a handle-only method.
- Specified by:
isExternal in interface IPackageFragmentRoot- Overrides:
isExternal in class PackageFragmentRoot
- Returns:
- true if this package fragment root is external
to the workbench (that is, a local file), and has no
underlying resource, false otherwise
- See Also:
IPackageFragmentRoot
resource
public IResource resource(PackageFragmentRoot root)
- Overrides:
resource in class PackageFragmentRoot