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