Klasse ClasspathEntry
- Alle implementierten Schnittstellen:
IClasspathEntry
- Siehe auch:
-
Verschachtelte Klassen - Übersicht
-
Feldübersicht
Modifizierer und TypFeldBeschreibungint
Describes the kind of package fragment roots found on this classpath entry - either K_BINARY or K_SOURCE or K_OUTPUT.static final String
int
Describes the kind of classpath entry - one of CPE_PROJECT, CPE_LIBRARY, CPE_SOURCE, CPE_VARIABLE or CPE_CONTAINERstatic final org.eclipse.core.runtime.IPath[]
The extra attributesstatic final org.eclipse.core.runtime.IPath[]
boolean
The export flagstatic final int
A constant indicating an output location.static final IAccessRule[]
static final ClasspathEntry[]
static final IClasspathAttribute[]
org.eclipse.core.runtime.IPath
The meaning of the path of a classpath entry depends on its entry kind: Source code in the current project (CPE_SOURCE
) - The path associated with this entry is the absolute path to the root folder.org.eclipse.core.runtime.IPath
Describes the path to the source archive associated with this classpath entry, ornull
if this classpath entry has no source attachment.org.eclipse.core.runtime.IPath
Describes the path within the source archive where package fragments are located.org.eclipse.core.runtime.IPath
Specific output location (for this source entry)static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
Von Schnittstelle geerbte Felder org.aspectj.org.eclipse.jdt.core.IClasspathEntry
CPE_CONTAINER, CPE_LIBRARY, CPE_PROJECT, CPE_SOURCE, CPE_VARIABLE
-
Konstruktorübersicht
KonstruktorBeschreibungClasspathEntry
(int contentKind, int entryKind, org.eclipse.core.runtime.IPath path, org.eclipse.core.runtime.IPath[] inclusionPatterns, org.eclipse.core.runtime.IPath[] exclusionPatterns, org.eclipse.core.runtime.IPath sourceAttachmentPath, org.eclipse.core.runtime.IPath sourceAttachmentRootPath, org.eclipse.core.runtime.IPath specificOutputLocation, boolean isExported, IAccessRule[] accessRules, boolean combineAccessRules, IClasspathAttribute[] extraAttributes) ClasspathEntry
(int contentKind, int entryKind, org.eclipse.core.runtime.IPath path, org.eclipse.core.runtime.IPath[] inclusionPatterns, org.eclipse.core.runtime.IPath[] exclusionPatterns, org.eclipse.core.runtime.IPath sourceAttachmentPath, org.eclipse.core.runtime.IPath sourceAttachmentRootPath, org.eclipse.core.runtime.IPath specificOutputLocation, IClasspathEntry referencingEntry, boolean isExported, IAccessRule[] accessRules, boolean combineAccessRules, IClasspathAttribute[] extraAttributes) Creates a class path entry of the specified kind with the given path. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungboolean
Returns whether the access rules of the project's exported entries should be combined with this entry's access rules.combineWith
(ClasspathEntry referringEntry) Used to perform export/restriction propagation across referring projects/containers.static IClasspathEntry
elementDecode
(Element element, IJavaProject project, Map unknownElements) void
elementEncode
(org.aspectj.org.eclipse.jdt.internal.core.XMLWriter writer, org.eclipse.core.runtime.IPath projectPath, boolean indent, boolean newLine, Map unknownElements, boolean isReferencedEntry) Returns the XML encoding of the class path.boolean
Returns true if the given object is a classpath entry with equivalent attributes.static org.eclipse.core.runtime.IPath
findAnnotationPathViaContainer
(org.eclipse.core.resources.IProject project, String rawAnnotationPath, boolean resolve) char[][]
char[][]
Returns the possibly empty list of access rules for this entry.static IAccessRule[]
getAccessRules
(org.eclipse.core.runtime.IPath[] accessibleFiles, org.eclipse.core.runtime.IPath[] nonAccessibleFiles) static NodeList
getChildAttributes
(String childName, NodeList children, boolean[] foundChildren) int
Returns the kind of files found in the package fragments identified by this classpath entry.int
Returns the kind of this classpath entry.org.eclipse.core.runtime.IPath[]
Returns the set of patterns used to exclude resources or classes associated with this classpath entry.org.eclipse.core.runtime.IPath
getExternalAnnotationPath
(org.eclipse.core.resources.IProject project, boolean resolve) Answer the path for external annotations (for null analysis) associated with this classpath entry.static String
getExtraAttribute
(IClasspathEntry entry, String attributeName) Returns the extra classpath attributes for this classpath entry.org.eclipse.core.runtime.IPath[]
Returns the set of patterns used to explicitly define resources or classes to be included with this classpath entry.This function computes the URL of the index location for this classpath entry.org.eclipse.core.runtime.IPath
Returns the full path to the specific location where the builder writes.class
files generated for this source entry (entry kindIClasspathEntry.CPE_SOURCE
).org.eclipse.core.runtime.IPath
getPath()
Returns the path of this classpath entry.Returns the classpath entry that is making a reference to this classpath entry.Veraltet.org.eclipse.core.runtime.IPath
Returns the path to the source archive or folder associated with this classpath entry, ornull
if this classpath entry has no source attachment.org.eclipse.core.runtime.IPath
Returns the path within the source archive or folder where package fragments are located.static boolean
hasDotDot
(org.eclipse.core.runtime.IPath path) int
hashCode()
Returns the hash code for this classpath entryboolean
boolean
Returns whether this entry is exported to dependent projects.boolean
static boolean
isModular
(IClasspathEntry classpathEntry) Checks if the specified classpath entry is on the module path for compilation.boolean
static org.eclipse.core.runtime.IPath[]
resolvedChainedLibraries
(org.eclipse.core.runtime.IPath jarPath) resolvedDotDot
(org.eclipse.core.runtime.IPath reference) static org.eclipse.core.runtime.IPath
resolveDotDot
(org.eclipse.core.runtime.IPath reference, org.eclipse.core.runtime.IPath path) rootID()
Answers an ID which is used to distinguish entries during package fragment root computationsstatic void
setSharedIndexLocation
(String value, Class<?> clazz) toString()
Returns a printable representation of this classpath entry.static IJavaModelStatus
validateClasspath
(IJavaProject javaProject, IClasspathEntry[] rawClasspath, org.eclipse.core.runtime.IPath projectOutputLocation) Validate a given classpath and output location for a project, using the following rules: Classpath entries cannot collide with each other; that is, all entry paths must be unique.static IJavaModelStatus
validateClasspathEntry
(IJavaProject project, IClasspathEntry entry, boolean checkSourceAttachment, boolean referredByContainer) Returns a Java model status describing the problem related to this classpath entry if any, a status object with codeIStatus.OK
if the entry is fine (that is, if the given classpath entry denotes a valid element to be referenced onto a classpath).withExtraAttributeRemoved
(String attrName) Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden org.aspectj.org.eclipse.jdt.core.IClasspathEntry
isTest, isWithoutTestCode
-
Felddetails
-
TAG_CLASSPATH
- Siehe auch:
-
TAG_CLASSPATHENTRY
- Siehe auch:
-
TAG_REFERENCED_ENTRY
- Siehe auch:
-
TAG_OUTPUT
- Siehe auch:
-
TAG_KIND
- Siehe auch:
-
TAG_PATH
- Siehe auch:
-
TAG_SOURCEPATH
- Siehe auch:
-
TAG_ROOTPATH
- Siehe auch:
-
TAG_EXPORTED
- Siehe auch:
-
TAG_INCLUDING
- Siehe auch:
-
TAG_EXCLUDING
- Siehe auch:
-
TAG_ATTRIBUTES
- Siehe auch:
-
TAG_ATTRIBUTE
- Siehe auch:
-
TAG_ATTRIBUTE_NAME
- Siehe auch:
-
TAG_ATTRIBUTE_VALUE
- Siehe auch:
-
TAG_COMBINE_ACCESS_RULES
- Siehe auch:
-
TAG_ACCESS_RULES
- Siehe auch:
-
TAG_ACCESS_RULE
- Siehe auch:
-
TAG_PATTERN
- Siehe auch:
-
TAG_ACCESSIBLE
- Siehe auch:
-
TAG_NON_ACCESSIBLE
- Siehe auch:
-
TAG_DISCOURAGED
- Siehe auch:
-
TAG_IGNORE_IF_BETTER
- Siehe auch:
-
entryKind
public int entryKindDescribes the kind of classpath entry - one of CPE_PROJECT, CPE_LIBRARY, CPE_SOURCE, CPE_VARIABLE or CPE_CONTAINER -
contentKind
public int contentKindDescribes the kind of package fragment roots found on this classpath entry - either K_BINARY or K_SOURCE or K_OUTPUT. -
path
public org.eclipse.core.runtime.IPath pathThe meaning of the path of a classpath entry depends on its entry kind:- Source code in the current project (
CPE_SOURCE
) - The path associated with this entry is the absolute path to the root folder. - A binary library in the current project (
CPE_LIBRARY
) - the path associated with this entry is the absolute path to the JAR (or root folder), and in case it refers to an external JAR, then there is no associated resource in the workbench. - A required project (
CPE_PROJECT
) - the path of the entry denotes the path to the corresponding project resource. - A variable entry (
CPE_VARIABLE
) - the first segment of the path is the name of a classpath variable. If this classpath variable is bound to the pathP , the path of the corresponding classpath entry is computed by appending toP the segments of the returned path without the variable. - A container entry (
CPE_CONTAINER
) - the first segment of the path is denoting the unique container identifier (for which aClasspathContainerInitializer
could be registered), and the remaining segments are used as additional hints for resolving the container entry to an actualIClasspathContainer
.
- Source code in the current project (
-
NO_ENTRIES
-
INCLUDE_ALL
public static final org.eclipse.core.runtime.IPath[] INCLUDE_ALL -
EXCLUDE_NONE
public static final org.eclipse.core.runtime.IPath[] EXCLUDE_NONE -
NO_EXTRA_ATTRIBUTES
-
NO_ACCESS_RULES
-
sourceAttachmentPath
public org.eclipse.core.runtime.IPath sourceAttachmentPathDescribes the path to the source archive associated with this classpath entry, ornull
if this classpath entry has no source attachment.Only library and variable classpath entries may have source attachments. For library classpath entries, the result path (if present) locates a source archive. For variable classpath entries, the result path (if present) has an analogous form and meaning as the variable path, namely the first segment is the name of a classpath variable.
-
sourceAttachmentRootPath
public org.eclipse.core.runtime.IPath sourceAttachmentRootPathDescribes the path within the source archive where package fragments are located. An empty path indicates that packages are located at the root of the source archive. Returns a non-null
value if and only ifgetSourceAttachmentPath
returns a non-null
value. -
referencingEntry
-
specificOutputLocation
public org.eclipse.core.runtime.IPath specificOutputLocationSpecific output location (for this source entry) -
K_OUTPUT
public static final int K_OUTPUTA constant indicating an output location.- Siehe auch:
-
DOT_DOT
- Siehe auch:
-
isExported
public boolean isExportedThe export flag -
extraAttributes
The extra attributes
-
-
Konstruktordetails
-
ClasspathEntry
public ClasspathEntry(int contentKind, int entryKind, org.eclipse.core.runtime.IPath path, org.eclipse.core.runtime.IPath[] inclusionPatterns, org.eclipse.core.runtime.IPath[] exclusionPatterns, org.eclipse.core.runtime.IPath sourceAttachmentPath, org.eclipse.core.runtime.IPath sourceAttachmentRootPath, org.eclipse.core.runtime.IPath specificOutputLocation, boolean isExported, IAccessRule[] accessRules, boolean combineAccessRules, IClasspathAttribute[] extraAttributes) -
ClasspathEntry
public ClasspathEntry(int contentKind, int entryKind, org.eclipse.core.runtime.IPath path, org.eclipse.core.runtime.IPath[] inclusionPatterns, org.eclipse.core.runtime.IPath[] exclusionPatterns, org.eclipse.core.runtime.IPath sourceAttachmentPath, org.eclipse.core.runtime.IPath sourceAttachmentRootPath, org.eclipse.core.runtime.IPath specificOutputLocation, IClasspathEntry referencingEntry, boolean isExported, IAccessRule[] accessRules, boolean combineAccessRules, IClasspathAttribute[] extraAttributes) Creates a class path entry of the specified kind with the given path.
-
-
Methodendetails
-
combineAccessRules
public boolean combineAccessRules()Beschreibung aus Schnittstelle kopiert:IClasspathEntry
Returns whether the access rules of the project's exported entries should be combined with this entry's access rules. Returns true for container entries. Returns false otherwise.- Angegeben von:
combineAccessRules
in SchnittstelleIClasspathEntry
- Gibt zurück:
- whether the access rules of the project's exported entries should be combined with this entry's access rules
-
combineWith
Used to perform export/restriction propagation across referring projects/containers. Also: propagating extraAttributes. -
withExtraAttributeRemoved
-
fullExclusionPatternChars
public char[][] fullExclusionPatternChars() -
fullInclusionPatternChars
public char[][] fullInclusionPatternChars() -
elementEncode
public void elementEncode(org.aspectj.org.eclipse.jdt.internal.core.XMLWriter writer, org.eclipse.core.runtime.IPath projectPath, boolean indent, boolean newLine, Map unknownElements, boolean isReferencedEntry) Returns the XML encoding of the class path. -
elementDecode
public static IClasspathEntry elementDecode(Element element, IJavaProject project, Map unknownElements) -
hasDotDot
public static boolean hasDotDot(org.eclipse.core.runtime.IPath path) -
getChildAttributes
-
resolvedChainedLibraries
public static org.eclipse.core.runtime.IPath[] resolvedChainedLibraries(org.eclipse.core.runtime.IPath jarPath) -
resolveDotDot
public static org.eclipse.core.runtime.IPath resolveDotDot(org.eclipse.core.runtime.IPath reference, org.eclipse.core.runtime.IPath path) -
equals
Returns true if the given object is a classpath entry with equivalent attributes. -
getAccessRules
Beschreibung aus Schnittstelle kopiert:IClasspathEntry
Returns the possibly empty list of access rules for this entry.- Angegeben von:
getAccessRules
in SchnittstelleIClasspathEntry
- Gibt zurück:
- the possibly empty list of access rules for this entry
- Siehe auch:
-
getAccessRuleSet
-
getContentKind
public int getContentKind()Beschreibung aus Schnittstelle kopiert:IClasspathEntry
Returns the kind of files found in the package fragments identified by this classpath entry.- Angegeben von:
getContentKind
in SchnittstelleIClasspathEntry
- Gibt zurück:
IPackageFragmentRoot.K_SOURCE
for files containing source code, andIPackageFragmentRoot.K_BINARY
for binary class files. There is no specified value for an entry denoting a variable (IClasspathEntry.CPE_VARIABLE
) or a classpath container (IClasspathEntry.CPE_CONTAINER
).- Siehe auch:
-
getEntryKind
public int getEntryKind()Beschreibung aus Schnittstelle kopiert:IClasspathEntry
Returns the kind of this classpath entry.- Angegeben von:
getEntryKind
in SchnittstelleIClasspathEntry
- Gibt zurück:
- one of:
IClasspathEntry.CPE_SOURCE
- this entry describes a source root in its projectIClasspathEntry.CPE_LIBRARY
- this entry describes a folder or JAR containing binariesIClasspathEntry.CPE_PROJECT
- this entry describes another projectIClasspathEntry.CPE_VARIABLE
- this entry describes a project or library indirectly via a classpath variable in the first segment of the path *IClasspathEntry.CPE_CONTAINER
- this entry describes set of entries referenced indirectly via a classpath container
- Siehe auch:
-
getExclusionPatterns
public org.eclipse.core.runtime.IPath[] getExclusionPatterns()Beschreibung aus Schnittstelle kopiert:IClasspathEntry
Returns the set of patterns used to exclude resources or classes associated with this classpath entry.For source classpath entries, exclusion patterns allow specified portions of the resource tree rooted at this source entry's path to be filtered out. If no exclusion patterns are specified, this source entry includes all relevent files. Each path specified must be a relative path, and will be interpreted relative to this source entry's path. File patterns are case-sensitive. A file matched by one or more of these patterns is excluded from the corresponding package fragment root. Exclusion patterns have higher precedence than inclusion patterns; in other words, exclusion patterns can remove files for the ones that are to be included, not the other way around.
Note that there is no need to supply a pattern to exclude ".class" files because a source entry filters these out automatically.
The pattern mechanism is similar to Ant's. Each pattern is represented as a relative path. The path segments can be regular file or folder names or simple patterns involving standard wildcard characters.
'*' matches 0 or more characters within a segment. So
*.java
matches.java
,a.java
andFoo.java
, but notFoo.properties
(does not end with.java
).'?' matches 1 character within a segment. So
?.java
matchesa.java
,A.java
, but not.java
orxyz.java
(neither have just one character before.java
).Combinations of *'s and ?'s are allowed.
The special pattern '**' matches zero or more segments. In a source entry, a path like
tests/
that ends in a trailing separator is interpreted astests/**
, and would match everything under the folder namedtests
.Example patterns in source entries (assuming that "java" is the only
Java-like extension
):-
tests/**
(or simplytests/
) matches all files under a root folder namedtests
. This includestests/Foo.java
andtests/com/example/Foo.java
, but notcom/example/tests/Foo.java
(not under a root folder namedtests
). -
tests/*
matches all files directly below a root folder namedtests
. This includestests/Foo.java
andtests/FooHelp.java
but nottests/com/example/Foo.java
(not directly under a folder namedtests
) orcom/Foo.java
(not under a folder namedtests
). -
**/tests/**
matches all files under any folder namedtests
. This includestests/Foo.java
,com/examples/tests/Foo.java
, andcom/examples/tests/unit/Foo.java
, but notcom/example/Foo.java
(not under a folder namedtests
).
- Angegeben von:
getExclusionPatterns
in SchnittstelleIClasspathEntry
- Gibt zurück:
- the possibly empty list of resource exclusion patterns
associated with this classpath entry, or
null
if this kind of classpath entry does not support exclusion patterns - Siehe auch:
-
-
getExtraAttributes
Beschreibung aus Schnittstelle kopiert:IClasspathEntry
Returns the extra classpath attributes for this classpath entry. Returns an empty array if this entry has no extra attributes.- Angegeben von:
getExtraAttributes
in SchnittstelleIClasspathEntry
- Gibt zurück:
- the possibly empty list of extra classpath attributes for this classpath entry
-
getInclusionPatterns
public org.eclipse.core.runtime.IPath[] getInclusionPatterns()Beschreibung aus Schnittstelle kopiert:IClasspathEntry
Returns the set of patterns used to explicitly define resources or classes to be included with this classpath entry.For source classpath entries, when no inclusion patterns are specified, the source entry includes all relevent files in the resource tree rooted at this source entry's path. Specifying one or more inclusion patterns means that only the specified portions of the resource tree are to be included. Each path specified must be a relative path, and will be interpreted relative to this source entry's path. File patterns are case-sensitive. A file matched by one or more of these patterns is included in the corresponding package fragment root unless it is excluded by one or more of this entrie's exclusion patterns. Exclusion patterns have higher precedence than inclusion patterns; in other words, exclusion patterns can remove files for the ones that are to be included, not the other way around.
See
IClasspathEntry.getExclusionPatterns()
for a discussion of the syntax and semantics of path patterns. The absence of any inclusion patterns is semantically equivalent to the explicit inclusion pattern**
.Example patterns in source entries:
-
The inclusion pattern
src/**
by itself includes all files under a root folder namedsrc
. -
The inclusion patterns
src/**
andtests/**
includes all files under the root folders namedsrc
andtests
. -
The inclusion pattern
src/**
together with the exclusion patternsrc/**/Foo.java
includes all files under a root folder namedsrc
except for ones namedFoo.java
.
- Angegeben von:
getInclusionPatterns
in SchnittstelleIClasspathEntry
- Gibt zurück:
- the possibly empty list of resource inclusion patterns
associated with this classpath entry, or
null
if this kind of classpath entry does not support inclusion patterns - Siehe auch:
-
The inclusion pattern
-
getOutputLocation
public org.eclipse.core.runtime.IPath getOutputLocation()Beschreibung aus Schnittstelle kopiert:IClasspathEntry
Returns the full path to the specific location where the builder writes.class
files generated for this source entry (entry kindIClasspathEntry.CPE_SOURCE
).Source entries can optionally be associated with a specific output location. If none is provided, the source entry will be implicitly associated with its project default output location (see
IJavaProject.getOutputLocation()
).NOTE: A specific output location cannot coincidate with another source/library entry.
- Angegeben von:
getOutputLocation
in SchnittstelleIClasspathEntry
- Gibt zurück:
- the full path to the specific location where the builder writes
.class
files for this source entry, ornull
if using default output folder - Siehe auch:
-
getPath
public org.eclipse.core.runtime.IPath getPath()Beschreibung aus Schnittstelle kopiert:IClasspathEntry
Returns the path of this classpath entry. The meaning of the path of a classpath entry depends on its entry kind:- Source code in the current project (
IClasspathEntry.CPE_SOURCE
) - The path associated with this entry is the absolute path to the root folder. - A binary library in the current project (
IClasspathEntry.CPE_LIBRARY
) - the path associated with this entry is the absolute path to the JAR (or root folder), and in case it refers to an external library, then there is no associated resource in the workbench. - A required project (
IClasspathEntry.CPE_PROJECT
) - the path of the entry denotes the path to the corresponding project resource. - A variable entry (
IClasspathEntry.CPE_VARIABLE
) - the first segment of the path is the name of a classpath variable. If this classpath variable is bound to the path P, the path of the corresponding classpath entry is computed by appending to P the segments of the returned path without the variable. - A container entry (
IClasspathEntry.CPE_CONTAINER
) - the path of the entry is the name of the classpath container, which can be bound indirectly to a set of classpath entries after resolution. The containerPath is a formed by a first ID segment followed with extra segments that can be used as additional hints for resolving this container reference (also seeIClasspathContainer
).
- Angegeben von:
getPath
in SchnittstelleIClasspathEntry
- Gibt zurück:
- the path of this classpath entry
- Siehe auch:
- Source code in the current project (
-
getSourceAttachmentPath
public org.eclipse.core.runtime.IPath getSourceAttachmentPath()Beschreibung aus Schnittstelle kopiert:IClasspathEntry
Returns the path to the source archive or folder associated with this classpath entry, ornull
if this classpath entry has no source attachment.Only library and variable classpath entries may have source attachments. For library classpath entries, the result path (if present) locates a source archive or folder. This archive or folder can be located in a project of the workspace or outside the workspace. For variable classpath entries, the result path (if present) has an analogous form and meaning as the variable path, namely the first segment is the name of a classpath variable.
- Angegeben von:
getSourceAttachmentPath
in SchnittstelleIClasspathEntry
- Gibt zurück:
- the path to the source archive or folder, or
null
if none - Siehe auch:
-
getSourceAttachmentRootPath
public org.eclipse.core.runtime.IPath getSourceAttachmentRootPath()Beschreibung aus Schnittstelle kopiert:IClasspathEntry
Returns the path within the source archive or folder where package fragments are located. An empty path indicates that packages are located at the root of the source archive or folder. Returns a non-null
value if and only ifIClasspathEntry.getSourceAttachmentPath()
returns a non-null
value.- Angegeben von:
getSourceAttachmentRootPath
in SchnittstelleIClasspathEntry
- Gibt zurück:
- the path within the source archive or folder, or
null
if not applicable - Siehe auch:
-
getExternalAnnotationPath
public org.eclipse.core.runtime.IPath getExternalAnnotationPath(org.eclipse.core.resources.IProject project, boolean resolve) Beschreibung aus Schnittstelle kopiert:IClasspathEntry
Answer the path for external annotations (for null analysis) associated with this classpath entry. Five shapes of paths are supported:- relative, variable (VAR/relpath): resolve classpath variable VAR and append relpath
- relative, container (CON/relpath): locate relpath among the elements within container CON
- relative, project (relpath): interpret relpath as a relative path within the given project
- absolute, workspace (/Proj/relpath): an absolute path in the workspace
- absolute, filesystem (/abspath): an absolute path in the filesystem
- Angegeben von:
getExternalAnnotationPath
in SchnittstelleIClasspathEntry
- Parameter:
project
- project whose classpath we are analysingresolve
- if true, any workspace-relative paths will be resolved to filesystem paths.- Gibt zurück:
- a path (in the workspace or filesystem-absolute) or null
-
findAnnotationPathViaContainer
public static org.eclipse.core.runtime.IPath findAnnotationPathViaContainer(org.eclipse.core.resources.IProject project, String rawAnnotationPath, boolean resolve) -
getExtraAttribute
-
getReferencingEntry
Beschreibung aus Schnittstelle kopiert:IClasspathEntry
Returns the classpath entry that is making a reference to this classpath entry. For entry kindsIClasspathEntry.CPE_LIBRARY
, the return value is the entry that is representing the JAR that includesthis
in the MANIFEST.MF file's Class-Path section. For entry kinds other thanIClasspathEntry.CPE_LIBRARY
, this returnsnull
. For those entries that are on the raw classpath already, this returnsnull
.It is possible that multiple library entries refer to the same entry via the MANIFEST.MF file. In those cases, this method returns the first classpath entry that appears in the raw classpath. However, this does not mean that the other referencing entries do not relate to their referenced entries. See
JavaCore.getReferencedClasspathEntries(IClasspathEntry, IJavaProject)
for more details.- Angegeben von:
getReferencingEntry
in SchnittstelleIClasspathEntry
- Gibt zurück:
- the classpath entry that is referencing this entry or
null
if not applicable.
-
hashCode
public int hashCode()Returns the hash code for this classpath entry -
isExported
public boolean isExported()Beschreibung aus Schnittstelle kopiert:IClasspathEntry
Returns whether this entry is exported to dependent projects. Always returnsfalse
for source entries (kindIClasspathEntry.CPE_SOURCE
), which cannot be exported.- Angegeben von:
isExported
in SchnittstelleIClasspathEntry
- Gibt zurück:
true
if exported, andfalse
otherwise- Siehe auch:
-
isOptional
public boolean isOptional() -
isModular
public boolean isModular() -
getSourceAttachmentEncoding
-
getAccessRules
public static IAccessRule[] getAccessRules(org.eclipse.core.runtime.IPath[] accessibleFiles, org.eclipse.core.runtime.IPath[] nonAccessibleFiles) -
toString
Returns a printable representation of this classpath entry. -
resolvedDotDot
-
resolvedChainedLibraries
-
rootID
Answers an ID which is used to distinguish entries during package fragment root computations -
getResolvedEntry
Veraltet.Beschreibung aus Schnittstelle kopiert:IClasspathEntry
This is a helper method, which returns the resolved classpath entry denoted by an entry (if it is a variable entry). It is obtained by resolving the variable reference in the first segment. Returnsnull
if unable to resolve using the following algorithm:- if variable segment cannot be resolved, returns
null
- finds a project, JAR or binary folder in the workspace at the resolved path location
- if none finds an external JAR file or folder outside the workspace at the resolved path location
- if none returns
null
Variable source attachment is also resolved and recorded in the resulting classpath entry.
Note that this deprecated API doesn't handle CPE_CONTAINER entries.- Angegeben von:
getResolvedEntry
in SchnittstelleIClasspathEntry
- Gibt zurück:
- the resolved library or project classpath entry, or
null
if the given path could not be resolved to a classpath entry - Siehe auch:
- if variable segment cannot be resolved, returns
-
getLibraryIndexLocation
This function computes the URL of the index location for this classpath entry. It returns null if the URL is invalid. -
ignoreOptionalProblems
public boolean ignoreOptionalProblems() -
validateClasspath
public static IJavaModelStatus validateClasspath(IJavaProject javaProject, IClasspathEntry[] rawClasspath, org.eclipse.core.runtime.IPath projectOutputLocation) Validate a given classpath and output location for a project, using the following rules:- Classpath entries cannot collide with each other; that is, all entry paths must be unique.
- The project output location path cannot be null, must be absolute and located inside the project.
- Specific output locations (specified on source entries) can be null, if not they must be located inside the project,
- A project entry cannot refer to itself directly (that is, a project cannot prerequisite itself).
- Classpath entries or output locations cannot coincidate or be nested in each other, except for the following scenario listed below:
- A source folder can coincidate with its own output location, in which case this output can then contain library archives. However, a specific output location cannot coincidate with any library or a distinct source folder than the one referring to it.
- A source/library folder can be nested in any source folder as long as the nested folder is excluded from the enclosing one.
- An output location can be nested in a source folder, if the source folder coincidates with the project itself, or if the output location is excluded from the source folder.
This validation is intended to anticipate classpath issues prior to assigning it to a project. In particular, it will automatically be performed during the classpath setting operation (if validation fails, the classpath setting will not complete).
- Parameter:
javaProject
- the given java projectrawClasspath
- a given classpathprojectOutputLocation
- a given output location- Gibt zurück:
- a status object with code
IStatus.OK
if the given classpath and output location are compatible, otherwise a status object indicating what is wrong with the classpath or output location
-
validateClasspathEntry
public static IJavaModelStatus validateClasspathEntry(IJavaProject project, IClasspathEntry entry, boolean checkSourceAttachment, boolean referredByContainer) Returns a Java model status describing the problem related to this classpath entry if any, a status object with codeIStatus.OK
if the entry is fine (that is, if the given classpath entry denotes a valid element to be referenced onto a classpath).- Parameter:
project
- the given java projectentry
- the given classpath entrycheckSourceAttachment
- a flag to determine if source attachment should be checkedreferredByContainer
- flag indicating whether the given entry is referred by a classpath container- Gibt zurück:
- a java model status describing the problem related to this classpath entry if any, a status object with code
IStatus.OK
if the entry is fine
-
isModular
Checks if the specified classpath entry is on the module path for compilation.- Parameter:
classpathEntry
- The entry for which to check.- Gibt zurück:
true
if this classpath entry is on the compile module path,false
otherwise.
-