An instance of class Package contains information about a Java package. This includes implementation and specification versions. Typically this information is retrieved from the manifest.
Packages are managed by class loaders. All classes loaded by the same loader from the same package share a Package instance.
Public Member Functions | |
Annotation[] | getAnnotations () |
Gets all of the annotations associated with this package. | |
Annotation[] | getDeclaredAnnotations () |
Gets all of the annotations directly declared on this element. | |
boolean | isAnnotationPresent (Class<?extends Annotation > annotationType) |
Indicates whether or not the given annotation is present. | |
String | getImplementationTitle () |
Return the title of the implementation of this package, or null if this is unknown. | |
String | getImplementationVendor () |
Return the name of the vendor or organization that provided this implementation of the package, or null if this is unknown. | |
String | getImplementationVersion () |
Return the version of the implementation of this package, or null if this is unknown. | |
String | getName () |
Return the name of this package in the standard dot notation; for example: "java.lang". | |
String | getSpecificationTitle () |
Return the title of the specification this package implements, or null if this is unknown. | |
String | getSpecificationVendor () |
Return the name of the vendor or organization that owns and maintains the specification this package implements, or null if this is unknown. | |
String | getSpecificationVersion () |
Return the version of the specification this package implements, or null if this is unknown. | |
int | hashCode () |
Answers an integer hash code for the receiver. | |
boolean | isCompatibleWith (String version) throws NumberFormatException |
Return true if this package's specification version is compatible with the specified version string. | |
boolean | isSealed () |
Return true if this package is sealed, false otherwise. | |
boolean | isSealed (URL url) |
Return true if this package is sealed with respect to the specified URL, false otherwise. | |
String | toString () |
Answers a string containing a concise, human-readable description of the receiver. | |
Static Public Member Functions | |
static Package | getPackage (String packageName) |
Attempt to locate the requested package in the caller's class loader. | |
static Package[] | getPackages () |
Return all the packages known to the caller's class loader. | |
Package Functions | |
public< T extends Annotation > T | getAnnotation (Class< T > annotationType) |
Gets the annotation associated with the given annotation type and this package. | |
Private Member Functions | |
Package () | |
Prevent this class from being instantiated. |
java.lang.Package.Package | ( | ) | [private] |
Prevent this class from being instantiated.
public<T extends Annotation> T java.lang.Package.getAnnotation | ( | Class< T > | annotationType | ) | [package] |
Gets the annotation associated with the given annotation type and this package.
null
. Annotation [] java.lang.Package.getAnnotations | ( | ) |
Gets all of the annotations associated with this package.
Annotation [] java.lang.Package.getDeclaredAnnotations | ( | ) |
Gets all of the annotations directly declared on this element.
boolean java.lang.Package.isAnnotationPresent | ( | Class<?extends Annotation > | annotationType | ) |
Indicates whether or not the given annotation is present.
true
if the annotation is present, otherwise false
. String java.lang.Package.getImplementationTitle | ( | ) |
Return the title of the implementation of this package, or null if this is unknown.
The format of this string is unspecified.
String java.lang.Package.getImplementationVendor | ( | ) |
Return the name of the vendor or organization that provided this implementation of the package, or null if this is unknown.
The format of this string is unspecified.
String java.lang.Package.getImplementationVersion | ( | ) |
Return the version of the implementation of this package, or null if this is unknown.
The format of this string is unspecified.
String java.lang.Package.getName | ( | ) |
Return the name of this package in the standard dot notation; for example: "java.lang".
static Package java.lang.Package.getPackage | ( | String | packageName | ) | [static] |
Attempt to locate the requested package in the caller's class loader.
If no package information can be located, null is returned.
packageName | The name of the package to find |
static Package [] java.lang.Package.getPackages | ( | ) | [static] |
Return all the packages known to the caller's class loader.
String java.lang.Package.getSpecificationTitle | ( | ) |
Return the title of the specification this package implements, or null if this is unknown.
String java.lang.Package.getSpecificationVendor | ( | ) |
Return the name of the vendor or organization that owns and maintains the specification this package implements, or null if this is unknown.
String java.lang.Package.getSpecificationVersion | ( | ) |
Return the version of the specification this package implements, or null if this is unknown.
The version string is a sequence of non-negative integers separated by dots; for example: "1.2.3".
int java.lang.Package.hashCode | ( | ) |
Answers an integer hash code for the receiver.
Any two objects which answer true
when passed to equals
must answer the same value for this method.
boolean java.lang.Package.isCompatibleWith | ( | String | version | ) | throws NumberFormatException |
Return true if this package's specification version is compatible with the specified version string.
Version strings are compared by comparing each dot separated part of the version as an integer.
version | The version string to compare against |
NumberFormatException | if the package's version string or the one provided is not in the correct format |
boolean java.lang.Package.isSealed | ( | ) |
Return true if this package is sealed, false otherwise.
boolean java.lang.Package.isSealed | ( | URL | url | ) |
Return true if this package is sealed with respect to the specified URL, false otherwise.
url | the URL to test |
String java.lang.Package.toString | ( | ) |
Answers a string containing a concise, human-readable description of the receiver.
Genereated on Tue Dec 9 14:09:47 2008 by Doxygen.
(c) Copyright 2005, 2008 The Apache Software Foundation or its licensors, as applicable.