+++ /dev/null
-/** @file\r
- \r
- The file is used to provides all kinds of Data Validation interface \r
- \r
- Copyright (c) 2006, Intel Corporation\r
- All rights reserved. This program and the accompanying materials\r
- are licensed and made available under the terms and conditions of the BSD License\r
- which accompanies this distribution. The full text of the license may be found at\r
- http://opensource.org/licenses/bsd-license.php\r
- \r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
- **/\r
-\r
-package org.tianocore.common;\r
-\r
-import java.util.regex.Matcher;\r
-import java.util.regex.Pattern;\r
-\r
-/**\r
- The class is used to provides all kinds of data validation interface\r
-\r
- <p>All provided interfaces are in static mode</p>\r
- \r
- @since ModuleEditor 1.0\r
- \r
- **/\r
-public class DataValidation {\r
-\r
- /**\r
- Reserved for test\r
- \r
- @param args\r
- \r
- **/\r
- public static void main(String[] args) {\r
- // TODO Auto-generated method stub\r
-\r
- }\r
-\r
- //\r
- // The below is used to check common data types\r
- //\r
-\r
- /**\r
- Check if the imput data is int\r
- \r
- @param strInt The input string which needs validation\r
- \r
- @retval true - The input is Int\r
- @retval false - The input is not Int\r
- \r
- **/\r
- public static boolean isInt(String strInt) {\r
- return isMatch("^-?[0-9]\\d*$", strInt);\r
- }\r
-\r
- /**\r
- Check if the input data is int and it is in the valid scope\r
- The scope is provided by String\r
- \r
- @param strNumber The input string which needs validation\r
- @param BeginNumber The left boundary of the scope\r
- @param EndNumber The right boundary of the scope\r
- \r
- @retval true - The input is Int and in the scope;\r
- @retval false - The input is not Int or not in the scope\r
- \r
- **/\r
- public static boolean isInt(String strNumber, int BeginNumber, int EndNumber) {\r
- //\r
- //Check if the input data is int first\r
- //\r
- if (!isInt(strNumber)) {\r
- return false;\r
- }\r
- //\r
- //And then check if the data is between the scope\r
- //\r
- Integer intTemp = new Integer(strNumber);\r
- if ((intTemp.intValue() < BeginNumber) || (intTemp.intValue() > EndNumber)) {\r
- return false;\r
- }\r
- return true;\r
- }\r
-\r
- /**\r
- Check if the input data is int and it is in the valid scope\r
- The scope is provided by String\r
- \r
- @param strNumber The input string which needs validation\r
- @param strBeginNumber The left boundary of the scope\r
- @param strEndNumber The right boundary of the scope\r
- \r
- @retval true - The input is Int and in the scope;\r
- @retval false - The input is not Int or not in the scope\r
- \r
- **/\r
- public static boolean isInt(String strNumber, String strBeginNumber, String strEndNumber) {\r
- //\r
- //Check if all input data are int\r
- //\r
- if (!isInt(strNumber)) {\r
- return false;\r
- }\r
- if (!isInt(strBeginNumber)) {\r
- return false;\r
- }\r
- if (!isInt(strEndNumber)) {\r
- return false;\r
- }\r
- //\r
- //And then check if the data is between the scope\r
- //\r
- Integer intI = new Integer(strNumber);\r
- Integer intJ = new Integer(strBeginNumber);\r
- Integer intK = new Integer(strEndNumber);\r
- if ((intI.intValue() < intJ.intValue()) || (intI.intValue() > intK.intValue())) {\r
- return false;\r
- }\r
- return true;\r
- }\r
-\r
- /**\r
- Use regex to check if the input data is in valid format\r
- \r
- @param strPattern The input regex\r
- @param strMatcher The input data need be checked\r
- \r
- @retval true - The data matches the regex\r
- @retval false - The data doesn't match the regex\r
- \r
- **/\r
- public static boolean isMatch(String strPattern, String strMatcher) {\r
- Pattern pattern = Pattern.compile(strPattern);\r
- Matcher matcher = pattern.matcher(strMatcher);\r
-\r
- return matcher.find();\r
- }\r
-\r
- //\r
- // The below is used to check common customized data types\r
- //\r
-\r
- /**\r
- Check if the input data is BaseNameConvention\r
- \r
- @param strBaseNameConvention The input string need be checked\r
- \r
- @retval true - The input is BaseNameConvention\r
- @retval false - The input is not BaseNameConvention\r
- \r
- **/\r
- public static boolean isBaseNameConvention(String strBaseNameConvention) {\r
- return isMatch("[A-Z]([a-zA-Z0-9])*(_)?([a-zA-Z0-9])*", strBaseNameConvention);\r
- }\r
-\r
- /**\r
- Check if the input data is GuidArrayType\r
- \r
- @param strGuidArrayType The input string need be checked\r
- \r
- @retval true - The input is GuidArrayType\r
- @retval false - The input is not GuidArrayType\r
- \r
- **/\r
- public static boolean isGuidArrayType(String strGuidArrayType) {\r
- return isMatch(\r
- "0x[a-fA-F0-9]{1,8},( )*0x[a-fA-F0-9]{1,4},( )*0x[a-fA-F0-9]{1,4}(,( )*\\{)?(,?( )*0x[a-fA-F0-9]{1,2}){8}( )*(\\})?",\r
- strGuidArrayType);\r
- }\r
-\r
- /**\r
- Check if the input data is GuidNamingConvention\r
- \r
- @param strGuidNamingConvention The input string need be checked\r
- \r
- @retval true - The input is GuidNamingConvention\r
- @retval false - The input is not GuidNamingConvention\r
- \r
- **/\r
- public static boolean isGuidNamingConvention(String strGuidNamingConvention) {\r
- return isMatch("[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}",\r
- strGuidNamingConvention);\r
- }\r
-\r
- /**\r
- Check if the input data is GuidType \r
- \r
- @param strGuidType The input string need be checked\r
- \r
- @retval true - The input is GuidType\r
- @reture false is not GuidType\r
- \r
- **/\r
- public static boolean isGuidType(String strGuidType) {\r
- return (isGuidArrayType(strGuidType) || isGuidNamingConvention(strGuidType));\r
- }\r
-\r
- /**\r
- Check if the input data is Guid \r
- \r
- @param strGuid The input string need be checked\r
- \r
- @retval true - The input is Guid\r
- @retval false - The input is not Guid\r
- \r
- **/\r
- public static boolean isGuid(String strGuid) {\r
- return isGuidType(strGuid);\r
- }\r
-\r
- /**\r
- Check if the input data is Sentence\r
- \r
- @param strSentence The input string need be checked\r
- \r
- @retval true - The input is Sentence\r
- @retval false - The input is not Sentence\r
- \r
- **/\r
- public static boolean isSentence(String strSentence) {\r
- return isMatch("(\\w+\\W*)+( )+(\\W*\\w*\\W*\\s*)*", strSentence);\r
- }\r
-\r
- /**\r
- Check if the input data is DateType\r
- \r
- @param strDateType The input string need be checked\r
- \r
- @retval true - The input is DateType\r
- @retval false - The input is not DateType\r
- \r
- **/\r
- public static boolean isDateType(String strDateType) {\r
- return isMatch("[1-9][0-9][0-9][0-9]-[0-1][0-9]-[0-3][0-9] [0-2][0-9]:[0-5][0-9]", strDateType);\r
- }\r
-\r
- /**\r
- Check if the input data is DosPath\r
- \r
- @param strDosPath The input string need be checked\r
- \r
- @retval true - The input is DosPath\r
- @retval false - The input is not DosPath\r
- \r
- **/\r
- public static boolean isDosPath(String strDosPath) {\r
- return isMatch("([a-zA-Z]:\\\\)?(((\\\\?_*-*.*[a-zA-Z0-9]*)*(_*-*.*[a-zA-Z0-9])*)+(\\\\)?)*", strDosPath);\r
- }\r
-\r
- /**\r
- Check if the input data is UnixPath\r
- \r
- @param strUnixPath The input string need be checked\r
- \r
- @retval true - The input is UnixPath\r
- @retval false - The input is not UnixPath\r
- \r
- **/\r
- public static boolean isUnixPath(String strUnixPath) {\r
- return isMatch("(\\/)?(((_*-*.*[a-zA-Z0-9]*)*(_*-*.*[a-zA-Z0-9])*)+(\\/)?)*", strUnixPath);\r
- }\r
-\r
- /**\r
- Check if the input data is DirectoryNamingConvention\r
- \r
- @param strDirectoryNamingConvention The input string need be checked\r
- \r
- @retval true - The input is DirectoryNamingConvention\r
- @retval false - The input is not DirectoryNamingConvention\r
- \r
- **/\r
- public static boolean isDirectoryNamingConvention(String strDirectoryNamingConvention) {\r
- return (isDosPath(strDirectoryNamingConvention) || isUnixPath(strDirectoryNamingConvention));\r
- }\r
-\r
- /**\r
- Check if the input data is HexDoubleWordDataType\r
- \r
- @param strHexDoubleWordDataType The input string need be checked\r
- \r
- @retval true - The input is HexDoubleWordDataType\r
- @retval false - The input is not HexDoubleWordDataType\r
- \r
- **/\r
- public static boolean isHexDoubleWordDataType(String strHexDoubleWordDataType) {\r
- return isMatch("0x[a-fA-F0-9]{1,8}", strHexDoubleWordDataType);\r
- }\r
-\r
- /**\r
- Check if the input data is V1\r
- \r
- @param strV1 The input string need be checked\r
- \r
- @retval true - The input is V1\r
- @retval false - The input is not V1\r
- \r
- **/\r
- public static boolean isV1(String strV1) {\r
- return isMatch("((%[A-Z](_*[A-Z0-9]*)*%)+((((\\\\)?_*-*.*[a-zA-Z0-9]*)*(_*-*.*[a-zA-Z0-9])*)+(\\\\)?)*)", strV1);\r
- }\r
-\r
- /**\r
- Check if the input data is V2\r
- \r
- @param strV2 The input string need be checked\r
- \r
- @retval true - The input is V2\r
- @retval false - The input is not V2\r
- \r
- **/\r
- public static boolean isV2(String strV2) {\r
- return isMatch(\r
- "(($[A-Z](_*[A-Z0-9]*)*)+||($\\([A-Z](_*[A-Z0-9]*)*\\))+||($\\{[A-Z](_*[A-Z0-9]*)*\\})+)+(\\/)?(((((_*-*.*[a-zA-Z0-9]*)*(_*-*.*[a-zA-Z0-9])*)+(\\/)?)*)*)",\r
- strV2);\r
- }\r
-\r
- /**\r
- Check if the input data is VariableConvention\r
- \r
- @param strVariableConvention The input string need be checked\r
- \r
- @retval true - The input is VariableConvention\r
- @retval false - The input is not VariableConvention\r
- \r
- **/\r
- public static boolean isVariableConvention(String strVariableConvention) {\r
- return (isV1(strVariableConvention) || isV2(strVariableConvention));\r
- }\r
-\r
- /**\r
- Check if the input data is UCName\r
- \r
- @param strUCName The input string need be checked\r
- \r
- @retval true - The input is UCName\r
- @retval false - The input is not UCName\r
- \r
- **/\r
- public static boolean isUCName(String strUCName) {\r
- return isMatch("[A-Z]+(_*[A-Z0-9]*( )*)*", strUCName);\r
- }\r
-\r
- /**\r
- Check if the input data is HexByteDataType\r
- \r
- @param strHex64BitDataType The input string need be checked \r
- \r
- @retval true - The input is HexByteDataType\r
- @retval false - The input is not HexByteDataType\r
- \r
- **/\r
- public static boolean isHexByteDataType(String strHex64BitDataType) {\r
- return isMatch("(0x)?[a-fA-F0-9]{1,2}", strHex64BitDataType);\r
- }\r
-\r
- /**\r
- Check if the input data is Hex64BitDataType\r
- \r
- @param strHex64BitDataType The input string need be checked\r
- \r
- @retval true - The input is Hex64BitDataType\r
- @retval false - The input is not Hex64BitDataType\r
- \r
- **/\r
- public static boolean isHex64BitDataType(String strHex64BitDataType) {\r
- return isMatch("(0x)?[a-fA-F0-9]{1,16}", strHex64BitDataType);\r
- }\r
-\r
- /**\r
- Check if the input data is HexWordDataType\r
- \r
- @param strHexWordDataType The input string need be checked\r
- \r
- @retval true - The input is HexWordDataType\r
- @retval false - The input is not HexWordDataType\r
- \r
- **/\r
- public static boolean isHexWordDataType(String strHexWordDataType) {\r
- return isMatch("0x[a-fA-F0-9]{1,4}", strHexWordDataType);\r
- }\r
-\r
- /**\r
- Check if the input data is CName\r
- \r
- @param strCName The input string need be checked\r
- \r
- @retval true - The input is CName\r
- @retval false - The input is not CName\r
- \r
- **/\r
- public static boolean isCName(String strCName) {\r
- return isMatch("((_)*([a-zA-Z])+((_)*[a-zA-Z0-9]*))*", strCName);\r
- }\r
-\r
- /**\r
- Check if the input data is OverrideID\r
- \r
- @param strOverrideID The input string need be checked\r
- \r
- @retval true - The input is OverrideID\r
- @retval false - The input is not OverrideID\r
- \r
- **/\r
- public static boolean isOverrideID(String strOverrideID) {\r
- return isInt(strOverrideID);\r
- }\r
-\r
- //\r
- //The below is used to check msaheader data type\r
- //\r
-\r
- /**\r
- Check if the input data is BaseName\r
- \r
- @param strBaseName The input string need be checked\r
- \r
- @retval true - The input is BaseName\r
- @retval false - The input is not BaseName\r
- \r
- **/\r
- public static boolean isBaseName(String strBaseName) {\r
- return isBaseNameConvention(strBaseName);\r
- }\r
-\r
- /**\r
- Check if the input data is Abstract\r
- \r
- @param strAbstract The input string need be checked\r
- \r
- @retval true - The input is Abstract\r
- @retval false - The input is not Abstract\r
- \r
- **/\r
- public static boolean isAbstract(String strAbstract) {\r
- return isSentence(strAbstract);\r
- }\r
-\r
- /**\r
- Check if the input data is Copyright\r
- \r
- @param strCopyright The input string need be checked\r
- \r
- @retval true - The input is Copyright\r
- @retval false - The input is not Copyright\r
- \r
- **/\r
- public static boolean isCopyright(String strCopyright) {\r
- return isSentence(strCopyright);\r
- }\r
-\r
- /**\r
- Check if the input data is Created\r
- \r
- @param strCreated The input string need be checked\r
- \r
- @retval true - The input is Created\r
- @retval false - The input is not Created\r
- \r
- **/\r
- public static boolean isCreated(String strCreated) {\r
- return isDateType(strCreated);\r
- }\r
-\r
- /**\r
- Check if the input data is Updated\r
- \r
- @param strUpdated The input string need be checked\r
- \r
- @retval true - The input is Updated\r
- @retval false - The input is not Updated\r
- \r
- **/\r
- public static boolean isUpdated(String strUpdated) {\r
- return isDateType(strUpdated);\r
- }\r
-\r
- //\r
- // The below is used to check LibraryClass data types\r
- //\r
-\r
- /**\r
- Check if the input data is LibraryClass\r
- \r
- @param strLibraryClass The input string need be checked\r
- \r
- @retval true - The input is LibraryClass\r
- @retval false - The input is not LibraryClass\r
- \r
- **/\r
- public static boolean isLibraryClass(String strLibraryClass) {\r
- return isBaseNameConvention(strLibraryClass);\r
- }\r
-\r
- //\r
- // The below is used to check sourcefiles data types\r
- //\r
-\r
- /**\r
- Check if the input data is Path\r
- \r
- @param strPath The input string need be checked\r
- \r
- @retval true - The input is Path\r
- @retval false - The input is not Path\r
- \r
- **/\r
- public static boolean isPath(String strPath) {\r
- return isDirectoryNamingConvention(strPath);\r
- }\r
-\r
- /**\r
- Check if the input data is FileName\r
- \r
- @param strFileName The input string need be checked\r
- \r
- @retval true - The input is FileName\r
- @retval false - The input is not FileName\r
- \r
- **/\r
- public static boolean isFileName(String strFileName) {\r
- return isVariableConvention(strFileName);\r
- }\r
-\r
- //\r
- // The below is used to check includes data types\r
- //\r
-\r
- /**\r
- Check if the input data is UpdatedDate\r
- \r
- @param strUpdatedDate The input string need be checked\r
- \r
- @retval true - The input is UpdatedDate\r
- @retval false - The input is not UpdatedDate\r
- \r
- **/\r
- public static boolean isUpdatedDate(String strUpdatedDate) {\r
- return isDateType(strUpdatedDate);\r
- }\r
-\r
- /**\r
- Check if the input data is PackageName\r
- \r
- @param strPackageName The input string need be checked\r
- \r
- @retval true - The input is PackageName\r
- @retval false - The input is not PackageName\r
- \r
- **/\r
- public static boolean isPackageName(String strPackageName) {\r
- return isBaseNameConvention(strPackageName);\r
- }\r
-\r
- //\r
- // The below is used to check protocols data types\r
- //\r
-\r
- /**\r
- Check if the input data is ProtocolName\r
- \r
- @param strProtocolName The input string need be checked\r
- \r
- @retval true - The input is ProtocolName\r
- @retval false - The input is not ProtocolName\r
- \r
- **/\r
- public static boolean isProtocolName(String strProtocolName) {\r
- return isCName(strProtocolName);\r
- }\r
-\r
- /**\r
- Check if the input data is ProtocolNotifyName\r
- \r
- @param strProtocolNotifyName The input string need be checked\r
- \r
- @retval true - The input is ProtocolNotifyName\r
- @retval false - The input is not ProtocolNotifyName\r
- \r
- **/\r
- public static boolean isProtocolNotifyName(String strProtocolNotifyName) {\r
- return isCName(strProtocolNotifyName);\r
- }\r
-\r
- //\r
- // The below is used to check ppis data types\r
- //\r
-\r
- /**\r
- Check if the input data is PpiName\r
- \r
- @param strPpiName The input string need be checked\r
- \r
- @retval true - The input is PpiName\r
- @retval false - The input is not PpiName\r
- \r
- **/\r
- public static boolean isPpiName(String strPpiName) {\r
- return isCName(strPpiName);\r
- }\r
-\r
- /**\r
- Check if the input data is PpiNotifyName\r
- \r
- @param strPpiNotifyName The input string need be checked\r
- \r
- @retval true - The input is PpiNotifyName\r
- @retval false - The input is not PpiNotifyName\r
- \r
- **/\r
- public static boolean isPpiNotifyName(String strPpiNotifyName) {\r
- return isCName(strPpiNotifyName);\r
- }\r
-\r
- /**\r
- Check if the input data is FeatureFlag\r
- \r
- @param strFeatureFlag The input string need be checked\r
- \r
- @retval true - The input is FeatureFlag\r
- @retval false - The input is not FeatureFlag\r
- \r
- **/\r
- public static boolean isFeatureFlag(String strFeatureFlag) {\r
- return isCName(strFeatureFlag);\r
- }\r
-\r
- //\r
- // The below is used to check variable data types\r
- //\r
-\r
- /**\r
- Check if the input data is ByteOffset\r
- \r
- @param strByteOffset The input string need be checked\r
- \r
- @retval true - The input is ByteOffset\r
- @retval false - The input is not ByteOffset\r
- \r
- **/\r
- public static boolean isByteOffset(String strByteOffset) {\r
- return isByteOffset(strByteOffset);\r
- }\r
-\r
- /**\r
- Check if the input data is BitOffset\r
- \r
- @param strBitOffset The input string need be checked\r
- \r
- @retval true - The input is BitOffset\r
- @retval false - The input is not BitOffset\r
- \r
- **/\r
- public static boolean isBitOffset(String strBitOffset) {\r
- return isInt(strBitOffset, 0, 8);\r
- }\r
-\r
- /**\r
- Check if the input data is OffsetBitSize\r
- \r
- @param strOffsetBitSize The input string need be checked\r
- \r
- @retval true - The input is OffsetBitSize\r
- @retval false - The input is not OffsetBitSize\r
- \r
- **/\r
- public static boolean isOffsetBitSize(String strOffsetBitSize) {\r
- return isInt(strOffsetBitSize, 0, 7);\r
- }\r
-\r
- //\r
- // The below is used to check formsets data types\r
- //\r
-\r
- /**\r
- Check if the input data is Formsets\r
- \r
- @param strFormsets The input string need be checked\r
- \r
- @retval true - The input is Formsets\r
- @retval false - The input is not Formsets\r
- \r
- **/\r
- public static boolean isFormsets(String strFormsets) {\r
- return isCName(strFormsets);\r
- }\r
-\r
- //\r
- // The below is used to check externs data types\r
- //\r
-\r
- /**\r
- Check if the input data is Constructor\r
- \r
- @param strConstructor The input string need be checked\r
- \r
- @retval true - The input is Constructor\r
- @retval false - The input is not Constructor\r
- \r
- **/\r
- public static boolean isConstructor(String strConstructor) {\r
- return isCName(strConstructor);\r
- }\r
-\r
- /**\r
- Check if the input data is Destructor\r
- \r
- @param strDestructor The input string need be checked\r
- \r
- @retval true - The input is Destructor\r
- @retval false - The input is not Destructor\r
- \r
- **/\r
- public static boolean isDestructor(String strDestructor) {\r
- return isCName(strDestructor);\r
- }\r
-\r
- /**\r
- Check if the input data is DriverBinding\r
- \r
- @param strDriverBinding The input string need be checked\r
- \r
- @retval true - The input is DriverBinding\r
- @retval false - The input is not DriverBinding\r
- \r
- **/\r
- public static boolean isDriverBinding(String strDriverBinding) {\r
- return isCName(strDriverBinding);\r
- }\r
-\r
- /**\r
- Check if the input data is ComponentName\r
- \r
- @param strComponentName The input string need be checked\r
- \r
- @retval true - The input is ComponentName\r
- @retval false - The input is not ComponentName\r
- \r
- **/\r
- public static boolean isComponentName(String strComponentName) {\r
- return isCName(strComponentName);\r
- }\r
-\r
- /**\r
- Check if the input data is DriverConfig\r
- \r
- @param strDriverConfig The input string need be checked\r
- \r
- @retval true - The input is DriverConfig\r
- @retval false - The input is not DriverConfig\r
- \r
- **/\r
- public static boolean isDriverConfig(String strDriverConfig) {\r
- return isCName(strDriverConfig);\r
- }\r
-\r
- /**\r
- Check if the input data is DriverDiag\r
- \r
- @param strDriverDiag The input string need be checked\r
- \r
- @retval true - The input is DriverDiag\r
- @retval false - The input is not DriverDiag\r
- \r
- **/\r
- public static boolean isDriverDiag(String strDriverDiag) {\r
- return isCName(strDriverDiag);\r
- }\r
-\r
- /**\r
- Check if the input data is SetVirtualAddressMapCallBack\r
- \r
- @param strSetVirtualAddressMapCallBack The input string need be checked\r
- \r
- @retval true - The input is SetVirtualAddressMapCallBack\r
- @retval false - The input is not SetVirtualAddressMapCallBack\r
- \r
- **/\r
- public static boolean isSetVirtualAddressMapCallBack(String strSetVirtualAddressMapCallBack) {\r
- return isCName(strSetVirtualAddressMapCallBack);\r
- }\r
-\r
- /**\r
- Check if the input data is ExitBootServicesCallBack\r
- \r
- @param strExitBootServicesCallBack The input string need be checked\r
- \r
- @retval true - The input is ExitBootServicesCallBack\r
- @retval false - The input is not ExitBootServicesCallBack\r
- \r
- **/\r
- public static boolean isExitBootServicesCallBack(String strExitBootServicesCallBack) {\r
- return isCName(strExitBootServicesCallBack);\r
- }\r
-\r
- /**\r
- Check if the input data is UserDefined\r
- \r
- @param strUserDefined The input string need be checked\r
- \r
- @retval true - The input is UserDefined\r
- @retval false - The input is not UserDefined\r
- \r
- **/\r
- public static boolean isUserDefined(String strUserDefined) {\r
- return isCName(strUserDefined);\r
- }\r
-\r
- //\r
- // The below is used to check PCDs data types\r
- //\r
-\r
- /**\r
- Check if the input data is Token\r
- \r
- @param strToken The input string need be checked\r
- \r
- @retval true - The input is Token\r
- @retval false - The input is not Token\r
- \r
- **/\r
- public static boolean isToken(String strToken) {\r
- return isHexDoubleWordDataType(strToken);\r
- }\r
-\r
- /**\r
- Check if the input data is MaxSku\r
- \r
- @param strMaxSku The input string need be checked\r
- \r
- @retval true - The input is MaxSku\r
- @retval false - The input is not MaxSku\r
- \r
- **/\r
- public static boolean isMaxSku(String strMaxSku) {\r
- return isHexByteDataType(strMaxSku);\r
- }\r
-\r
- /**\r
- Check if the input data is SkuId\r
- \r
- @param strSkuId The input string need be checked\r
- \r
- @retval true - The input is SkuId\r
- @retval false - The input is not SkuId\r
- \r
- **/\r
- public static boolean isSkuId(String strSkuId) {\r
- return isHexByteDataType(strSkuId);\r
- }\r
-\r
- /**\r
- Check if the input data is DatumSize\r
- \r
- @param strDatumSize The input string need be checked\r
- \r
- @retval true - The input is DatumSize\r
- @retval false - The input is not DatumSize\r
- \r
- **/\r
- public static boolean isDatumSize(String strDatumSize) {\r
- return isInt(strDatumSize, 1, 16777215);\r
- }\r
-\r
- /**\r
- Check if the input data is VariableGuid\r
- \r
- @param strVariableGuid The input string need be checked\r
- \r
- @retval true - The input is VariableGuid\r
- @retval false - The input is not VariableGuid\r
- \r
- **/\r
- public static boolean isVariableGuid(String strVariableGuid) {\r
- return (isGuid(strVariableGuid) || strVariableGuid.equals("0"));\r
- }\r
-\r
- /**\r
- Check if the input data is DataOffset\r
- \r
- @param strDataOffset The input string need be checked\r
- \r
- @retval true - The input is DataOffset\r
- @retval false - The input is not DataOffset\r
- \r
- **/\r
- public static boolean isDataOffset(String strDataOffset) {\r
- return isHex64BitDataType(strDataOffset);\r
- }\r
-\r
- /**\r
- Check if the input data is GuidOffset\r
- \r
- @param strGuidOffset The input string need be checked\r
- \r
- @retval true - The input is GuidOffset\r
- @retval false - The input is not GuidOffset\r
- \r
- **/\r
- public static boolean isGuidOffset(String strGuidOffset) {\r
- return isHex64BitDataType(strGuidOffset);\r
- }\r
-}\r