APIdia Launch Partner
Top Description Fields Constructors Methods
java.lang

pack-priv Class NamedPackage

extends Object
Class Inheritance
Known Direct Subclasses
java.lang.Package
Imports
java.lang.module.Configuration, .ModuleReference, java.net.URI

A NamedPackage represents a package by name in a specific module. A class loader will automatically create NamedPackage for each package when a class is defined. Package object is lazily defined until Class::getPackage, Package::getPackage(s), or ClassLoader::getDefinedPackage(s) method is called. NamedPackage allows ClassLoader to keep track of the runtime packages with minimal footprint and avoid constructing Package object.

Field Summary

Modifier and TypeField and Description
private final Module
private final String

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv URI
location()

Returns the location of the module if this named package is in a named module; otherwise, returns null.

pack-priv Module
module()

Returns the module of this named package.

pack-priv String
packageName()

Returns the name of this package.

pack-priv static Package
toPackage(String name, Module module)

Creates a Package object of the given name and module.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

moduleback to summary
private final Module module
nameback to summary
private final String name

Constructor Detail

NamedPackageback to summary
pack-priv NamedPackage(String pn, Module module)

Method Detail

locationback to summary
pack-priv URI location()

Returns the location of the module if this named package is in a named module; otherwise, returns null.

moduleback to summary
pack-priv Module module()

Returns the module of this named package.

packageNameback to summary
pack-priv String packageName()

Returns the name of this package.

toPackageback to summary
pack-priv static Package toPackage(String name, Module module)

Creates a Package object of the given name and module.