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 * Indicates the hap name of ModuleInfo. 42 */ 43 public String hapName = ""; 44 45 /** 46 * Indicates the name of ModuleInfo. 47 */ 48 public String name = ""; 49 /** 50 * Indicates the type of ModuleInfo. 51 */ 52 public String type = ""; 53 54 /** 55 * Indicates the srcEntrance of ModuleInfo. 56 */ 57 public String srcEntrance = ""; 58 59 /** 60 * Indicates the description of ModuleInfo. 61 */ 62 public String description = ""; 63 64 /** 65 * Indicates the process of ModuleInfo. 66 */ 67 public String process = ""; 68 69 /** 70 * Indicates the mainElement of ModuleInfo. 71 */ 72 public String mainElement = ""; 73 74 /** 75 * Indicates the devicesTypes of ModuleInfo. 76 */ 77 public List<String> deviceTypes = new ArrayList<String>(); 78 79 /** 80 * Indicates the deliveryWithInstall of ModuleInfo. 81 */ 82 public boolean deliveryWithInstall = true; 83 84 /** 85 * Indicates the installationFree of ModuleInfo. 86 */ 87 public int installationFree = INSTALL_FREE_UNDEFINED; 88 89 /** 90 * Indicates the virtualMachine of ModuleInfo. 91 */ 92 public String virtualMachine = DEFAULT; 93 94 /** 95 * Indicates the uiSyntax of ModuleInfo. 96 */ 97 public String uiSyntax = HML; 98 99 /** 100 * Indicates the pages of ModuleInfo. 101 */ 102 public List<String> pages = new ArrayList<String>(); 103 104 /** 105 * Indicates the metadata of ModuleInfo. 106 */ 107 public List<ModuleMetadataInfo> moduleMetadataInfos = new ArrayList<ModuleMetadataInfo>(); 108 109 /** 110 * Indicates the abilities of ModuleInfo. 111 */ 112 public List<ModuleAbilityInfo> abilities = new ArrayList<ModuleAbilityInfo>(); 113 114 /** 115 * Indicates the extensionAbilities of ModuleInfo. 116 */ 117 public List<ExtensionAbilityInfo> extensionAbilityInfos = new ArrayList<ExtensionAbilityInfo>(); 118 119 /** 120 * Indicates the requestPermissions of ModuleInfo. 121 */ 122 public List<ReqPermission> requestPermissions = new ArrayList<ReqPermission>(); 123 124 /** 125 * Indicates the shortcuts of ModuleInfo. 126 */ 127 public List<ModuleShortcut> moduleShortcuts = new ArrayList<>(); 128 129 /** 130 * Indicates the distrofilter of ModuleInfo. 131 */ 132 public DistroFilter distroFilter = new DistroFilter(); 133 134 /** 135 * Indicates the common events of ModuleInfo. 136 */ 137 public List<CommonEvent> commonEvents = new ArrayList<CommonEvent>(); 138 139 /** 140 * Indicates the module atomic service of ModuleInfo. 141 */ 142 public ModuleAtomicService moduleAtomicService = new ModuleAtomicService(); 143 144 /** 145 * Indicates the common events of ModuleInfo. 146 */ 147 List<AbilityFormInfo> abilityFormInfos = new ArrayList<>(); 148 149 /** 150 * Indicates the define permissions of ModuleInfo. 151 */ 152 List<DefinePermission> definePermissions = new ArrayList<>(); 153 154 /** 155 * Indicates the descriptions of ModuleInfo, for Multilingual. 156 */ 157 private HashMap<String, String> descriptions = new HashMap<>(); 158 setDescriptions(HashMap<String, String> descriptions)159 public void setDescriptions(HashMap<String, String> descriptions) { 160 this.descriptions = descriptions; 161 } 162 getDescriptions()163 public HashMap<String, String> getDescriptions() { 164 return descriptions; 165 } 166 } 167