|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Package
public class Package
This class must be implemented by the vm vendor. 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.
ClassLoader| Constructor Summary | |
|---|---|
Package(String name,
String specTitle,
String specVersion,
String specVendor,
String implTitle,
String implVersion,
String implVendor,
URL sealBase)
|
|
| Method Summary | ||
|---|---|---|
|
getAnnotation(Class<T> annotationType)
Gets the annotation associated with the given annotation type and this package. |
|
Annotation[] |
getAnnotations()
Gets all of the annotations associated with this package. |
|
Annotation[] |
getDeclaredAnnotations()
Gets all of the annotations directly declared on this element. |
|
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". |
|
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. |
|
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()
Returns an integer hash code for the receiver. |
|
boolean |
isAnnotationPresent(Class<? extends Annotation> annotationType)
Indicates whether or not the given annotation is present. |
|
boolean |
isCompatibleWith(String version)
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()
Returns a string containing a concise, human-readable description of the receiver. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
Package(String name,
String specTitle,
String specVersion,
String specVendor,
String implTitle,
String implVersion,
String implVendor,
URL sealBase)
| Method Detail |
|---|
public <T extends Annotation> T getAnnotation(Class<T> annotationType)
getAnnotation in interface AnnotatedElementannotationType - The Class instance of the annotation to search for.
Annotation or null.AnnotatedElement.getAnnotation(java.lang.Class)public Annotation[] getAnnotations()
getAnnotations in interface AnnotatedElementAnnotation instances, which may be empty.AnnotatedElement.getAnnotations()public Annotation[] getDeclaredAnnotations()
getDeclaredAnnotations in interface AnnotatedElementAnnotation instances, which may be empty.AnnotatedElement.getDeclaredAnnotations()public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
isAnnotationPresent in interface AnnotatedElementannotationType - The class instance of the annotation to search for.
true if the annotation is present,
otherwise false.AnnotatedElement.isAnnotationPresent(java.lang.Class)public String getImplementationTitle()
public String getImplementationVendor()
public String getImplementationVersion()
public String getName()
public static Package getPackage(String packageName)
packageName - The name of the package to find
ClassLoader.getPackage(java.lang.String)public static Package[] getPackages()
ClassLoader.getPackages()public String getSpecificationTitle()
public String getSpecificationVendor()
public String getSpecificationVersion()
public int hashCode()
true when passed to equals must
answer the same value for this method.
hashCode in class ObjectObject.equals(java.lang.Object)
public boolean isCompatibleWith(String version)
throws NumberFormatException
version - The version string to compare against
NumberFormatException - if the package's version string or the one provided is not in
the correct formatpublic boolean isSealed()
public boolean isSealed(URL url)
url - the URL to test
public String toString()
toString in class Object
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||