Interface IClasspathAttribute
newClasspathAttribute(String name, String value)
.- Since:
- 3.1
- See Also:
-
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)
- Restriction:
- This interface is not intended to be implemented by clients.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Constant for the name of the add-exports attribute.static final String
Constant for the name of the add-opens attribute.static final String
Constant for the name of the add-reads attribute.static final String
Constant for the name of the external annotation path attribute.static final String
Constant for the name of the ignore optional compile problems attribute.static final String
Constant for the name of the index location attribute.static final String
Constant for the name of the javadoc location attribute.static final String
Constant for the name of the limit-modules attribute.static final String
Constant for the name of the module attribute.static final String
Constant of the name of the module-main-class attribute.static final String
Constant for the name of the optional attribute.static final String
Constant for the name of the patch-module attribute.static final String
Constant for the name of the encoding to be used for source attachments.static final String
Constant for the name of the test attribute.static final String
Constant for the name of the without_test_code attribute. -
Method Summary
-
Field Details
-
JAVADOC_LOCATION_ATTRIBUTE_NAME
Constant for the name of the javadoc location attribute.The value for this attribute has to be the string representation of a URL.
- Since:
- 3.1
- See Also:
-
INDEX_LOCATION_ATTRIBUTE_NAME
Constant for the name of the index location attribute.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.
- Since:
- 3.8
- See Also:
-
SOURCE_ATTACHMENT_ENCODING
Constant for the name of the encoding to be used for source attachments.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:
- Encoding explicitly set on the source file (java or zip), i.e.
org.eclipse.core.resources.IFile#getCharset(false)
- Encoding set on the corresponding classpath entry
- If the source attachment is a folder, then the encoding determined by the file content if detectable
- If the source attachment is in the workspace, then the encoding of the enclosing resources
- Since:
- 3.8
- See Also:
-
IFile.getCharset()
- Constant Field Values
- Encoding explicitly set on the source file (java or zip), i.e.
-
IGNORE_OPTIONAL_PROBLEMS
Constant for the name of the ignore optional compile problems attribute. This attribute is valid only for classpath entries describing source folders. The possible values for this attribute are"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.- Since:
- 3.8
- See Also:
-
OPTIONAL
Constant for the name of the optional attribute. The possible values for this attribute are"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.- Since:
- 3.2
- See Also:
-
MODULE
Constant for the name of the module attribute. The possible values for this attribute are"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.- Since:
- 3.14
- See Also:
-
ADD_EXPORTS
Constant for the name of the add-exports attribute.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"
.- Since:
- 3.14
- See Also:
-
ADD_OPENS
Constant for the name of the add-opens attribute.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"
.- Since:
- 3.18
- See Also:
-
ADD_READS
Constant for the name of the add-reads attribute.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.- Since:
- 3.14
- See Also:
-
PATCH_MODULE
Constant for the name of the patch-module attribute.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
andIClasspathEntry.CPE_PROJECT
. A classpath entry having this attribute must also have theMODULE
attribute with value"true"
.- Since:
- 3.14
- See Also:
-
LIMIT_MODULES
Constant for the name of the limit-modules attribute.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 theMODULE
attribute with value"true"
.- Since:
- 3.14
- See Also:
-
MODULE_MAIN_CLASS
Constant of the name of the module-main-class attribute. The classpath entry holding this attribute must refer to a source folder containing the implementation of a module.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 inmodule-info.class
.- Since:
- 3.14
- See Also:
-
EXTERNAL_ANNOTATION_PATH
Constant for the name of the external annotation path attribute.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.
- Since:
- 3.11
- See Also:
-
TEST
Constant for the name of the test attribute.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.
- Since:
- 3.14
- See Also:
-
WITHOUT_TEST_CODE
Constant for the name of the without_test_code attribute.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.- Since:
- 3.14
- See Also:
-
-
Method Details