1 /* 2 * Copyright (c) 2022-2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 package ohos; 17 18 import java.util.ArrayList; 19 import java.util.HashMap; 20 import java.util.List; 21 22 /** 23 * Module ModuleJson info. 24 * 25 */ 26 class ModuleInfo { 27 private final Integer INSTALL_FREE_UNDEFINED = 2; 28 private final String DEFAULT = "default"; 29 private final String HML = "hml"; 30 31 /** 32 * Indicates hap is stage or FA. 33 */ 34 public AppModel appModel = AppModel.FA; 35 36 /** 37 * Indicates dependencies config. 38 */ 39 public List<DependencyItem> dependenies = new ArrayList<>(); 40 41 /** 42 * Indicates proxyData config. 43 */ 44 public List<ProxyDataItem> proxyData = new ArrayList<>(); 45 46 /** 47 * Indicates the hap name of ModuleInfo. 48 */ 49 public String hapName = ""; 50 51 /** 52 * Indicates the name of ModuleInfo. 53 */ 54 public String name = ""; 55 /** 56 * Indicates the type of ModuleInfo. 57 */ 58 public String type = ""; 59 60 /** 61 * Indicates the srcEntrance of ModuleInfo. 62 */ 63 public String srcEntrance = ""; 64 65 /** 66 * Indicates the description of ModuleInfo. 67 */ 68 public String description = ""; 69 70 /** 71 * Indicates the process of ModuleInfo. 72 */ 73 public String process = ""; 74 75 /** 76 * Indicates the mainElement of ModuleInfo. 77 */ 78 public String mainElement = ""; 79 80 /** 81 * Indicates the devicesTypes of ModuleInfo. 82 */ 83 public List<String> deviceTypes = new ArrayList<String>(); 84 85 /** 86 * Indicates the deliveryWithInstall of ModuleInfo. 87 */ 88 public boolean deliveryWithInstall = true; 89 90 /** 91 * Indicates the installationFree of ModuleInfo. 92 */ 93 public int installationFree = INSTALL_FREE_UNDEFINED; 94 95 /** 96 * Indicates the virtualMachine of ModuleInfo. 97 */ 98 public String virtualMachine = DEFAULT; 99 100 /** 101 * Indicates the uiSyntax of ModuleInfo. 102 */ 103 public String uiSyntax = HML; 104 105 /** 106 * Indicates the pages of ModuleInfo. 107 */ 108 public List<String> pages = new ArrayList<String>(); 109 110 /** 111 * Indicates the metadata of ModuleInfo. 112 */ 113 public List<ModuleMetadataInfo> moduleMetadataInfos = new ArrayList<ModuleMetadataInfo>(); 114 115 /** 116 * Indicates the abilities of ModuleInfo. 117 */ 118 public List<ModuleAbilityInfo> abilities = new ArrayList<ModuleAbilityInfo>(); 119 120 /** 121 * Indicates the extensionAbilities of ModuleInfo. 122 */ 123 public List<ExtensionAbilityInfo> extensionAbilityInfos = new ArrayList<ExtensionAbilityInfo>(); 124 125 /** 126 * Indicates the requestPermissions of ModuleInfo. 127 */ 128 public List<ReqPermission> requestPermissions = new ArrayList<ReqPermission>(); 129 130 /** 131 * Indicates the shortcuts of ModuleInfo. 132 */ 133 public List<ModuleShortcut> moduleShortcuts = new ArrayList<>(); 134 135 /** 136 * Indicates the distrofilter of ModuleInfo. 137 */ 138 public DistroFilter distroFilter = new DistroFilter(); 139 140 /** 141 * Indicates the common events of ModuleInfo. 142 */ 143 public List<CommonEvent> commonEvents = new ArrayList<CommonEvent>(); 144 145 /** 146 * Indicates the module atomic service of ModuleInfo. 147 */ 148 public ModuleAtomicService moduleAtomicService = new ModuleAtomicService(); 149 150 /** 151 * Indicates the common events of ModuleInfo. 152 */ 153 List<AbilityFormInfo> abilityFormInfos = new ArrayList<>(); 154 155 /** 156 * Indicates the define permissions of ModuleInfo. 157 */ 158 List<DefinePermission> definePermissions = new ArrayList<>(); 159 160 /** 161 * Indicates the descriptions of ModuleInfo, for Multilingual. 162 */ 163 private HashMap<String, String> descriptions = new HashMap<>(); 164 setDescriptions(HashMap<String, String> descriptions)165 public void setDescriptions(HashMap<String, String> descriptions) { 166 this.descriptions = descriptions; 167 } 168 getDescriptions()169 public HashMap<String, String> getDescriptions() { 170 return descriptions; 171 } 172 } 173