ClassLoader.DefinePackage Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Defines a package by name in this ClassLoader
.
[Android.Runtime.Register("definePackage", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/net/URL;)Ljava/lang/Package;", "GetDefinePackage_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Ljava_net_URL_Handler")]
protected virtual Java.Lang.Package? DefinePackage (string? name, string? specTitle, string? specVersion, string? specVendor, string? implTitle, string? implVersion, string? implVendor, Java.Net.URL? sealBase);
[<Android.Runtime.Register("definePackage", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/net/URL;)Ljava/lang/Package;", "GetDefinePackage_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Ljava_net_URL_Handler")>]
abstract member DefinePackage : string * string * string * string * string * string * string * Java.Net.URL -> Java.Lang.Package
override this.DefinePackage : string * string * string * string * string * string * string * Java.Net.URL -> Java.Lang.Package
Parameters
- name
- String
The package name
- specTitle
- String
The specification title
- specVersion
- String
The specification version
- specVendor
- String
The specification vendor
- implTitle
- String
The implementation title
- implVersion
- String
The implementation version
- implVendor
- String
The implementation vendor
- sealBase
- URL
If not null
, then this package is sealed with
respect to the given code source java.net.URL URL
object. Otherwise, the package is not sealed.
Returns
The newly defined Package
object
- Attributes
Exceptions
if a package with the specified name already exists.
Remarks
Defines a package by name in this ClassLoader
.
Package names must be unique within a class loader and cannot be redefined or changed once created.
If a class loader wishes to define a package with specific properties, such as version information, then the class loader should call this definePackage
method before calling defineClass
. Otherwise, the #defineClass(String, byte[], int, int, ProtectionDomain) defineClass
method will define a package in this class loader corresponding to the package of the newly defined class; the properties of this defined package are specified by Package
.
Added in 1.2.
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.