| java.lang.Object org.eclipse.jdt.internal.core.ClasspathEntry
Inner Class :static class UnknownXmlElements | |
Constructor Summary | |
public | ClasspathEntry(int contentKind, int entryKind, IPath path, IPath[] inclusionPatterns, IPath[] exclusionPatterns, IPath sourceAttachmentPath, IPath sourceAttachmentRootPath, IPath specificOutputLocation, boolean isExported, IAccessRule[] accessRules, boolean combineAccessRules, IClasspathAttribute[] extraAttributes) Creates a class path entry of the specified kind with the given path. |
Method Summary | |
public boolean | combineAccessRules() | public ClasspathEntry | combineWith(ClasspathEntry referringEntry) | static IAccessRule[] | decodeAccessRules(NodeList list) | static IClasspathAttribute[] | decodeExtraAttributes(NodeList attributes) | public static IClasspathEntry | elementDecode(Element element, IJavaProject project, Map unknownElements) | public void | elementEncode(XMLWriter writer, IPath projectPath, boolean indent, boolean newLine, Map unknownElements) Returns the XML encoding of the class path. | void | encodeAccessRules(XMLWriter writer, boolean indent, boolean newLine) | void | encodeExtraAttributes(XMLWriter writer, boolean indent, boolean newLine) | public boolean | equals(Object object) Returns true if the given object is a classpath entry
with equivalent attributes. | public char[][] | fullExclusionPatternChars() | public char[][] | fullInclusionPatternChars() | public AccessRuleSet | getAccessRuleSet() | public IAccessRule[] | getAccessRules() | public static IAccessRule[] | getAccessRules(IPath[] accessibleFiles, IPath[] nonAccessibleFiles) | public static NodeList | getChildAttributes(String childName, NodeList children, boolean[] foundChildren) | public int | getContentKind() | public int | getEntryKind() | public IPath[] | getExclusionPatterns() | public IClasspathAttribute[] | getExtraAttributes() | public IPath[] | getInclusionPatterns() | public IPath | getOutputLocation() | public IPath | getPath() | public IClasspathEntry | getResolvedEntry() | public IPath | getSourceAttachmentPath() | public IPath | getSourceAttachmentRootPath() | public int | hashCode() | public boolean | isExported() | public boolean | isOptional() | static int | kindFromString(String kindStr) Returns the kind of a PackageFragmentRoot from its String form. | static String | kindToString(int kind) Returns a String for the kind of a class path entry. | public String | rootID() | public String | toString() Returns a printable representation of this classpath entry. | public static IJavaModelStatus | validateClasspath(IJavaProject javaProject, IClasspathEntry[] rawClasspath, 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 scenarii 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.
| public static IJavaModelStatus | validateClasspathEntry(IJavaProject project, IClasspathEntry entry, boolean checkSourceAttachment, boolean recurseInContainers) Returns 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 (that is, if the
given classpath entry denotes a valid element to be referenced onto a classpath). |
EXCLUDE_NONE | final public static IPath[] EXCLUDE_NONE(Code) | | |
INCLUDE_ALL | final public static IPath[] INCLUDE_ALL(Code) | | |
K_OUTPUT | final public static int K_OUTPUT(Code) | | A constant indicating an output location.
|
TAG_ACCESSIBLE | final public static String TAG_ACCESSIBLE(Code) | | |
TAG_ACCESS_RULE | final public static String TAG_ACCESS_RULE(Code) | | |
TAG_ACCESS_RULES | final public static String TAG_ACCESS_RULES(Code) | | |
TAG_ATTRIBUTES | final public static String TAG_ATTRIBUTES(Code) | | |
TAG_ATTRIBUTE_NAME | final public static String TAG_ATTRIBUTE_NAME(Code) | | |
TAG_ATTRIBUTE_VALUE | final public static String TAG_ATTRIBUTE_VALUE(Code) | | |
TAG_CLASSPATHENTRY | final public static String TAG_CLASSPATHENTRY(Code) | | |
TAG_COMBINE_ACCESS_RULES | final public static String TAG_COMBINE_ACCESS_RULES(Code) | | |
TAG_DISCOURAGED | final public static String TAG_DISCOURAGED(Code) | | |
TAG_IGNORE_IF_BETTER | final public static String TAG_IGNORE_IF_BETTER(Code) | | |
TAG_NON_ACCESSIBLE | final public static String TAG_NON_ACCESSIBLE(Code) | | |
TAG_SOURCEPATH | final public static String TAG_SOURCEPATH(Code) | | |
contentKind | public int contentKind(Code) | | Describes the kind of package fragment roots found on
this classpath entry - either K_BINARY or K_SOURCE or
K_OUTPUT.
|
entryKind | public int entryKind(Code) | | Describes the kind of classpath entry - one of
CPE_PROJECT, CPE_LIBRARY, CPE_SOURCE, CPE_VARIABLE or CPE_CONTAINER
|
isExported | public boolean isExported(Code) | | The export flag
|
path | public IPath path(Code) | | 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.
- 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 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 (
CPE_CONTAINER ) - the first segment of the path is denoting
the unique container identifier (for which a ClasspathContainerInitializer could be
registered), and the remaining segments are used as additional hints for resolving the container entry to
an actual IClasspathContainer .
|
sourceAttachmentPath | public IPath sourceAttachmentPath(Code) | | Describes the path to the source archive associated with this
classpath entry, or null 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 IPath sourceAttachmentRootPath(Code) | | Describes 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 if getSourceAttachmentPath returns
a non-null value.
|
specificOutputLocation | public IPath specificOutputLocation(Code) | | Specific output location (for this source entry)
|
ClasspathEntry | public ClasspathEntry(int contentKind, int entryKind, IPath path, IPath[] inclusionPatterns, IPath[] exclusionPatterns, IPath sourceAttachmentPath, IPath sourceAttachmentRootPath, IPath specificOutputLocation, boolean isExported, IAccessRule[] accessRules, boolean combineAccessRules, IClasspathAttribute[] extraAttributes)(Code) | | Creates a class path entry of the specified kind with the given path.
|
combineAccessRules | public boolean combineAccessRules()(Code) | | |
elementEncode | public void elementEncode(XMLWriter writer, IPath projectPath, boolean indent, boolean newLine, Map unknownElements)(Code) | | Returns the XML encoding of the class path.
|
encodeAccessRules | void encodeAccessRules(XMLWriter writer, boolean indent, boolean newLine)(Code) | | |
encodeExtraAttributes | void encodeExtraAttributes(XMLWriter writer, boolean indent, boolean newLine)(Code) | | |
equals | public boolean equals(Object object)(Code) | | Returns true if the given object is a classpath entry
with equivalent attributes.
|
fullExclusionPatternChars | public char[][] fullExclusionPatternChars()(Code) | | |
fullInclusionPatternChars | public char[][] fullInclusionPatternChars()(Code) | | |
getAccessRules | public static IAccessRule[] getAccessRules(IPath[] accessibleFiles, IPath[] nonAccessibleFiles)(Code) | | |
hashCode | public int hashCode()(Code) | | Returns the hash code for this classpath entry
|
isOptional | public boolean isOptional()(Code) | | |
kindFromString | static int kindFromString(String kindStr)(Code) | | Returns the kind of a PackageFragmentRoot from its String form.
|
kindToString | static String kindToString(int kind)(Code) | | Returns a String for the kind of a class path entry.
|
rootID | public String rootID()(Code) | | Answers an ID which is used to distinguish entries during package
fragment root computations
|
toString | public String toString()(Code) | | Returns a printable representation of this classpath entry.
|
validateClasspath | public static IJavaModelStatus validateClasspath(IJavaProject javaProject, IClasspathEntry[] rawClasspath, IPath projectOutputLocation)(Code) | | 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 scenarii 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.
Note that the classpath entries are not validated automatically. Only bound variables or containers are considered
in the checking process (this allows to perform a consistency check on a classpath which has references to
yet non existing projects, folders, ...).
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).
Parameters: javaProject - the given java project Parameters: rawClasspath - a given classpath Parameters: projectOutputLocation - a given output location a status object with code IStatus.OK ifthe given classpath and output location are compatible, otherwise a statusobject indicating what is wrong with the classpath or output location |
validateClasspathEntry | public static IJavaModelStatus validateClasspathEntry(IJavaProject project, IClasspathEntry entry, boolean checkSourceAttachment, boolean recurseInContainers)(Code) | | Returns 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 (that is, if the
given classpath entry denotes a valid element to be referenced onto a classpath).
Parameters: project - the given java project Parameters: entry - the given classpath entry Parameters: checkSourceAttachment - a flag to determine if source attachement should be checked Parameters: recurseInContainers - flag indicating whether validation should be applied to container entries recursively 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 |
|
|