Package class

Package objects contain version information about a Java package.

Get package for a name

static PackagegetPackage(String name)Find a package by name in the callers ClassLoader instance.

Get all packages

static Package[]getPackages()Get all the packages currently known for the caller's ClassLoader instance.

Get the annotations

<A extends Annotation>A getAnnotation(Class<A> annotationClass) Returns this element's annotation for the specified type if such an annotation is present, else null.
Annotation[]getAnnotations()Returns all annotations present on this element.
Annotation[]getDeclaredAnnotations()Returns all annotations that are directly present on this element.

Get implementation title, vendor and version

StringgetImplementationTitle()Return the title of this package.
StringgetImplementationVendor()Returns the name of the organization, vendor or company that provided this implementation.
StringgetImplementationVersion()Return the version of this implementation.

Get the package name

StringgetName()Return the name of this package.

Get the specification title, vendor and version

StringgetSpecificationTitle()Return the title of the specification.
StringgetSpecificationVendor()Return the name of the organization, vendor.
StringgetSpecificationVersion()Returns the version number.

Is Annotation present

boolean isAnnotationPresent(Class<? extends Annotation> annotationClass) Returns true if an annotation for the specified type is present on this element, else false.

Is this Package compatible with passed in package

booleanisCompatibleWith(String desired)Compare this package's specification version with a desired version.

Is this Package sealed

booleanisSealed()Returns true if this package is sealed.
booleanisSealed(URL url)Returns true if this package is sealed with respect to the specified code source url.

Get the string representation of the Package

StringtoString()Returns the string representation of this Package.
Revised from Open JDK source code  |  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.