X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Tools%2FSource%2FPcdTools%2Forg%2Ftianocore%2Fpcd%2Fentity%2FDynamicTokenValue.java;h=d1e113352bbdb85e117ddb734363b6bfc35f8077;hp=175fb1a7f5cdab24537d53effdbd13452548e963;hb=11eb278ae57cfc9ba415fcf91e61dea56d6082c0;hpb=bc2628416cd8bb007c68520b2d45cf9601de0daa diff --git a/Tools/Source/PcdTools/org/tianocore/pcd/entity/DynamicTokenValue.java b/Tools/Source/PcdTools/org/tianocore/pcd/entity/DynamicTokenValue.java index 175fb1a7f5..d1e113352b 100644 --- a/Tools/Source/PcdTools/org/tianocore/pcd/entity/DynamicTokenValue.java +++ b/Tools/Source/PcdTools/org/tianocore/pcd/entity/DynamicTokenValue.java @@ -20,26 +20,33 @@ import java.util.UUID; import org.tianocore.pcd.exception.EntityException; -/** This class is to descript a value type of dynamic PCD. - For a dynamic or dynamicEx type PCD data, the value type can be: - 1) Hii type: the value of dynamic or dynamicEx is stored into a variable. - 2) Vpd type: the value of dynamic or dynamicEx is stored into somewhere set - by OEM. - 3) Default type: the value of dynamic or dynamicEx is stored into PCD dynamic - database. +/** + This class is to descript a value type of dynamic PCD. + For a dynamic or dynamicEx type PCD data, the value type can be: + 1) Hii type: the value of dynamic or dynamicEx is stored into a variable. + 2) Vpd type: the value of dynamic or dynamicEx is stored into somewhere set + by OEM. + 3) Default type: the value of dynamic or dynamicEx is stored into PCD dynamic + database. **/ public class DynamicTokenValue { /// /// Enumeration macro defintion for value type. - /// BUGBUG: Not use upcase charater is to facility for reading. It may be changed - /// in coding review. - public enum VALUE_TYPE {HII_TYPE, VPD_TYPE, DEFAULT_TYPE} + /// + public static enum VALUE_TYPE {HII_TYPE, VPD_TYPE, DEFAULT_TYPE} + /// + /// The value type maybe: + /// HII_TYPE: the value stored into variable area. + /// VPD_TYPE: the value stored into OEM specific area. + /// DEFAULT_TYPE: the value stored into PCD runtime database. + /// public VALUE_TYPE type; /// /// --------------------------------------------------------------------- - /// Following member is for HII case. + /// Following member is for HII case. The value of HII case will be put + /// into variable area in flash. /// --------------------------------------------------------------------- /// @@ -66,19 +73,26 @@ public class DynamicTokenValue { /// /// --------------------------------------------------------------------- - /// Following member is for VPD case. + /// Following member is for VPD case. The value of VPD case will be put into + /// some flash position pointed by OEM. /// --------------------------------------------------------------------- /// + public String vpdOffset; /// --------------------------------------------------------------------- - /// Following member is for default case. + /// Following member is for default case. The value of default type will + /// be put into PCD runtime database. /// --------------------------------------------------------------------- + + /// + /// The default value of this PCD in default case. + /// public String value; /** Constructor function for DynamicTokenValue class. - + **/ public DynamicTokenValue() { type = VALUE_TYPE.DEFAULT_TYPE; @@ -93,7 +107,7 @@ public class DynamicTokenValue { /** Set the HII case data. - @param variableName The variable name + @param variableName The variable name @param variableGuid The variable guid @param variableOffset The offset of value in this variable @param hiiDefaultValue Default value for this PCD @@ -117,17 +131,19 @@ public class DynamicTokenValue { treated as unicode UINT16 array. @return String - */ + **/ public String getStringOfVariableName() throws EntityException { String str; int index, num; + int size; - str = ""; - for (index = 0; index < variableName.size(); index ++) { + str = ""; + size = variableName.size(); + for (index = 0; index < size; index++) { num = Integer.decode(variableName.get(index).toString()); if ((num > 127 ) || (num < 0)) { - throw new EntityException(String.format("variable name contains >0x80 character, now is not support!")); + throw new EntityException(String.format("The variable name contains more than 0x80 characters; this is not supported at thist time!")); } str += (char)num; } @@ -138,8 +154,8 @@ public class DynamicTokenValue { /** Set Vpd case data. - @param vpdOffset - */ + @param vpdOffset the value offset the start address of OEM specific. + **/ public void setVpdData(String vpdOffset) { this.type = VALUE_TYPE.VPD_TYPE; @@ -150,7 +166,7 @@ public class DynamicTokenValue { Set default case data. @param value - */ + **/ public void setValue(String value) { this.type = VALUE_TYPE.DEFAULT_TYPE;