Klasse PackageFragmentRoot
- Alle implementierten Schnittstellen:
IBufferChangedListener,IJavaElement,IOpenable,IPackageFragmentRoot,IParent,org.eclipse.core.runtime.IAdaptable
- Bekannte direkte Unterklassen:
ExternalPackageFragmentRoot,JarPackageFragmentRoot
- Siehe auch:
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungprotected static final charThe delimiter between the source path and root path in the attachment server property.static final Stringprotected org.eclipse.core.resources.IResourceThe resource associated with this root (null for external jar)Von Klasse geerbte Felder org.aspectj.org.eclipse.jdt.internal.core.JavaElement
JEM_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_STRINGSVon Schnittstelle geerbte Felder org.aspectj.org.eclipse.jdt.core.IJavaElement
ANNOTATION, 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_PARAMETERVon Schnittstelle geerbte Felder org.aspectj.org.eclipse.jdt.core.IPackageFragmentRoot
DEFAULT_PACKAGEROOT_PATH, DESTINATION_PROJECT_CLASSPATH, K_BINARY, K_SOURCE, NO_RESOURCE_MODIFICATION, ORIGINATING_PROJECT_CLASSPATH, OTHER_REFERRING_PROJECTS_CLASSPATH, REPLACE -
Konstruktorübersicht
KonstruktorenModifiziererKonstruktorBeschreibungprotectedPackageFragmentRoot(org.eclipse.core.resources.IResource resource, JavaProject project) Constructs a package fragment root which is the root of the java package directory hierarchy. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidattachSource(org.eclipse.core.runtime.IPath sourcePath, org.eclipse.core.runtime.IPath rootPath, org.eclipse.core.runtime.IProgressMonitor monitor) Attaches the source archive identified by the given absolute path to this binary package fragment root.protected booleanbuildStructure(OpenableElementInfo info, org.eclipse.core.runtime.IProgressMonitor pm, Map newElements, org.eclipse.core.resources.IResource underlyingResource) Builds this element's structure and properties in the given info object, based on this element's current contents (reuse buffer contents if this element has an open buffer, or resource contents if this element does not have an open buffer).protected booleancomputeChildren(OpenableElementInfo info, org.eclipse.core.resources.IResource underlyingResource) Compute the package fragment children of this package fragment root.protected voidcomputeFolderChildren(org.eclipse.core.resources.IContainer folder, boolean isIncluded, String[] pkgName, ArrayList vChildren, char[][] inclusionPatterns, char[][] exclusionPatterns) Starting at this folder, create package fragments and add the fragments that are not excluded to the collection of children.voidcopy(org.eclipse.core.runtime.IPath destination, int updateResourceFlags, int updateModelFlags, IClasspathEntry sibling, org.eclipse.core.runtime.IProgressMonitor monitor) Copies the resource of this package fragment root to the destination path as specified byIResource.copy(IPath, int, IProgressMonitor)but excluding nested source folders.protected ObjectReturns a new element info for this element.createPackageFragment(String pkgName, boolean force, org.eclipse.core.runtime.IProgressMonitor monitor) Creates and returns a package fragment in this root with the given dot-separated package name.voiddelete(int updateResourceFlags, int updateModelFlags, org.eclipse.core.runtime.IProgressMonitor monitor) Deletes the resource of this package fragment root as specified byIResource.delete(int, IProgressMonitor)but excluding nested source folders.protected intdetermineKind(org.eclipse.core.resources.IResource underlyingResource) Returns the root's kind - K_SOURCE or K_BINARY, defaults to K_SOURCE if it is not on the classpath.booleanCompares two objects for equality; forPackageFragmentRoots, equality is having the same parent, same resources, and occurrence count.char[][]char[][]getClassFilePath(String classname) Returns the relative path within an archive for the given class file name.Returns the name of this element.intReturns this element's kind encoded as an integer.getHandleFromMemento(String token, MementoTokenizer memento, WorkingCopyOwner owner) protected voidgetHandleMemento(StringBuffer buff) protected charReturns thecharthat marks the start of this handles contribution to a memento.intgetKind()Returns this package fragment root's kind encoded as an integer.Convenience lookup, though currently only JarPackageFragmentRoot is searched for a manifest.Returns theIModuleDescriptionthat this package fragment root contains.Object[]Returns an array of non-java resources contained in the receiver.getPackageFragment(String packageName) Returns the package fragment with the given package name.getPackageFragment(String[] pkgName) getPackageFragment(String[] pkgName, String mod) protected StringgetPackageName(org.eclipse.core.resources.IFolder folder) Returns the package name for the given folder (which is a decendent of this root).org.eclipse.core.runtime.IPathgetPath()Returns the path to the innermost resource enclosing this element.Returns the first raw classpath entry that corresponds to this package fragment root.Returns the first resolved classpath entry that corresponds to this package fragment root.org.eclipse.core.runtime.IPathReturns the absolute path to the source archive attached to this package fragment root's binary archive.org.eclipse.core.runtime.IPathReturns the path within this package fragment root's source archive.Returns the SourceMapper facility for this element, ornullif this element does not have a SourceMapper.org.eclipse.core.resources.IResourceReturns the smallest underlying resource that contains this element, ornullif this element is not contained in a resource.booleanReturns whether this element has one or more immediate children.booleanhasCompilationUnit(String qualifiedPackageName, String moduleName) inthashCode()Returns the hash code for this Java element.booleanorg.eclipse.core.runtime.IPathbooleanReturns whether this package fragment root's underlying resource is a binary archive (a JAR or zip file).protected booleanbooleanReturns whether this package fragment root is external to the workbench (that is, a local file), and has no underlying resource.voidmove(org.eclipse.core.runtime.IPath destination, int updateResourceFlags, int updateModelFlags, IClasspathEntry sibling, org.eclipse.core.runtime.IProgressMonitor monitor) Moves the resource of this package fragment root to the destination path as specified byIResource.move(IPath,int,IProgressMonitor)but excluding nested source folders.org.eclipse.core.resources.IResourceresource()org.eclipse.core.resources.IResourceresource(PackageFragmentRoot root) voidsetSourceMapper(SourceMapper mapper) For use byAttachSourceOperationonly.protected voidtoStringInfo(int tab, StringBuffer buffer, Object info, boolean showResolvedInfo) Debugging purposesprotected org.eclipse.core.runtime.IStatusvalidateExistence(org.eclipse.core.resources.IResource underlyingResource) protected org.eclipse.core.runtime.IStatusprotected voidverifyAttachSource(org.eclipse.core.runtime.IPath sourcePath) Possible failures: ELEMENT_NOT_PRESENT - the root supplied to the operation does not exist INVALID_ELEMENT_TYPES - the root is not of kind K_BINARY RELATIVE_PATH - the path supplied to this operation must be an absolute pathVon Klasse geerbte Methoden org.aspectj.org.eclipse.jdt.internal.core.Openable
bufferChanged, canBeRemovedFromCache, canBufferBeRemovedFromCache, closeBuffer, closing, codeComplete, codeSelect, exists, findRecommendedLineSeparator, generateInfos, getBuffer, getBufferFactory, getBufferManager, getCorrespondingResource, getOpenable, getPackageFragmentRoot, getResource, hasBuffer, hasUnsavedChanges, ignoreErrorStatus, isConsistent, isOpen, isSourceElement, isStructureKnown, makeConsistent, open, openAncestors, openBuffer, resourceExists, saveVon Klasse geerbte Methoden org.aspectj.org.eclipse.jdt.internal.core.JavaElement
appendEscapedDelimiter, close, escapeMementoName, findNode, getAncestor, getAttachedJavadoc, getChildren, getChildrenOfType, getClassFile, getCompilationUnit, getElementInfo, getElementInfo, getHandleFromMemento, getHandleIdentifier, getHandleMemento, getJavadocBaseLocation, getJavaModel, getJavaProject, getLibraryJavadocLocation, getOpenableParent, getParent, getPrimaryElement, getPrimaryElement, getSchedulingRule, getSourceElementAt, getURLContents, isAncestorOf, isReadOnly, newDoesNotExistStatus, newJavaModelException, newNotPresentException, openWhenClosed, readableName, resolved, setParent, tabString, toDebugString, toString, toString, toStringAncestors, toStringChildren, toStringInfo, toStringName, toStringWithAncestors, toStringWithAncestors, unresolved, validateAndCacheVon Klasse geerbte Methoden org.eclipse.core.runtime.PlatformObject
getAdapterVon Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitVon Schnittstelle geerbte Methoden org.eclipse.core.runtime.IAdaptable
getAdapterVon Schnittstelle geerbte Methoden org.aspectj.org.eclipse.jdt.core.IJavaElement
exists, getAncestor, getAttachedJavadoc, getCorrespondingResource, getHandleIdentifier, getJavaModel, getJavaProject, getOpenable, getParent, getPrimaryElement, getResource, getSchedulingRule, isReadOnly, isStructureKnownVon Schnittstelle geerbte Methoden org.aspectj.org.eclipse.jdt.core.IOpenable
close, findRecommendedLineSeparator, getBuffer, hasUnsavedChanges, isConsistent, isOpen, makeConsistent, open, saveVon Schnittstelle geerbte Methoden org.aspectj.org.eclipse.jdt.core.IParent
getChildren
-
Felddetails
-
ATTACHMENT_PROPERTY_DELIMITER
protected static final char ATTACHMENT_PROPERTY_DELIMITERThe delimiter between the source path and root path in the attachment server property.- Siehe auch:
-
NO_SOURCE_ATTACHMENT
- Siehe auch:
-
resource
protected org.eclipse.core.resources.IResource resourceThe resource associated with this root (null for external jar)
-
-
Konstruktordetails
-
PackageFragmentRoot
Constructs a package fragment root which is the root of the java package directory hierarchy.
-
-
Methodendetails
-
attachSource
public void attachSource(org.eclipse.core.runtime.IPath sourcePath, org.eclipse.core.runtime.IPath rootPath, org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException Beschreibung aus Schnittstelle kopiert:IPackageFragmentRootAttaches the source archive identified by the given absolute path to this binary package fragment root.rootPathspecifies the location of the root within the archive or folder (empty specifies the default root andnullspecifies the root path should be detected). Once a source archive or folder is attached to the package fragment root, thegetSourceandgetSourceRangemethods become operational for binary types/members. To detach a source archive or folder from a package fragment root, specifynullas the source path.- Angegeben von:
attachSourcein SchnittstelleIPackageFragmentRoot- Parameter:
sourcePath- the given absolute path to the source archive or folderrootPath- specifies the location of the root within the archive (empty specifies the default root andnullspecifies automatic detection of the root path)monitor- the given progress monitor- Löst aus:
JavaModelException- if this operation fails. Reasons include:- This Java element does not exist (ELEMENT_DOES_NOT_EXIST)
- A
CoreExceptionoccurred while updating a server property - This package fragment root is not of kind binary (INVALID_ELEMENT_TYPES)
- The path provided is not absolute (RELATIVE_PATH)
- Siehe auch:
-
buildStructure
protected boolean buildStructure(OpenableElementInfo info, org.eclipse.core.runtime.IProgressMonitor pm, Map newElements, org.eclipse.core.resources.IResource underlyingResource) throws JavaModelException Beschreibung aus Klasse kopiert:OpenableBuilds this element's structure and properties in the given info object, based on this element's current contents (reuse buffer contents if this element has an open buffer, or resource contents if this element does not have an open buffer). Children are placed in the given newElements table (note, this element has already been placed in the newElements table). Returns true if successful, or false if an error is encountered while determining the structure of this element.- Angegeben von:
buildStructurein KlasseOpenable- Löst aus:
JavaModelException- Siehe auch:
-
delete
public void delete(int updateResourceFlags, int updateModelFlags, org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException Beschreibung aus Schnittstelle kopiert:IPackageFragmentRootDeletes the resource of this package fragment root as specified byIResource.delete(int, IProgressMonitor)but excluding nested source folders.If
NO_RESOURCE_MODIFICATIONis specified inupdateModelFlagsor if this package fragment root is external, this operation doesn't delete the resource.updateResourceFlagsis then ignored.If
ORIGINATING_PROJECT_CLASSPATHis specified inupdateModelFlags, update the raw classpath of this package fragment root's project by removing the corresponding classpath entry.If
OTHER_REFERRING_PROJECTS_CLASSPATHis specified inupdateModelFlags, update the raw classpaths of all other Java projects referring to this root's resource by removing the corresponding classpath entries.If no flags is specified in
updateModelFlags(usingIResource.NONE), the default behavior applies: the resource is deleted (if this package fragment root is not external) and no classpaths are updated.- Angegeben von:
deletein SchnittstelleIPackageFragmentRoot- Parameter:
updateResourceFlags- bit-wise or of update resource flag constants (IResource.FORCEandIResource.KEEP_HISTORY)updateModelFlags- bit-wise or of update resource flag constants (ORIGINATING_PROJECT_CLASSPATH,OTHER_REFERRING_PROJECTS_CLASSPATHandNO_RESOURCE_MODIFICATION)monitor- a progress monitor- Löst aus:
JavaModelException- if this root could not be deleted. Reasons include:- This root does not exist (ELEMENT_DOES_NOT_EXIST)
- A
CoreExceptionoccurred while deleting the resource or updating a classpath
- Siehe auch:
-
IResource.delete(boolean, IProgressMonitor)
-
computeChildren
protected boolean computeChildren(OpenableElementInfo info, org.eclipse.core.resources.IResource underlyingResource) throws JavaModelException Compute the package fragment children of this package fragment root.- Löst aus:
JavaModelException- The resource associated with this package fragment root does not exist
-
computeFolderChildren
protected void computeFolderChildren(org.eclipse.core.resources.IContainer folder, boolean isIncluded, String[] pkgName, ArrayList vChildren, char[][] inclusionPatterns, char[][] exclusionPatterns) throws JavaModelException Starting at this folder, create package fragments and add the fragments that are not excluded to the collection of children.- Löst aus:
JavaModelException- The resource associated with this package fragment does not exist
-
copy
public void copy(org.eclipse.core.runtime.IPath destination, int updateResourceFlags, int updateModelFlags, IClasspathEntry sibling, org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException Beschreibung aus Schnittstelle kopiert:IPackageFragmentRootCopies the resource of this package fragment root to the destination path as specified byIResource.copy(IPath, int, IProgressMonitor)but excluding nested source folders.If
NO_RESOURCE_MODIFICATIONis specified inupdateModelFlagsor if this package fragment root is external, this operation doesn't copy the resource.updateResourceFlagsis then ignored.If
DESTINATION_PROJECT_CLASSPATHis specified inupdateModelFlags, updates the classpath of the destination's project (if it is a Java project). If a non-nullsibling is specified, a copy of this root's classpath entry is inserted before the sibling on the destination project's raw classpath. Ifnullis specified, the classpath entry is added at the end of the raw classpath.If
REPLACEis specified inupdateModelFlags, overwrites the resource at the destination path if any. If the same classpath entry already exists on the destination project's raw classpath, then the sibling is ignored and the new classpath entry replaces the existing one.If no flags is specified in
updateModelFlags(usingIResource.NONE), the default behavior applies: the resource is copied (if this package fragment root is not external) and the classpath is not updated.- Angegeben von:
copyin SchnittstelleIPackageFragmentRoot- Parameter:
destination- the destination pathupdateResourceFlags- bit-wise or of update resource flag constants (IResource.FORCEandIResource.SHALLOW)updateModelFlags- bit-wise or of update resource flag constants (DESTINATION_PROJECT_CLASSPATHandNO_RESOURCE_MODIFICATION)sibling- the classpath entry before which a copy of the classpath entry should be inserted ornullif the classpath entry should be inserted at the endmonitor- a progress monitor- Löst aus:
JavaModelException- if this root could not be copied. Reasons include:- This root does not exist (ELEMENT_DOES_NOT_EXIST)
- A
CoreExceptionoccurred while copying the resource or updating a classpath -
The destination is not inside an existing project and
updateModelFlagshas been specified asDESTINATION_PROJECT_CLASSPATH(INVALID_DESTINATION) - The sibling is not a classpath entry on the destination project's raw classpath (INVALID_SIBLING)
- The same classpath entry already exists on the destination project's
classpath (NAME_COLLISION) and
updateModelFlagshas not been specified asREPLACE
- Siehe auch:
-
IResource.copy(IPath, boolean, IProgressMonitor)
-
createElementInfo
Returns a new element info for this element.- Setzt außer Kraft:
createElementInfoin KlasseOpenable
-
createPackageFragment
public IPackageFragment createPackageFragment(String pkgName, boolean force, org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException Beschreibung aus Schnittstelle kopiert:IPackageFragmentRootCreates and returns a package fragment in this root with the given dot-separated package name. An empty string specifies the default package. This has the side effect of creating all package fragments that are a prefix of the new package fragment which do not exist yet. If the package fragment already exists, this has no effect. For a description of theforceflag, seeIFolder.create.- Angegeben von:
createPackageFragmentin SchnittstelleIPackageFragmentRoot- Parameter:
pkgName- the given dot-separated package nameforce- a flag controlling how to deal with resources that are not in sync with the local file systemmonitor- the given progress monitor- Gibt zurück:
- a package fragment in this root with the given dot-separated package name
- Löst aus:
JavaModelException- if the element could not be created. Reasons include:- This Java element does not exist (ELEMENT_DOES_NOT_EXIST)
- A
CoreExceptionoccurred while creating an underlying resource - This package fragment root is read only (READ_ONLY)
- The name is not a valid package name (INVALID_NAME)
- Siehe auch:
-
determineKind
protected int determineKind(org.eclipse.core.resources.IResource underlyingResource) throws JavaModelException Returns the root's kind - K_SOURCE or K_BINARY, defaults to K_SOURCE if it is not on the classpath.- Löst aus:
JavaModelException- if the project and root do not exist.
-
equals
Compares two objects for equality; forPackageFragmentRoots, equality is having the same parent, same resources, and occurrence count.- Setzt außer Kraft:
equalsin KlasseJavaElement- Siehe auch:
-
fullExclusionPatternChars
public char[][] fullExclusionPatternChars() -
fullInclusionPatternChars
public char[][] fullInclusionPatternChars() -
getElementName
Beschreibung aus Schnittstelle kopiert:IJavaElementReturns the name of this element. This is a handle-only method.- Angegeben von:
getElementNamein SchnittstelleIJavaElement- Setzt außer Kraft:
getElementNamein KlasseJavaElement- Gibt zurück:
- the element name
- Siehe auch:
-
IAdaptable
-
getElementType
public int getElementType()Beschreibung aus Schnittstelle kopiert:IJavaElementReturns this element's kind encoded as an integer. This is a handle-only method.- Angegeben von:
getElementTypein SchnittstelleIJavaElement- Gibt zurück:
- the kind of element; one of the constants declared in
IJavaElement - Siehe auch:
-
getHandleMementoDelimiter
protected char getHandleMementoDelimiter()Beschreibung aus Klasse kopiert:JavaElementReturns thecharthat marks the start of this handles contribution to a memento.- Angegeben von:
getHandleMementoDelimiterin KlasseJavaElement- Siehe auch:
-
getHandleFromMemento
public IJavaElement getHandleFromMemento(String token, MementoTokenizer memento, WorkingCopyOwner owner) - Angegeben von:
getHandleFromMementoin KlasseJavaElement
-
getHandleMemento
- Setzt außer Kraft:
getHandleMementoin KlasseJavaElement- Siehe auch:
-
getKind
Beschreibung aus Schnittstelle kopiert:IPackageFragmentRootReturns this package fragment root's kind encoded as an integer. A package fragment root can contain source files (i.e. files with one of theJava-like extensions, or.classfiles, but not both. If the underlying folder or archive contains other kinds of files, they are ignored. In particular,.classfiles are ignored under a source package fragment root, and source files are ignored under a binary package fragment root.- Angegeben von:
getKindin SchnittstelleIPackageFragmentRoot- Gibt zurück:
- this package fragment root's kind encoded as an integer
- Löst aus:
JavaModelException- if this element does not exist or if an exception occurs while accessing its corresponding resource.- Siehe auch:
-
getNonJavaResources
Returns an array of non-java resources contained in the receiver.- Angegeben von:
getNonJavaResourcesin SchnittstelleIPackageFragmentRoot- Gibt zurück:
- an array of non-Java resources (
IFiles,IFolders, orIStorages if the package fragment root is in archive) contained in this package fragment root - Löst aus:
JavaModelException- if this element does not exist or if an exception occurs while accessing its corresponding resource.- Siehe auch:
-
getPackageFragment
Beschreibung aus Schnittstelle kopiert:IPackageFragmentRootReturns the package fragment with the given package name. An empty string indicates the default package. This is a handle-only operation. The package fragment may or may not exist.- Angegeben von:
getPackageFragmentin SchnittstelleIPackageFragmentRoot- Parameter:
packageName- the given package name- Gibt zurück:
- the package fragment with the given package name
- Siehe auch:
-
getPackageFragment
-
getPackageFragment
-
getPackageName
Returns the package name for the given folder (which is a decendent of this root). -
getPath
public org.eclipse.core.runtime.IPath getPath()Beschreibung aus Schnittstelle kopiert:IJavaElementReturns 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 or to the folder in the file system. This is a handle-only method.- Angegeben von:
getPathin SchnittstelleIJavaElement- Gibt zurück:
- the path to the innermost resource enclosing this element
- Siehe auch:
-
internalPath
public org.eclipse.core.runtime.IPath internalPath() -
getRawClasspathEntry
Beschreibung aus Schnittstelle kopiert:IPackageFragmentRootReturns the first raw classpath entry that corresponds to this package fragment root. A raw classpath entry corresponds to a package fragment root if once resolved this entry's path is equal to the root's path.- Angegeben von:
getRawClasspathEntryin SchnittstelleIPackageFragmentRoot- Gibt zurück:
- the first raw classpath entry that corresponds to this package fragment root
- Löst aus:
JavaModelException- if this element does not exist or if an exception occurs while accessing its corresponding resource.
-
getResolvedClasspathEntry
Beschreibung aus Schnittstelle kopiert:IPackageFragmentRootReturns the first resolved classpath entry that corresponds to this package fragment root. A resolved classpath entry is said to correspond to a root if the path of the resolved entry is equal to the root's path.- Angegeben von:
getResolvedClasspathEntryin SchnittstelleIPackageFragmentRoot- Gibt zurück:
- the first resolved classpath entry that corresponds to this package fragment root
- Löst aus:
JavaModelException- if this element does not exist or if an exception occurs while accessing its corresponding resource.
-
resource
public org.eclipse.core.resources.IResource resource() -
resource
-
getSourceAttachmentPath
Beschreibung aus Schnittstelle kopiert:IPackageFragmentRootReturns the absolute path to the source archive attached to this package fragment root's binary archive.- Angegeben von:
getSourceAttachmentPathin SchnittstelleIPackageFragmentRoot- Gibt zurück:
- the absolute path to the corresponding source archive,
or
nullif this package fragment root's binary archive has no corresponding source archive, or if this package fragment root is not a binary archive - Löst aus:
JavaModelException- if this operation fails- Siehe auch:
-
setSourceMapper
For use byAttachSourceOperationonly. Sets the source mapper associated with this root.- Löst aus:
JavaModelException
-
getSourceAttachmentRootPath
Beschreibung aus Schnittstelle kopiert:IPackageFragmentRootReturns the path within this package fragment root's source archive. An empty path indicates that packages are located at the root of the source archive.- Angegeben von:
getSourceAttachmentRootPathin SchnittstelleIPackageFragmentRoot- Gibt zurück:
- the path within the corresponding source archive,
or
nullif this package fragment root's binary archive has no corresponding source archive, or if this package fragment root is not a binary archive - Löst aus:
JavaModelException- if this operation fails- Siehe auch:
-
getSourceMapper
Beschreibung aus Klasse kopiert:JavaElementReturns the SourceMapper facility for this element, ornullif this element does not have a SourceMapper.- Setzt außer Kraft:
getSourceMapperin KlasseJavaElement- Siehe auch:
-
getUnderlyingResource
Beschreibung aus Schnittstelle kopiert:IJavaElementReturns the smallest underlying resource that contains this element, ornullif this element is not contained in a resource.- Angegeben von:
getUnderlyingResourcein SchnittstelleIJavaElement- Setzt außer Kraft:
getUnderlyingResourcein KlasseOpenable- Gibt zurück:
- the underlying resource, or
nullif none - Löst aus:
JavaModelException- if this element does not exist or if an exception occurs while accessing its underlying resource- Siehe auch:
-
hasChildren
Beschreibung aus Schnittstelle kopiert:IParentReturns whether this element has one or more immediate children. This is a convenience method, and may be more efficient than testing whethergetChildrenis an empty array.- Angegeben von:
hasChildrenin SchnittstelleIParent- Setzt außer Kraft:
hasChildrenin KlasseJavaElement- Gibt zurück:
- true if the immediate children of this element, false otherwise
- Löst aus:
JavaModelException- if this element does not exist or if an exception occurs while accessing its corresponding resource- Siehe auch:
-
hashCode
public int hashCode()Beschreibung aus Klasse kopiert:JavaElementReturns 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.- Setzt außer Kraft:
hashCodein KlasseJavaElement
-
ignoreOptionalProblems
public boolean ignoreOptionalProblems() -
isArchive
public boolean isArchive()Beschreibung aus Schnittstelle kopiert:IPackageFragmentRootReturns whether this package fragment root's underlying resource is a binary archive (a JAR or zip file).This is a handle-only method.
- Angegeben von:
isArchivein SchnittstelleIPackageFragmentRoot- Gibt zurück:
- true if this package fragment root's underlying resource is a binary archive, false otherwise
- Siehe auch:
-
isExternal
public boolean isExternal()Beschreibung aus Schnittstelle kopiert:IPackageFragmentRootReturns 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.
- Angegeben von:
isExternalin SchnittstelleIPackageFragmentRoot- Gibt zurück:
- true if this package fragment root is external to the workbench (that is, a local file), and has no underlying resource, false otherwise
- Siehe auch:
-
validateOnClasspath
protected org.eclipse.core.runtime.IStatus validateOnClasspath() -
move
public void move(org.eclipse.core.runtime.IPath destination, int updateResourceFlags, int updateModelFlags, IClasspathEntry sibling, org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException Beschreibung aus Schnittstelle kopiert:IPackageFragmentRootMoves the resource of this package fragment root to the destination path as specified byIResource.move(IPath,int,IProgressMonitor)but excluding nested source folders.If
NO_RESOURCE_MODIFICATIONis specified inupdateModelFlagsor if this package fragment root is external, this operation doesn't move the resource.updateResourceFlagsis then ignored.If
DESTINATION_PROJECT_CLASSPATHis specified inupdateModelFlags, updates the classpath of the destination's project (if it is a Java project). If a non-nullsibling is specified, a copy of this root's classpath entry is inserted before the sibling on the destination project's raw classpath. Ifnullis specified, the classpath entry is added at the end of the raw classpath.If
ORIGINATING_PROJECT_CLASSPATHis specified inupdateModelFlags, update the raw classpath of this package fragment root's project by removing the corresponding classpath entry.If
OTHER_REFERRING_PROJECTS_CLASSPATHis specified inupdateModelFlags, update the raw classpaths of all other Java projects referring to this root's resource by removing the corresponding classpath entries.If
REPLACEis specified inupdateModelFlags, overwrites the resource at the destination path if any. If the same classpath entry already exists on the destination project's raw classpath, then the sibling is ignored and the new classpath entry replaces the existing one.If no flags is specified in
updateModelFlags(usingIResource.NONE), the default behavior applies: the resource is moved (if this package fragment root is not external) and no classpaths are updated.- Angegeben von:
movein SchnittstelleIPackageFragmentRoot- Parameter:
destination- the destination pathupdateResourceFlags- bit-wise or of update flag constants (IResource.FORCE,IResource.KEEP_HISTORYandIResource.SHALLOW)updateModelFlags- bit-wise or of update resource flag constants (DESTINATION_PROJECT_CLASSPATH,ORIGINATING_PROJECT_CLASSPATH,OTHER_REFERRING_PROJECTS_CLASSPATHandNO_RESOURCE_MODIFICATION)sibling- the classpath entry before which a copy of the classpath entry should be inserted ornullif the classpath entry should be inserted at the endmonitor- a progress monitor- Löst aus:
JavaModelException- if this root could not be moved. Reasons include:- This root does not exist (ELEMENT_DOES_NOT_EXIST)
- A
CoreExceptionoccurred while copying the resource or updating a classpath -
The destination is not inside an existing project and
updateModelFlagshas been specified asDESTINATION_PROJECT_CLASSPATH(INVALID_DESTINATION) - The sibling is not a classpath entry on the destination project's raw classpath (INVALID_SIBLING)
- The same classpath entry already exists on the destination project's
classpath (NAME_COLLISION) and
updateModelFlagshas not been specified asREPLACE
- Siehe auch:
-
IResource.move(IPath, boolean, IProgressMonitor)
-
toStringInfo
Beschreibung aus Klasse kopiert:JavaElementDebugging purposes- Setzt außer Kraft:
toStringInfoin KlasseJavaElement- Parameter:
showResolvedInfo- TODO
-
validateExistence
protected org.eclipse.core.runtime.IStatus validateExistence(org.eclipse.core.resources.IResource underlyingResource) - Angegeben von:
validateExistencein KlasseOpenable
-
verifyAttachSource
protected void verifyAttachSource(org.eclipse.core.runtime.IPath sourcePath) throws JavaModelException Possible failures:- ELEMENT_NOT_PRESENT - the root supplied to the operation does not exist
- INVALID_ELEMENT_TYPES - the root is not of kind K_BINARY
- RELATIVE_PATH - the path supplied to this operation must be an absolute path
- Löst aus:
JavaModelException
-
getClassFilePath
Returns the relative path within an archive for the given class file name. In certain kind of archives, such as a JMOD file, class files are stored in a nested folder, as opposed to directly under the root. It is the responsibility of such package fragment roots to provide the custom behavior.- Parameter:
classname-- Gibt zurück:
- the relative path for the class file within the archive
-
getModuleDescription
Beschreibung aus Schnittstelle kopiert:IPackageFragmentRootReturns theIModuleDescriptionthat this package fragment root contains. Returnsnullif the root doesn't contain any named module or if the project compiler compliance is 1.8 or lower. If present the module descriptor is found as a child of the package fragment representing the default package. Note that only one of the source package fragment roots in a Java Project can legally contain a module descriptor.- Angegeben von:
getModuleDescriptionin SchnittstelleIPackageFragmentRoot- Gibt zurück:
- the
IModuleDescriptionthis root contains.
-
getAutomaticModuleDescription
- Löst aus:
JavaModelException
-
hasCompilationUnit
-
getManifest
Convenience lookup, though currently only JarPackageFragmentRoot is searched for a manifest. -
isComplianceJava9OrHigher
protected boolean isComplianceJava9OrHigher()
-