Sdílet prostřednictvím


Package Class

Definition

Package objects contain version information about the implementation and specification of a Java package.

[Android.Runtime.Register("java/lang/Package", DoNotGenerateAcw=true)]
public class Package : Java.Lang.Object, IDisposable, Java.Interop.IJavaPeerable, Java.Lang.Reflect.IAnnotatedElement
[<Android.Runtime.Register("java/lang/Package", DoNotGenerateAcw=true)>]
type Package = class
    inherit Object
    interface IAnnotatedElement
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
Inheritance
Package
Attributes
Implements

Remarks

Package objects contain version information about the implementation and specification of a Java package. This versioning information is retrieved and made available by the ClassLoader instance that loaded the class(es). Typically, it is stored in the manifest that is distributed with the classes.

The set of classes that make up the package may implement a particular specification and if so the specification title, version number, and vendor strings identify that specification. An application can ask if the package is compatible with a particular version, see the #isCompatibleWith isCompatibleWith method for details.

Specification version numbers use a syntax that consists of nonnegative decimal integers separated by periods ".", for example "2.0" or "1.2.3.4.5.6.7". This allows an extensible number to be used to represent major, minor, micro, etc. versions. The version specification is described by the following formal grammar: <blockquote> <dl> <dt>SpecificationVersion:<dd>Digits RefinedVersion<sub>opt</sub><dt>RefinedVersion:<dd>.Digits<dd>.Digits RefinedVersion<dt>Digits:<dd>Digit<dd>Digits<dt>Digit:<dd>any character for which Character#isDigit returns true, e.g. 0, 1, 2, ... </dl> </blockquote>

The implementation title, version, and vendor strings identify an implementation and are made available conveniently to enable accurate reporting of the packages involved when a problem occurs. The contents all three implementation strings are vendor specific. The implementation version strings have no specified syntax and should only be compared for equality with desired version identifiers.

Within each ClassLoader instance all classes from the same java package have the same Package object. The static methods allow a package to be found by name or the set of all packages known to the current class loader to be found.

Java documentation for java.lang.Package.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

Package(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
Handle

The handle to the underlying Android instance.

(Inherited from Object)
ImplementationTitle

Return the title of this package.

ImplementationVendor

Returns the name of the organization, vendor or company that provided this implementation.

ImplementationVersion

Return the version of this implementation.

IsSealed

Returns true if this package is sealed.

JniIdentityHashCode (Inherited from Object)
JniPeerMembers
Name

Return the name of this package.

PeerReference (Inherited from Object)
SpecificationTitle

Return the title of the specification that this package implements.

SpecificationVendor

Return the name of the organization, vendor, or company that owns and maintains the specification of the classes that implement this package.

SpecificationVersion

Returns the version number of the specification that this package implements.

ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Methods

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetAnnotation(Class)

Added in 1.

GetAnnotations()

Added in 1.

GetAnnotationsByType(Class)

Added in 1.

GetDeclaredAnnotation(Class)

Added in 1.

GetDeclaredAnnotations()

Added in 1.

GetDeclaredAnnotationsByType(Class)

Added in 1.

GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetPackage(String)

Find a package by name in the callers ClassLoader instance.

GetPackages()

Get all the packages currently known for the caller's ClassLoader instance.

InvokeIsSealed(URL)

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

IsAnnotationPresent(Class)

To be added

IsCompatibleWith(String)

Compare this package's specification version with a desired version.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to