]> git.proxmox.com Git - mirror_edk2.git/blame - Tools/Source/PcdTools/org/tianocore/pcd/entity/DynamicTokenValue.java
Changed spelling to manifest
[mirror_edk2.git] / Tools / Source / PcdTools / org / tianocore / pcd / entity / DynamicTokenValue.java
CommitLineData
6ff7a41c 1/** @file\r
2 DynamicTokenValue class.\r
3\r
4 This module contains the value type of a dynamic token.\r
bc262841 5\r
6ff7a41c 6Copyright (c) 2006, Intel Corporation\r
7All rights reserved. This program and the accompanying materials\r
8are licensed and made available under the terms and conditions of the BSD License\r
9which accompanies this distribution. The full text of the license may be found at\r
10http://opensource.org/licenses/bsd-license.php\r
bc262841 11\r
6ff7a41c 12THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
13WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
14\r
bc262841 15**/\r
d14ebb43 16package org.tianocore.pcd.entity;\r
6ff7a41c 17\r
6ff7a41c 18import java.util.List;\r
6ff7a41c 19import java.util.UUID;\r
20\r
d14ebb43 21import org.tianocore.pcd.exception.EntityException;\r
6ff7a41c 22\r
8b7bd455 23/**\r
f28c0830 24 This class is to descript a value type of dynamic PCD.\r
25 For a dynamic or dynamicEx type PCD data, the value type can be:\r
26 1) Hii type: the value of dynamic or dynamicEx is stored into a variable.\r
27 2) Vpd type: the value of dynamic or dynamicEx is stored into somewhere set\r
28 by OEM.\r
29 3) Default type: the value of dynamic or dynamicEx is stored into PCD dynamic\r
30 database.\r
6ff7a41c 31**/\r
32public class DynamicTokenValue {\r
33 ///\r
34 /// Enumeration macro defintion for value type.\r
f28c0830 35 ///\r
8b7bd455 36 public static enum VALUE_TYPE {HII_TYPE, VPD_TYPE, DEFAULT_TYPE}\r
6ff7a41c 37\r
f28c0830 38 ///\r
39 /// The value type maybe:\r
40 /// HII_TYPE: the value stored into variable area.\r
41 /// VPD_TYPE: the value stored into OEM specific area.\r
42 /// DEFAULT_TYPE: the value stored into PCD runtime database.\r
8b7bd455 43 ///\r
6ff7a41c 44 public VALUE_TYPE type;\r
45\r
46 ///\r
47 /// ---------------------------------------------------------------------\r
8b7bd455 48 /// Following member is for HII case. The value of HII case will be put\r
f28c0830 49 /// into variable area in flash.\r
6ff7a41c 50 /// ---------------------------------------------------------------------\r
51 ///\r
52\r
53 ///\r
54 /// variableName is valid only when this token support Hii functionality. variableName\r
55 /// indicates the value of token is associated with what variable.\r
56 /// variableName is defined in FPD.\r
57 public List variableName;\r
58\r
59 ///\r
60 /// variableGuid is the GUID this token associated with.\r
61 ///\r
62 public UUID variableGuid;\r
63\r
64 ///\r
65 /// Variable offset indicate the associated variable's offset in NV storage.\r
66 ///\r
67 public String variableOffset;\r
68\r
69 ///\r
70 /// The default value for HII case.\r
bc262841 71 ///\r
6ff7a41c 72 public String hiiDefaultValue;\r
73\r
74 ///\r
bc262841 75 /// ---------------------------------------------------------------------\r
f28c0830 76 /// Following member is for VPD case. The value of VPD case will be put into\r
77 /// some flash position pointed by OEM.\r
bc262841 78 /// ---------------------------------------------------------------------\r
79 ///\r
f28c0830 80\r
6ff7a41c 81 public String vpdOffset;\r
82\r
bc262841 83 /// ---------------------------------------------------------------------\r
f28c0830 84 /// Following member is for default case. The value of default type will\r
85 /// be put into PCD runtime database.\r
bc262841 86 /// ---------------------------------------------------------------------\r
f28c0830 87\r
88 ///\r
89 /// The default value of this PCD in default case.\r
8b7bd455 90 ///\r
6ff7a41c 91 public String value;\r
92\r
bc262841 93 /**\r
94 Constructor function for DynamicTokenValue class.\r
8b7bd455 95\r
bc262841 96 **/\r
6ff7a41c 97 public DynamicTokenValue() {\r
bc262841 98 type = VALUE_TYPE.DEFAULT_TYPE;\r
99 variableName = null;\r
100 variableGuid = null;\r
101 variableOffset = null;\r
102 hiiDefaultValue = null;\r
103 vpdOffset = null;\r
104 value = null;\r
6ff7a41c 105 }\r
106\r
107 /**\r
108 Set the HII case data.\r
bc262841 109\r
8b7bd455 110 @param variableName The variable name\r
bc262841 111 @param variableGuid The variable guid\r
112 @param variableOffset The offset of value in this variable\r
113 @param hiiDefaultValue Default value for this PCD\r
114 **/\r
6ff7a41c 115 public void setHiiData(List variableName,\r
116 UUID variableGuid,\r
117 String variableOffset,\r
118 String hiiDefaultValue) {\r
119 this.type = VALUE_TYPE.HII_TYPE;\r
120\r
121 this.variableName = variableName;\r
122 this.variableGuid = variableGuid;\r
123 this.variableOffset = variableOffset;\r
124 this.hiiDefaultValue = hiiDefaultValue;\r
125 }\r
126\r
127 /**\r
d73557df 128 Get the variable Name.\r
bc262841 129\r
8b7bd455 130 @return String\r
f28c0830 131 **/\r
d73557df 132 public List getStringOfVariableName() {\r
133 return variableName;\r
6ff7a41c 134 }\r
135\r
6ff7a41c 136 /**\r
137 Set Vpd case data.\r
bc262841 138\r
f28c0830 139 @param vpdOffset the value offset the start address of OEM specific.\r
140 **/\r
6ff7a41c 141 public void setVpdData(String vpdOffset) {\r
142 this.type = VALUE_TYPE.VPD_TYPE;\r
143\r
144 this.vpdOffset = vpdOffset;\r
145 }\r
146\r
147 /**\r
148 Set default case data.\r
bc262841 149\r
6ff7a41c 150 @param value\r
f28c0830 151 **/\r
6ff7a41c 152 public void setValue(String value) {\r
153 this.type = VALUE_TYPE.DEFAULT_TYPE;\r
154\r
155 this.value = value;\r
156 }\r
157}\r
158\r
159\r
160\r
161\r
162\r