public interface IClasspathAttribute
newClasspathAttribute(String name, String value).JavaCore#newContainerEntry(
org.eclipse.core.runtime.IPath containerPath,
IAccessRule[] accessRules,
IClasspathAttribute[] extraAttributes,
boolean isExported),
JavaCore#newLibraryEntry(
org.eclipse.core.runtime.IPath path,
org.eclipse.core.runtime.IPath sourceAttachmentPath,
org.eclipse.core.runtime.IPath sourceAttachmentRootPath,
IAccessRule[] accessRules,
IClasspathAttribute[] extraAttributes,
boolean isExported),
JavaCore#newProjectEntry(
org.eclipse.core.runtime.IPath path,
IAccessRule[] accessRules,
boolean combineAccessRestrictions,
IClasspathAttribute[] extraAttributes,
boolean isExported),
JavaCore#newSourceEntry(
org.eclipse.core.runtime.IPath path,
org.eclipse.core.runtime.IPath[] inclusionPatterns,
org.eclipse.core.runtime.IPath[] exclusionPatterns,
org.eclipse.core.runtime.IPath specificOutputLocation,
IClasspathAttribute[] extraAttributes),
JavaCore#newVariableEntry(
org.eclipse.core.runtime.IPath variablePath,
org.eclipse.core.runtime.IPath variableSourceAttachmentPath,
org.eclipse.core.runtime.IPath variableSourceAttachmentRootPath,
IAccessRule[] accessRules,
IClasspathAttribute[] extraAttributes,
boolean isExported)| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ADD_EXPORTS
Constant for the name of the add-exports attribute.
|
static java.lang.String |
ADD_OPENS
Constant for the name of the add-opens attribute.
|
static java.lang.String |
ADD_READS
Constant for the name of the add-reads attribute.
|
static java.lang.String |
EXTERNAL_ANNOTATION_PATH
Constant for the name of the external annotation path attribute.
|
static java.lang.String |
IGNORE_OPTIONAL_PROBLEMS
Constant for the name of the ignore optional compile problems attribute.
|
static java.lang.String |
INDEX_LOCATION_ATTRIBUTE_NAME
Constant for the name of the index location attribute.
|
static java.lang.String |
JAVADOC_LOCATION_ATTRIBUTE_NAME
Constant for the name of the javadoc location attribute.
|
static java.lang.String |
LIMIT_MODULES
Constant for the name of the limit-modules attribute.
|
static java.lang.String |
MODULE
Constant for the name of the module attribute.
|
static java.lang.String |
MODULE_MAIN_CLASS
Constant of the name of the module-main-class attribute.
|
static java.lang.String |
OPTIONAL
Constant for the name of the optional attribute.
|
static java.lang.String |
PATCH_MODULE
Constant for the name of the patch-module attribute.
|
static java.lang.String |
SOURCE_ATTACHMENT_ENCODING
Constant for the name of the encoding to be used for source attachments.
|
static java.lang.String |
TEST
Constant for the name of the test attribute.
|
static java.lang.String |
WITHOUT_TEST_CODE
Constant for the name of the without_test_code attribute.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getName()
Returns the name of this classpath attribute.
|
java.lang.String |
getValue()
Returns the value of this classpath attribute.
|
static final java.lang.String JAVADOC_LOCATION_ATTRIBUTE_NAME
The value for this attribute has to be the string representation of a URL.
static final java.lang.String INDEX_LOCATION_ATTRIBUTE_NAME
The value for this attribute has to be the string representation of a URL. It should point to an existing index file in a folder or a jar. The URL can also be of platform protocol.
static final java.lang.String SOURCE_ATTACHMENT_ENCODING
The value of this attribute has to be a string representation of a valid encoding. The encoding for a source attachment is determined in the following order:
org.eclipse.core.resources.IFile#getCharset(false) org.eclipse.core.resources.IFile#getCharset(),
Constant Field Valuesstatic final java.lang.String IGNORE_OPTIONAL_PROBLEMS
"true" or
"false". When not present, "false" is assumed.
If the value of this attribute is "true", all optional problems
from the source folder described by this classpath entry will not be reported
by the compiler.static final java.lang.String OPTIONAL
"true" or "false".
When not present, "false" is assumed.
If the value of this attribute is "true", the classpath entry
is optional. If the underlying resource or jar file doesn't exist, no error
is reported and the classpath entry is ignored.static final java.lang.String MODULE
"true" or "false".
When not present, "false" is assumed.
If the value of this attribute is "true", the classpath
entry is considered to be on the module path and will be treated as a
regular named module or as an automatic module.static final java.lang.String ADD_EXPORTS
The value of this attribute must adhere to the syntax of javac's
--add-exports command line option: <source-module>/<package>=<target-module>(,<target-module>)*.
Multiple such options are packed as a ':' separated list into a single classpath attribute.
The given exports will be added at compile time.
Classpath entries with this attribute should also have a MODULE attribute
with value "true".
static final java.lang.String ADD_OPENS
The value of this attribute must adhere to the syntax of javac's
--add-opens command line option: <source-module>/<package>=<target-module>(,<target-module>)*.
Multiple such options are packed as a ':' separated list into a single classpath attribute.
The given opens will be added at launch time.
Classpath entries with this attribute should also have a MODULE attribute
with value "true".
static final java.lang.String ADD_READS
The value of this attribute must adhere to the syntax of javac's
--add-reads command line option: <source-module>=<target-module>.
Multiple such options are packed as a ':' separated list into a single classpath attribute.
The given reads edge will be added at compile time.
static final java.lang.String PATCH_MODULE
The value of this attribute must adhere to the syntax of javac's
--patch-module command line option: <module>=<file>(<pathsep><file>)*.
All compilation units found in the locations specified as <file>
will be associated with the module specified using its name.
The specified module must be defined by the container, library or project referenced by the current classpath entry.
Each <file> location is the workspace path of either a Java project,
or a source folder. Specifying a Java project is a shorthand for listing
all source folders of that project.
The attribute value can be further shortened to just the module name, in which
case the file locations will be assumed as all source folders of the
current Java project. This short format is still understood to maintain compatibility
with versions prior to 3.18, but it is discouraged moving forward.
If this attributes is attached to a multi-module container, multiple
attribute values of the format defined above are concatenated into one attribute,
using "::" as the separator.
This attribute is supported for classpath entries of kind
IClasspathEntry.CPE_CONTAINER, IClasspathEntry.CPE_LIBRARY
and IClasspathEntry.CPE_PROJECT.
A classpath entry having this attribute must also have the
MODULE attribute with value "true".
static final java.lang.String LIMIT_MODULES
The value of this attribute must be a comma-separated list of names of modules defined in the classpath entry, to which this attribute is attached. The set of modules observable through this entry will be limited to the transitive closure of modules in this list.
This attribute is supported for classpath entries of kind
IClasspathEntry.CPE_CONTAINER.
A classpath entry having this attribute must also have the
MODULE attribute with value "true".
static final java.lang.String MODULE_MAIN_CLASS
The value of this attribute must be the name of a class defined in this module.
It will be used for generating the ModuleMainClass attribute
in module-info.class.
static final java.lang.String EXTERNAL_ANNOTATION_PATH
The value for this attribute has to be the string representation of a path. It should point to an existing directory where external annotations can be found to support annotation based null analysis involving 3rd party libraries.
static final java.lang.String TEST
The possible values for this attribute are "true" or "false". When not present,
"false" is assumed. If the value of this attribute is "true", and the classpath entry
is a source folder, it is assumed to contain test sources, otherwise main sources.
During the compilation of main sources, only code is visible, that is reachable via classpath entries which do not have the test attribute set to to "true". During the compilation of test sources, all code is visible as if this attribute didn't exist at all.
static final java.lang.String WITHOUT_TEST_CODE
The possible values for this attribute are "true" or "false". When not present,
"false" is assumed. If the value of this attribute is "true", and the classpath entry
is a project, any test code reachable via that classpath entry will not be visible even to test sources.