ohos.metadata

Note:

Currently in the beta phase.

This module describes metadata information.

Importing the Module

import kit.AbilityKit.*

Usage Instructions

API sample code usage instructions:

  • If the sample code has a "// index.cj" comment in its first line, it indicates that the example can be compiled and run in the "index.cj" file of the Cangjie template project.
  • If the sample requires obtaining the Context application context, it needs to be configured in the "main_ability.cj" file of the Cangjie template project.

For the aforementioned sample projects and configuration templates, please refer to Cangjie Sample Code Instructions.

class Metadata

public class Metadata {
    public var name: String
    public var value: String
    public var resource: String
}

Function: Metadata information. Obtained by calling the getBundleInfoForSelf interface, with the bundleFlags parameter passing the values of GET_BUNDLE_INFO_WITH_HAP_MODULE, GET_BUNDLE_INFO_WITH_ABILITY, and GET_BUNDLE_INFO_WITH_METADATA.

System Capability: SystemCapability.BundleManager.BundleFramework.Core

Initial Version: 22

var name

public var name: String

Function: Metadata name.

Type: String

Read/Write Capability: Readable and Writable

System Capability: SystemCapability.BundleManager.BundleFramework.Core

Initial Version: 22

var resource

public var resource: String

Function: Metadata resource.

Type: String

Read/Write Capability: Readable and Writable

System Capability: SystemCapability.BundleManager.BundleFramework.Core

Initial Version: 22

var value

public var value: String

Function: Metadata value.

Type: String

Read/Write Capability: Readable and Writable

System Capability: SystemCapability.BundleManager.BundleFramework.Core

Initial Version: 22