Uses of Class
java.lang.Package
-
Packages that use Package Package Description java.lang Provides classes that are fundamental to the design of the Java programming language.java.net Provides the classes for implementing networking applications. -
-
Uses of Package in java.lang
Methods in java.lang that return Package Modifier and Type Method Description protected Package
ClassLoader. definePackage(String name, String specTitle, String specVersion, String specVendor, String implTitle, String implVersion, String implVendor, URL sealBase)
Defines a package by name in thisClassLoader
.Package
ClassLoader. getDefinedPackage(String name)
Returns aPackage
of the given name that has been defined by this class loader.Package[]
ClassLoader. getDefinedPackages()
Returns all of thePackage
s defined by this class loader.Package
Class. getPackage()
Gets the package of this class.protected Package
ClassLoader. getPackage(String name)
Deprecated.If multiple class loaders delegate to each other and define classes with the same package name, and one such loader relies on the lookup behavior ofgetPackage
to return aPackage
from a parent loader, then the properties exposed by thePackage
may not be as expected in the rest of the program. For example, thePackage
will only expose annotations from thepackage-info.class
file defined by the parent loader, even if annotations exist in apackage-info.class
file defined by a child loader. A more robust approach is to use theClassLoader.getDefinedPackage(java.lang.String)
method which returns aPackage
for the specified class loader.static Package
Package. getPackage(String name)
Deprecated.If multiple class loaders delegate to each other and define classes with the same package name, and one such loader relies on the lookup behavior ofgetPackage
to return aPackage
from a parent loader, then the properties exposed by thePackage
may not be as expected in the rest of the program. For example, thePackage
will only expose annotations from thepackage-info.class
file defined by the parent loader, even if annotations exist in apackage-info.class
file defined by a child loader. A more robust approach is to use theClassLoader.getDefinedPackage(java.lang.String)
method which returns aPackage
for the specified class loader.protected Package[]
ClassLoader. getPackages()
Returns all of thePackage
s defined by this class loader and its ancestors.static Package[]
Package. getPackages()
Returns all of thePackage
s defined by the caller's class loader and its ancestors. -
Uses of Package in java.net
Methods in java.net that return Package Modifier and Type Method Description protected Package
URLClassLoader. definePackage(String name, Manifest man, URL url)
Defines a new package by name in thisURLClassLoader
.
-