Represents metadata about a run-time package associated with a class loader. Metadata includes annotations, versioning, and sealing.
Annotations for the run-time package are read from package-info.class
at the same code source as classes in the run-time package.
The set of classes that make up the run-time package may implement a particular specification. The specification title, version, and vendor (indicating the owner/maintainer of the specification) can be provided when the Package
is defined. An application can ask if the Package
is compatible with a particular specification version by using the Package.isCompatibleWith(String)
method. In addition, information about the actual classes that make up the run-time package can be provided when the Package is defined. This information consists of an implementation title, version, and vendor (indicating the supplier of the classes).
A Package
may be explicitly defined with the ClassLoader.definePackage(String, String, String, String, String, String, String, URL)
method. The caller supplies the specification and implementation titles, versions, and vendors. The caller also indicates whether the package is sealed. If a Package
is not explicitly defined for a run-time package when a class in that run-time package is defined, then a Package
is automatically defined by the class's defining class loader, as follows.
A Package
automatically defined for classes in a named module has the following properties:
package-info.class
as specified above.A Package
automatically defined for classes in an unnamed module has the following properties:
""
(for classes in an unnamed package) or derived from the binary names of the classes (for classes in a named package).package-info.class
as specified above.A Package
can be obtained with the Package.getPackage(String)
and ClassLoader.getDefinedPackage(String)
methods. Every Package
defined by a class loader can be obtained with the Package.getPackages()
and ClassLoader.getDefinedPackages()
methods.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4