package org.tianocore.build.global;\r
\r
import java.util.ArrayList;\r
+import java.util.HashMap;\r
import java.util.Iterator;\r
+import java.util.LinkedHashMap;\r
import java.util.List;\r
import java.util.Map;\r
import java.util.Stack;\r
import org.apache.xmlbeans.XmlNormalizedString;\r
import org.apache.xmlbeans.XmlObject;\r
import org.apache.xmlbeans.XmlString;\r
-import org.tianocore.BuildOptionsDocument;\r
-import org.tianocore.CName;\r
-import org.tianocore.ExternsDocument;\r
-import org.tianocore.FfsDocument;\r
-import org.tianocore.FileNameConvention;\r
-import org.tianocore.FrameworkComponentTypes;\r
-import org.tianocore.FvImageOptionsDocument;\r
-import org.tianocore.GuidDocument;\r
-import org.tianocore.GuidsDocument;\r
-import org.tianocore.LibrariesDocument;\r
-import org.tianocore.LibraryClassDocument;\r
-import org.tianocore.LibraryUsage;\r
-import org.tianocore.ModuleSADocument;\r
-import org.tianocore.ModuleTypeDef;\r
-import org.tianocore.NameValueDocument;\r
-import org.tianocore.OutputDirectoryDocument;\r
-import org.tianocore.PPIsDocument;\r
-import org.tianocore.PackageNameDocument;\r
-import org.tianocore.ProtocolsDocument;\r
-import org.tianocore.PcdCodedDocument.PcdCoded;\r
-import org.tianocore.MsaHeaderDocument;\r
+import org.tianocore.*;\r
+import org.tianocore.FilenameDocument.Filename;\r
import org.tianocore.MsaHeaderDocument.MsaHeader;\r
+import org.tianocore.ProtocolsDocument.Protocols.Protocol;\r
+import org.tianocore.ProtocolsDocument.Protocols.ProtocolNotify;\r
+import org.tianocore.SupportedArchitectures.Enum;\r
+import org.tianocore.build.id.FpdModuleIdentification;\r
+import org.tianocore.build.id.ModuleIdentification;\r
+import org.tianocore.build.id.PackageIdentification;\r
+import org.tianocore.build.id.PlatformIdentification;\r
+import org.tianocore.build.toolchain.ToolChainInfo;\r
+import org.tianocore.logger.EdkLog;\r
\r
/**\r
- SurfaceAreaQuery class is used to query Surface Area information from msa, mbd,\r
- spd and fpd files. \r
- \r
- This class should not instantiated. All the public interfaces is static.\r
- \r
- @since GenBuild 1.0\r
- **/\r
+ * SurfaceAreaQuery class is used to query Surface Area information from msa,\r
+ * mbd, spd and fpd files.\r
+ * \r
+ * This class should not instantiated. All the public interfaces is static.\r
+ * \r
+ * @since GenBuild 1.0\r
+ */\r
public class SurfaceAreaQuery {\r
- /// \r
- /// Contains name/value pairs of Surface Area document object. The name is\r
- /// always the top level element name.\r
- /// \r
+\r
+ public static String prefix = "http://www.TianoCore.org/2006/Edk2.0";\r
+\r
+ // /\r
+ // / Contains name/value pairs of Surface Area document object. The name is\r
+ // / always the top level element name.\r
+ // /\r
private static Map<String, XmlObject> map = null;\r
- \r
- ///\r
- /// mapStack is used to do nested query\r
- ///\r
- private static Stack< Map<String, XmlObject> > mapStack = new Stack< Map<String, XmlObject> >();\r
- \r
- /// \r
- /// prefix of name space\r
- /// \r
+\r
+ // /\r
+ // / mapStack is used to do nested query\r
+ // /\r
+ private static Stack<Map<String, XmlObject>> mapStack = new Stack<Map<String, XmlObject>>();\r
+\r
+ // /\r
+ // / prefix of name space\r
+ // /\r
private static String nsPrefix = "sans";\r
- \r
- ///\r
- /// xmlbeans needs a name space for each Xpath element \r
- ///\r
+\r
+ // /\r
+ // / xmlbeans needs a name space for each Xpath element\r
+ // /\r
private static String ns = null;\r
- \r
- ///\r
- /// keep the namep declaration for xmlbeans Xpath query\r
- ///\r
+\r
+ // /\r
+ // / keep the namep declaration for xmlbeans Xpath query\r
+ // /\r
private static String queryDeclaration = null;\r
\r
/**\r
- Set a Surface Area document for query later\r
- \r
- @param map A Surface Area document in TopLevelElementName/XmlObject format.\r
- **/\r
+ * Set a Surface Area document for query later\r
+ * \r
+ * @param map\r
+ * A Surface Area document in TopLevelElementName/XmlObject\r
+ * format.\r
+ */\r
public static void setDoc(Map<String, XmlObject> map) {\r
- ns = OverrideProcess.prefix;\r
+ ns = prefix;\r
queryDeclaration = "declare namespace " + nsPrefix + "='" + ns + "'; ";\r
SurfaceAreaQuery.map = map;\r
}\r
\r
/**\r
- Push current used Surface Area document into query stack. The given new \r
- document will be used for any immediately followed getXXX() callings, \r
- untill pop() is called.\r
- \r
- @param newMap The TopLevelElementName/XmlObject format of a Surface Area document.\r
- **/\r
+ * Push current used Surface Area document into query stack. The given new\r
+ * document will be used for any immediately followed getXXX() callings,\r
+ * untill pop() is called.\r
+ * \r
+ * @param newMap\r
+ * The TopLevelElementName/XmlObject format of a Surface Area\r
+ * document.\r
+ */\r
public static void push(Map<String, XmlObject> newMap) {\r
mapStack.push(SurfaceAreaQuery.map);\r
SurfaceAreaQuery.map = newMap;\r
}\r
- \r
+\r
/**\r
- Discard current used Surface Area document and use the top document in stack\r
- instead.\r
- **/\r
+ * Discard current used Surface Area document and use the top document in\r
+ * stack instead.\r
+ */\r
public static void pop() {\r
SurfaceAreaQuery.map = mapStack.pop();\r
}\r
- \r
- ///\r
- /// Convert xPath to be namespace qualified, which is necessary for XmlBeans\r
- /// selectPath(). For example, converting /MsaHeader/ModuleType to\r
- /// /ns:MsaHeader/ns:ModuleType\r
- /// \r
+\r
+ // /\r
+ // / Convert xPath to be namespace qualified, which is necessary for\r
+ // XmlBeans\r
+ // / selectPath(). For example, converting /MsaHeader/ModuleType to\r
+ // / /ns:MsaHeader/ns:ModuleType\r
+ // /\r
private static String normalizeQueryString(String[] exp, String from) {\r
StringBuffer normQueryString = new StringBuffer(4096);\r
\r
Matcher matcher = pattern.matcher(newExp);\r
\r
while (matcher.find()) {\r
- String starter = newExp.substring(matcher.start(1), matcher.end(1));\r
- String seperator = newExp.substring(matcher.start(2), matcher.end(2));\r
- String token = newExp.substring(matcher.start(3), matcher.end(3));\r
- \r
+ String starter = newExp.substring(matcher.start(1), matcher\r
+ .end(1));\r
+ String seperator = newExp.substring(matcher.start(2), matcher\r
+ .end(2));\r
+ String token = newExp.substring(matcher.start(3), matcher\r
+ .end(3));\r
+\r
normQueryString.append(starter);\r
normQueryString.append(seperator);\r
normQueryString.append(nsPrefix);\r
}\r
\r
/**\r
- Search all XML documents stored in "map" for the specified xPath, using\r
- relative path (starting with '$this')\r
- \r
- @param xPath xpath query string array\r
- @returns An array of XmlObject if elements are found at the specified xpath\r
- @returns NULL if nothing is at the specified xpath\r
- **/\r
- public static XmlObject[] get(String[] xPath) {\r
+ * Search all XML documents stored in "map" for the specified xPath, using\r
+ * relative path (starting with '$this')\r
+ * \r
+ * @param xPath\r
+ * xpath query string array\r
+ * @returns An array of XmlObject if elements are found at the specified\r
+ * xpath\r
+ * @returns NULL if nothing is at the specified xpath\r
+ */\r
+ public static Object[] get(String[] xPath) {\r
if (map == null) {\r
return null;\r
}\r
- \r
+\r
String[] keys = (String[]) map.keySet().toArray(new String[map.size()]);\r
- List<XmlObject> result = new ArrayList<XmlObject>();\r
+ List<Object> result = new ArrayList<Object>();\r
for (int i = 0; i < keys.length; ++i) {\r
XmlObject rootNode = (XmlObject) map.get(keys[i]);\r
if (rootNode == null) {\r
continue;\r
}\r
- \r
- String query = queryDeclaration + normalizeQueryString(xPath, "$this/" + keys[i]);\r
+\r
+ String query = queryDeclaration\r
+ + normalizeQueryString(xPath, "$this/" + keys[i]);\r
XmlObject[] tmp = rootNode.selectPath(query);\r
for (int j = 0; j < tmp.length; ++j) {\r
- result.add(tmp[j]);\r
+ result.add((Object)tmp[j]);\r
}\r
}\r
- \r
+\r
int size = result.size();\r
if (size <= 0) {\r
return null;\r
}\r
- \r
- return (XmlObject[]) result.toArray(new XmlObject[size]);\r
+\r
+ return (Object[]) result.toArray(new Object[size]);\r
}\r
\r
/**\r
- Search XML documents named by "rootName" for the given xPath, using\r
- relative path (starting with '$this')\r
- \r
- @param rootName The top level element name \r
- @param xPath The xpath query string array\r
- @returns An array of XmlObject if elements are found at the given xpath\r
- @returns NULL if nothing is found at the given xpath\r
- **/\r
- public static XmlObject[] get(String rootName, String[] xPath) {\r
+ * Search XML documents named by "rootName" for the given xPath, using\r
+ * relative path (starting with '$this')\r
+ * \r
+ * @param rootName\r
+ * The top level element name\r
+ * @param xPath\r
+ * The xpath query string array\r
+ * @returns An array of XmlObject if elements are found at the given xpath\r
+ * @returns NULL if nothing is found at the given xpath\r
+ */\r
+ public static Object[] get(String rootName, String[] xPath) {\r
if (map == null) {\r
return null;\r
}\r
- \r
+\r
XmlObject root = (XmlObject) map.get(rootName);\r
if (root == null) {\r
return null;\r
}\r
\r
- String query = queryDeclaration + normalizeQueryString(xPath, "$this/" + rootName);\r
+ String query = queryDeclaration\r
+ + normalizeQueryString(xPath, "$this/" + rootName);\r
XmlObject[] result = root.selectPath(query);\r
if (result.length > 0) {\r
- return result;\r
+ return (Object[])result;\r
}\r
\r
query = queryDeclaration + normalizeQueryString(xPath, "/" + rootName);\r
result = root.selectPath(query);\r
if (result.length > 0) {\r
- return result;\r
+ return (Object[])result;\r
}\r
\r
return null;\r
}\r
\r
/**\r
- Retrieve SourceFiles/Filename for specified ARCH type\r
- \r
- @param arch architecture name\r
- @returns An array of XmlObject if elements are found at the known xpath\r
- @returns NULL if nothing is found at the known xpath\r
- **/\r
- public static XmlObject[] getSourceFiles(String arch) {\r
+ * Retrieve SourceFiles/Filename for specified ARCH type\r
+ * \r
+ * @param arch\r
+ * architecture name\r
+ * @returns An 2 dimension string array if elements are found at the known\r
+ * xpath\r
+ * @returns NULL if nothing is found at the known xpath\r
+ */\r
+ public static String[][] getSourceFiles(String arch) {\r
String[] xPath;\r
+ Object[] returns;\r
\r
- if (arch == null || arch.equals("")) {\r
- xPath = new String[] {\r
- "/Filename",\r
- "/Arch/Filename"\r
- };\r
- } else {\r
- xPath = new String[] {\r
- "/Filename[not(@SupArchList) and not(@ArchType) or @SupArchList='ALL' or @SupArchList='" + arch + "' or @ArchType='ALL' or @ArchType='" + arch + "']",\r
- "/Filename[not(@SupArchList) and not(@ArchType) or @ArchType='ALL' or @ArchType='" + arch + "']",\r
- "/Arch[@ArchType='ALL' or @ArchType='" + arch + "']/Filename"\r
- };\r
+ xPath = new String[] { "/Filename" };\r
+\r
+ returns = get("SourceFiles", xPath);\r
+\r
+ if (returns == null || returns.length == 0) {\r
+ return new String[0][0];\r
}\r
\r
- return get("SourceFiles", xPath);\r
+ Filename[] sourceFileNames = (Filename[]) returns;\r
+ List<String[]> outputList = new ArrayList<String[]>();\r
+ for (int i = 0; i < sourceFileNames.length; i++) {\r
+ List<String> archList = sourceFileNames[i].getSupArchList();\r
+ if (arch == null || arch.equalsIgnoreCase("") || archList == null || archList.contains(arch)) {\r
+ outputList.add(new String[] {sourceFileNames[i].getToolCode(),sourceFileNames[i].getStringValue()});\r
+ }\r
+ }\r
+ \r
+ String[][] outputString = new String[outputList.size()][2];\r
+ for (int index = 0; index < outputList.size(); index++) {\r
+ outputString[index][0] = outputList.get(index)[0];\r
+ outputString[index][1] = outputList.get(index)[1];\r
+ }\r
+ return outputString;\r
}\r
\r
/**\r
- Retrieve BuildOptions/Ffs\r
-\r
- @returns FfsDocument.Ffs object if elements are found at the known xpath\r
- @returns NULL if nothing is found at the known xpath\r
- **/\r
- public static FfsDocument.Ffs getFfs() {\r
- String[] xPath = new String[] { "/Ffs" };\r
-\r
- XmlObject[] returns = get("BuildOptions", xPath);\r
- if (returns != null && returns.length > 0) {\r
- return (FfsDocument.Ffs) returns[0];\r
+ * Retrieve /PlatformDefinitions/OutputDirectory from FPD\r
+ * \r
+ * @returns Directory names array if elements are found at the known xpath\r
+ * @returns Empty if nothing is found at the known xpath\r
+ */\r
+ public static String getFpdOutputDirectory() {\r
+ String[] xPath = new String[] { "/PlatformDefinitions" };\r
+\r
+ Object[] returns = get("PlatformSurfaceArea", xPath);\r
+ if (returns == null || returns.length == 0) {\r
+ return null;\r
}\r
-\r
- return null;\r
+ PlatformDefinitionsDocument.PlatformDefinitions item = (PlatformDefinitionsDocument.PlatformDefinitions)returns[0];\r
+ return item.getOutputDirectory();\r
}\r
\r
- /**\r
- Retrieve BuildOptions/OutputDirectory\r
+ public static String getFpdIntermediateDirectories() {\r
+ String[] xPath = new String[] { "/PlatformDefinitions" };\r
\r
- @returns Directory names array if elements are found at the known xpath\r
- @returns Empty if nothing is found at the known xpath\r
- **/\r
- public static String[] getOutputDirectory() {\r
- String[] xPath = new String[] { "/OutputDirectory" };\r
+ Object[] returns = get("PlatformSurfaceArea", xPath);\r
+ if (returns == null || returns.length == 0) {\r
+ return "UNIFIED";\r
+ }\r
+ PlatformDefinitionsDocument.PlatformDefinitions item = (PlatformDefinitionsDocument.PlatformDefinitions)returns[0];\r
+ if(item.getIntermediateDirectories() == null) {\r
+ return null; \r
+ }\r
+ else {\r
+ return item.getIntermediateDirectories().toString();\r
+ }\r
+ }\r
\r
- XmlObject[] returns = get("BuildOptions", xPath);\r
- if (returns != null && returns.length > 0) {\r
- String[] dirString = new String[2];\r
+ public static String getModuleFfsKeyword() {\r
+ String[] xPath = new String[] { "/" };\r
\r
- OutputDirectoryDocument.OutputDirectory[] dir = (OutputDirectoryDocument.OutputDirectory[]) returns;\r
- dirString[0] = dir[0].getIntermediateDirectories().toString();\r
- dirString[1] = dir[0].getStringValue();\r
+ Object[] returns = get("ModuleSaBuildOptions", xPath);\r
+ if (returns == null || returns.length == 0) {\r
+ return null;\r
+ }\r
+ ModuleSaBuildOptionsDocument.ModuleSaBuildOptions item = (ModuleSaBuildOptionsDocument.ModuleSaBuildOptions)returns[0];\r
+ return item.getFfsFormatKey();\r
+ }\r
+ \r
+ public static String getModuleFvBindingKeyword() {\r
+ String[] xPath = new String[] { "/" };\r
\r
- return dirString;\r
+ Object[] returns = get("ModuleSaBuildOptions", xPath);\r
+ if (returns == null || returns.length == 0) {\r
+ return null;\r
}\r
+ ModuleSaBuildOptionsDocument.ModuleSaBuildOptions item = (ModuleSaBuildOptionsDocument.ModuleSaBuildOptions)returns[0];\r
+ return item.getFvBinding();\r
+ }\r
+ \r
+ public static List getModuleSupportedArchs() {\r
+ String[] xPath = new String[] { "/" };\r
\r
- return new String[] { "UNIFIED", null };\r
+ Object[] returns = get("ModuleDefinitions", xPath);\r
+ if (returns == null || returns.length == 0) {\r
+ return null;\r
+ }\r
+ ModuleDefinitionsDocument.ModuleDefinitions item = (ModuleDefinitionsDocument.ModuleDefinitions)returns[0];\r
+ return item.getSupportedArchitectures();\r
+ }\r
+ \r
+ public static BuildOptionsDocument.BuildOptions.Ffs[] getFpdFfs() {\r
+ String[] xPath = new String[] {"/Ffs"};\r
+ \r
+ Object[] returns = get("BuildOptions", xPath);\r
+ if (returns == null || returns.length == 0) {\r
+ return new BuildOptionsDocument.BuildOptions.Ffs[0];\r
+ }\r
+ return (BuildOptionsDocument.BuildOptions.Ffs[])returns;\r
}\r
+ \r
+ public static String getModuleOutputFileBasename() {\r
+ String[] xPath = new String[] { "/" };\r
\r
+ Object[] returns = get("ModuleDefinitions", xPath);\r
+ if (returns == null || returns.length == 0) {\r
+ return null;\r
+ }\r
+ ModuleDefinitionsDocument.ModuleDefinitions item = (ModuleDefinitionsDocument.ModuleDefinitions)returns[0];\r
+ return item.getOutputFileBasename();\r
+ }\r
+ \r
/**\r
- Retrieve BuildOptions/Option or Arch/Option\r
+ * Retrieve BuildOptions/Option or Arch/Option\r
+ * \r
+ * @param toolChainFamilyFlag\r
+ * if true, retrieve options for toolchain family; otherwise for\r
+ * toolchain\r
+ * \r
+ * @returns String[][5] name, target, toolchain, arch, coommand of options\r
+ * if elements are found at the known xpath. String[0][] if dont\r
+ * find element.\r
+ * \r
+ * @returns Empty array if nothing is there\r
+ */\r
+ public static String[][] getOptions(String from, String[] xPath, boolean toolChainFamilyFlag) {\r
+ String target = null;\r
+ String toolchain = null;\r
+ String toolchainFamily = null;\r
+ List<String> archList = null;\r
+ String cmd = null;\r
+ String targetName = null;\r
+ String optionName = null;\r
+\r
+ Object[] returns = get(from, xPath);\r
+ if (returns == null) {\r
+ return new String[0][5];\r
+ }\r
\r
- @param arch architecture name\r
+ List<String[]> optionList = new ArrayList<String[]>();\r
+ OptionDocument.Option option;\r
\r
- @returns name/value pairs of options if elements are found at the known xpath\r
- @returns Empty array if nothing is there\r
- **/\r
- public static String[][] getOptions(String arch){\r
- String[] xPath;\r
+ for (int i = 0; i < returns.length; i++) {\r
+ option = (OptionDocument.Option) returns[i];\r
\r
- if (arch == null || arch.equals("")) {\r
- xPath = new String[] {\r
- "/Option",\r
- "/Arch/Option"\r
- };\r
- } else {\r
- xPath = new String[] {\r
- "/Option",\r
- "/Option[@SupArchList='ALL' or @SupArchList='" + arch + "']",\r
- "/Arch[@ArchType='ALL' or @ArchType='" + arch + "']/Option"\r
- };\r
- }\r
+ //\r
+ // Get Target, ToolChain(Family), Arch, Cmd, and Option from Option,\r
+ // then\r
+ // put to result[][5] array in above order.\r
+ //\r
+ String[] targetList;\r
+ if (option.getBuildTargets() == null) {\r
+ target = null;\r
+ }\r
+ else {\r
+ target = option.getBuildTargets().toString();\r
+ }\r
+ if (target != null) {\r
+ targetList = target.split(" ");\r
+ } else {\r
+ targetList = new String[1];\r
+ targetList[0] = null;\r
+ }\r
\r
- XmlObject[] returns = get("BuildOptions", xPath);\r
- if (returns == null){\r
- return new String[0][2];\r
- }\r
- \r
- String[][] result = new String[returns.length][2];\r
- for (int i = 0; i < returns.length; i ++){\r
- String str;\r
- String name = null;\r
- String value = null;\r
-\r
- if (returns[i] instanceof BuildOptionsDocument.BuildOptions.Option) {\r
- BuildOptionsDocument.BuildOptions.Option option = (BuildOptionsDocument.BuildOptions.Option)returns[i];\r
- str = option.getStringValue();\r
- } else if (returns[i] instanceof BuildOptionsDocument.BuildOptions.Arch.Option) {\r
- BuildOptionsDocument.BuildOptions.Arch.Option archOption = (BuildOptionsDocument.BuildOptions.Arch.Option)returns[i];\r
- str = archOption.getStringValue();\r
+ if (toolChainFamilyFlag) {\r
+ toolchainFamily = option.getToolChainFamily();\r
+ if (toolchainFamily != null) {\r
+ toolchain = toolchainFamily.toString();\r
+ } else {\r
+ toolchain = null;\r
+ }\r
} else {\r
- continue;\r
+ toolchain = option.getTagName();\r
}\r
- \r
- int equalIndex = str.indexOf('=');\r
- if ( equalIndex > 0) {\r
- name = str.substring(0, equalIndex).trim();\r
- value = str.substring(equalIndex + 1).trim();\r
- // TBD remove some forbidden name: BASE_NAME, ARCH and so on\r
- if (name.length() == 0){\r
- name = null;\r
+\r
+ archList = new ArrayList<String>();\r
+ List<String> archEnumList = option.getSupArchList(); \r
+ if (archEnumList == null) {\r
+ archList.add(null);\r
+ } else {\r
+ archList.addAll(archEnumList);\r
+ /*\r
+ Iterator it = archEnumList.iterator();\r
+ while (it.hasNext()) {\r
+ System.out.println(it.next().getClass().getName());\r
+ SupportedArchitectures.Enum archType = it.next();\r
+ archList.add(archType.toString());\r
+ }\r
+ */\r
+ }\r
+\r
+ cmd = option.getToolCode();\r
+\r
+ optionName = option.getStringValue();\r
+ for (int t = 0; t < targetList.length; t++) {\r
+ for (int j = 0; j < archList.size(); j++) {\r
+ optionList.add(new String[] { targetList[t],\r
+ toolchain, archList.get(j), cmd, optionName});\r
}\r
}\r
- result[i][0] = name;\r
- result[i][1] = value;\r
}\r
\r
+ String[][] result = new String[optionList.size()][5];\r
+ for (int i = 0; i < optionList.size(); i++) {\r
+ result[i][0] = optionList.get(i)[0];\r
+ result[i][1] = optionList.get(i)[1];\r
+ result[i][2] = optionList.get(i)[2];\r
+ result[i][3] = optionList.get(i)[3];\r
+ result[i][4] = optionList.get(i)[4];\r
+ }\r
return result;\r
}\r
+\r
+ public static String[][] getModuleBuildOptions(boolean toolChainFamilyFlag) {\r
+ String[] xPath;\r
+ \r
+ if (toolChainFamilyFlag == true) {\r
+ xPath = new String[] {\r
+ "/Options/Option[not(@ToolChainFamily) and not(@TagName)]",\r
+ "/Options/Option[@ToolChainFamily]", };\r
+ } else {\r
+ xPath = new String[] {\r
+ "/Options/Option[not(@ToolChainFamily) and not(@TagName)]",\r
+ "/Options/Option[@TagName]", };\r
+ }\r
+ return getOptions("ModuleSaBuildOptions", xPath, toolChainFamilyFlag);\r
+ } \r
\r
- public static String getModuleName() {\r
- String[] xPath = new String[] { "/ModuleName", "/BaseName" };\r
+ public static String[][] getPlatformBuildOptions(boolean toolChainFamilyFlag) {\r
+ String[] xPath;\r
\r
- XmlObject[] returns = get(xPath);\r
- if (returns != null && returns.length > 0) {\r
- return returns[0].toString();\r
+ if (toolChainFamilyFlag == true) {\r
+ xPath = new String[] {\r
+ "/BuildOptions/Options/Option[not(@ToolChainFamily) and not(@TagName)]",\r
+ "/BuildOptions/Options/Option[@ToolChainFamily]", };\r
+ } else {\r
+ xPath = new String[] {\r
+ "/BuildOptions/Options/Option[not(@ToolChainFamily) and not(@TagName)]",\r
+ "/BuildOptions/Options/Option[@TagName]", };\r
}\r
\r
- return null;\r
+ return getOptions("PlatformSurfaceArea", xPath, toolChainFamilyFlag);\r
}\r
\r
- /**\r
- Retrieve <xxxHeader>/ModuleType\r
-\r
- @returns The module type name if elements are found at the known xpath\r
- @returns null if nothing is there\r
- **/\r
- public static String getModuleType() {\r
- String[] xPath = new String[] { "/ModuleType" };\r
+ public static ToolChainInfo getFpdToolChainInfo() {\r
+ String[] xPath = new String[] { "/PlatformDefinitions" };\r
\r
- XmlObject[] returns = get(xPath);\r
- if (returns != null && returns.length > 0) {\r
- ModuleTypeDef type = (ModuleTypeDef) returns[0];\r
- return type.enumValue().toString();\r
+ Object[] returns = get("PlatformSurfaceArea", xPath);\r
+ if (returns == null || returns.length == 0) {\r
+ return null;\r
}\r
-\r
- return null;\r
+ \r
+ PlatformDefinitionsDocument.PlatformDefinitions item = (PlatformDefinitionsDocument.PlatformDefinitions)returns[0];\r
+ ToolChainInfo toolChainInfo = new ToolChainInfo();\r
+ toolChainInfo.addTargets(item.getBuildTargets().toString());\r
+ toolChainInfo.addArchs(item.getSupportedArchitectures().toString());\r
+ toolChainInfo.addTagnames((String)null);\r
+ return toolChainInfo;\r
}\r
\r
/**\r
- Retrieve <xxxHeader>/ComponentType\r
- \r
- @returns The component type name if elements are found at the known xpath\r
- @returns null if nothing is there\r
- **/\r
- public static String getComponentType() {\r
- String[] xPath = new String[] { "/ComponentType" };\r
+ * Retrieve <xxxHeader>/ModuleType\r
+ * \r
+ * @returns The module type name if elements are found at the known xpath\r
+ * @returns null if nothing is there\r
+ */\r
+ public static String getModuleType() {\r
+ String[] xPath = new String[] { "/ModuleType" };\r
\r
- XmlObject[] returns = get(xPath);\r
+ Object[] returns = get(xPath);\r
if (returns != null && returns.length > 0) {\r
- FrameworkComponentTypes type = (FrameworkComponentTypes) returns[0];\r
+ ModuleTypeDef type = (ModuleTypeDef) returns[0];\r
return type.enumValue().toString();\r
}\r
\r
}\r
\r
/**\r
- Retrieve Includes/PackageName\r
-\r
- @param arch Architecture name\r
-\r
- @returns package name list if elements are found at the known xpath\r
- @returns null if nothing is there\r
- **/\r
- public static List<String> getIncludePackageName(String arch) {\r
+ * Retrieve PackageDependencies/Package\r
+ * \r
+ * @param arch\r
+ * Architecture name\r
+ * \r
+ * @returns package name list if elements are found at the known xpath\r
+ * @returns null if nothing is there\r
+ */\r
+ public static PackageIdentification[] getDependencePkg(String arch) {\r
String[] xPath;\r
+ String packageGuid = null;\r
+ String packageVersion = null;\r
\r
- if (arch == null || arch.equals("")) {\r
- xPath = new String[] {\r
- "/PackageName",\r
- "/Arch/PackageName"\r
- };\r
- } else {\r
- xPath = new String[] {\r
- "/PackageName",\r
- "/PackageName[@SupArchList='ALL' or @SupArchList='" + arch + "']",\r
- "/PackageName[@Arch='ALL' or @Arch='" + arch + "']",\r
- "/Arch[@ArchType='ALL' or @ArchType='" + arch + "']/PackageName"\r
- };\r
- }\r
\r
- XmlObject[] returns = get("Includes", xPath);\r
- if (returns == null || returns.length == 0) {\r
- returns = get("PackageDependencies", xPath);\r
- if (returns == null || returns.length == 0) {\r
- return null;\r
- }\r
+ xPath = new String[] { "/Package" };\r
+ \r
+ Object[] returns = get("PackageDependencies", xPath);\r
+ if (returns == null) {\r
+ return new PackageIdentification[0];\r
}\r
-\r
- List<String> packageNames = new ArrayList<String>();\r
- PackageNameDocument.PackageName[] nameObj = (PackageNameDocument.PackageName[])returns;\r
- for (int i = 0; i < returns.length; ++i) {\r
- packageNames.add(nameObj[i].getStringValue());\r
+ PackageIdentification[] packageIdList = new PackageIdentification[returns.length];\r
+ for (int i = 0; i < returns.length; i++) {\r
+ PackageDependenciesDocument.PackageDependencies.Package item = (PackageDependenciesDocument.PackageDependencies.Package) returns[i];\r
+ List<String> archList = item.getSupArchList();\r
+ if (arch == null || archList == null || archList.contains(arch)) {\r
+ packageGuid = item.getPackageGuid();\r
+ packageVersion = item.getPackageVersion();\r
+ packageIdList[i] = (new PackageIdentification(null, packageGuid,\r
+ packageVersion));\r
+ }\r
}\r
- \r
- return packageNames;\r
+ return packageIdList;\r
}\r
\r
/**\r
- Retrieve LibraryClassDefinitions/LibraryClass for specified usage\r
-\r
- @param usage Library class usage\r
-\r
- @returns LibraryClass objects list if elements are found at the known xpath\r
- @returns null if nothing is there\r
- **/\r
- public static LibraryClassDocument.LibraryClass[] getLibraryClassArray(String usage) {\r
+ * Retrieve LibraryClassDefinitions/LibraryClass for specified usage\r
+ * \r
+ * @param usage\r
+ * Library class usage\r
+ * \r
+ * @returns LibraryClass objects list if elements are found at the known\r
+ * xpath\r
+ * @returns null if nothing is there\r
+ */\r
+ public static String[] getLibraryClasses(String usage) {\r
String[] xPath;\r
\r
if (usage == null || usage.equals("")) {\r
- xPath = new String[] {"/LibraryClass"};\r
+ xPath = new String[] { "/LibraryClass" };\r
} else {\r
- xPath = new String[] {"/LibraryClass[@Usage='" + usage + "']"};\r
+ xPath = new String[] { "/LibraryClass[@Usage='" + usage + "']" };\r
}\r
\r
- XmlObject[] returns = get("LibraryClassDefinitions", xPath);\r
- if (returns != null && returns.length > 0) {\r
- return (LibraryClassDocument.LibraryClass[]) returns;\r
+ Object[] returns = get("LibraryClassDefinitions", xPath);\r
+ if (returns == null || returns.length == 0) {\r
+ return new String[0];\r
}\r
\r
- return null;\r
+ LibraryClassDocument.LibraryClass[] libraryClassList = (LibraryClassDocument.LibraryClass[]) returns;\r
+ String[] libraryClassName = new String[libraryClassList.length];\r
+ for (int i = 0; i < libraryClassList.length; i++) {\r
+ libraryClassName[i] = libraryClassList[i].getKeyword();\r
+ }\r
+ return libraryClassName;\r
}\r
\r
/**\r
- Retrieve ModuleEntryPoint names\r
-\r
- @returns ModuleEntryPoint name list if elements are found at the known xpath\r
- @returns null if nothing is there\r
- **/\r
+ * Retrieve ModuleEntryPoint names\r
+ * \r
+ * @returns ModuleEntryPoint name list if elements are found at the known\r
+ * xpath\r
+ * @returns null if nothing is there\r
+ */\r
public static String[] getModuleEntryPointArray() {\r
String[] xPath = new String[] { "/Extern/ModuleEntryPoint" };\r
\r
- XmlObject[] returns = get("Externs", xPath);\r
+ Object[] returns = get("Externs", xPath);\r
\r
if (returns != null && returns.length > 0) {\r
String[] entryPoints = new String[returns.length];\r
\r
for (int i = 0; i < returns.length; ++i) {\r
- entryPoints[i] = ((XmlNormalizedString) returns[i])\r
- .getStringValue();\r
+ entryPoints[i] = ((CNameType) returns[i]).getStringValue();\r
}\r
\r
return entryPoints;\r
}\r
\r
/**\r
- Retrieve module Guid string\r
- \r
- @returns GUILD string if elements are found at the known xpath\r
- @returns null if nothing is there\r
- **/\r
- public static String getModuleGuid() {\r
- String[] xPath = new String[] { "" };\r
+ * retrieve Protocol for specified usage\r
+ * \r
+ * @param usage\r
+ * Protocol usage arch Architecture\r
+ * \r
+ * @returns Protocol String list if elements are found at the known xpath\r
+ * @returns String[0] if nothing is there\r
+ */\r
+ public static String[] getProtocolArray(String arch, String usage) {\r
+ String[] xPath;\r
+ String usageXpath = "";\r
+ String archXpath = "";\r
\r
- XmlObject[] returns = get("MsaHeader", xPath);\r
- if (returns != null && returns.length > 0) {\r
- MsaHeaderDocument.MsaHeader moduleHeader = (MsaHeaderDocument.MsaHeader) returns[0];\r
- if (moduleHeader.isSetGuid()) {\r
- return moduleHeader.getGuid().getStringValue();\r
- } else if (moduleHeader.isSetGuidValue()) {\r
- return moduleHeader.getGuidValue();\r
+ if (arch == null || arch.equals("")) {\r
+ return new String[0];\r
+ } else {\r
+ archXpath = "/Protocol";\r
+ if (usage != null && !usage.equals("")) {\r
+ usageXpath = "/Protocol[@Usage='" + usage + "']";\r
+ xPath = new String[] { usageXpath, archXpath };\r
+ } else {\r
+ return getProtocolArray(arch);\r
}\r
+\r
}\r
\r
- return null;\r
+ Object[] returns = get("Protocols", xPath);\r
+ if (returns == null) {\r
+ return new String[0];\r
+ }\r
+ Protocol[] protocolList = (Protocol[]) returns;\r
+\r
+ String[] protocolArray = new String[returns.length];\r
+ for (int i = 0; i < returns.length; i++) {\r
+ protocolArray[i] = protocolList[i].getProtocolCName();\r
+ }\r
+ return protocolArray;\r
}\r
\r
/**\r
- Retrieve module Guid string\r
- \r
- @returns GUILD string if elements are found at the known xpath\r
- @returns null if nothing is there\r
- **/\r
- public static String getModuleGuidValue() {\r
- String[] xPath = new String[] { "" };\r
+ * retrieve Protocol for specified usage\r
+ * \r
+ * @param arch\r
+ * Architecture\r
+ * \r
+ * @returns Protocol String list if elements are found at the known xpath\r
+ * @returns String[0] if nothing is there\r
+ */\r
+ public static String[] getProtocolArray(String arch) {\r
+ String[] xPath;\r
\r
- XmlObject[] returns = get("MsaHeader", xPath);\r
- if (returns != null && returns.length > 0) { \r
- MsaHeaderDocument.MsaHeader moduleHeader = (MsaHeaderDocument.MsaHeader) returns[0];\r
- return moduleHeader.getGuidValue();\r
+ if (arch == null || arch.equals("")) {\r
+ return new String[0];\r
+ } else {\r
+ xPath = new String[] { "/Protocol" };\r
}\r
\r
- return null;\r
+ Object[] returns = get("Protocols", xPath);\r
+ if (returns == null) {\r
+ return new String[0];\r
+ }\r
+ Protocol[] returnlList = (Protocol[]) returns;\r
+\r
+ List<String> protocolList = new ArrayList<String>();\r
+ \r
+ for (int i = 0; i < returns.length; i++) {\r
+ List<String> archList = returnlList[i].getSupArchList();\r
+ if (archList == null || archList.contains(arch)){\r
+ protocolList.add(returnlList[i].getProtocolCName());\r
+ }\r
+ }\r
+ String[] protocolArray = new String[protocolList.size()];\r
+ for (int i = 0; i < protocolList.size(); i++) {\r
+ protocolArray[i] = protocolList.get(i);\r
+ }\r
+ return protocolArray;\r
}\r
\r
/**\r
- retrieve Protocol for specified usage\r
-\r
- @param usage Protocol usage\r
-\r
- @returns Protocol objects list if elements are found at the known xpath\r
- @returns null if nothing is there\r
- **/\r
- public static ProtocolsDocument.Protocols.Protocol[] getProtocolArray(String usage) {\r
+ * Retrieve ProtocolNotify for specified usage\r
+ * \r
+ * @param usage\r
+ * ProtocolNotify usage\r
+ * \r
+ * @returns String[] if elements are found at the known xpath\r
+ * @returns String[0] if nothing is there\r
+ */\r
+ public static String[] getProtocolNotifyArray(String arch) {\r
String[] xPath;\r
\r
- if (usage == null || usage.equals("")) {\r
- xPath = new String[] {"/Protocol"};\r
+ if (arch == null || arch.equals("")) {\r
+ return new String[0];\r
} else {\r
- xPath = new String[] {"/Protocol[@Usage='" + usage + "']"};\r
+ xPath = new String[] { "/ProtocolNotify" };\r
}\r
\r
- XmlObject[] returns = get("Protocols", xPath);\r
- if (returns != null && returns.length > 0) {\r
- return (ProtocolsDocument.Protocols.Protocol[]) returns;\r
+ Object[] returns = get("Protocols", xPath);\r
+ if (returns == null) {\r
+ return new String[0];\r
}\r
\r
- return null;\r
+ List<String> protocolNotifyList = new ArrayList<String>();\r
+ \r
+ for (int i = 0; i < returns.length; i++) {\r
+ List<String> archList = ((ProtocolNotify) returns[i]).getSupArchList();\r
+ if (archList == null || archList.contains(arch)){\r
+ protocolNotifyList.add(((ProtocolNotify) returns[i]).getProtocolNotifyCName());\r
+ }\r
+ \r
+ }\r
+ String[] protocolNotifyArray = new String[protocolNotifyList.size()];\r
+ for (int i = 0; i < protocolNotifyList.size(); i++) {\r
+ protocolNotifyArray[i] = protocolNotifyList.get(i);\r
+ }\r
+ return protocolNotifyArray;\r
}\r
\r
/**\r
- Retrieve ProtocolNotify for specified usage\r
- \r
- @param usage ProtocolNotify usage\r
+ * Retrieve ProtocolNotify for specified usage\r
+ * \r
+ * @param usage\r
+ * ProtocolNotify usage\r
+ * \r
+ * @returns String[] if elements are found at the known xpath\r
+ * @returns String[0] if nothing is there\r
+ */\r
+ public static String[] getProtocolNotifyArray(String arch, String usage) {\r
\r
- @returns ProtocolNotify objects list if elements are found at the known xpath\r
- @returns null if nothing is there\r
- **/\r
- public static ProtocolsDocument.Protocols.ProtocolNotify[] getProtocolNotifyArray(String usage) {\r
String[] xPath;\r
+ String usageXpath;\r
+ String archXpath;\r
\r
- if (usage == null || usage.equals("")) {\r
- xPath = new String[] {"/ProtocolNotify"};\r
+ if (arch == null || arch.equals("")) {\r
+ return new String[0];\r
} else {\r
- xPath = new String[] {"/ProtocolNotify[@Usage='" + usage + "']"};\r
+ archXpath = "/ProtocolNotify";\r
+ if (usage != null && !usage.equals("")) {\r
+ usageXpath = "/ProtocolNotify[@Usage='" + arch + "']";\r
+ xPath = new String[] { archXpath, usageXpath };\r
+ } else {\r
+ return getProtocolNotifyArray(arch);\r
+ }\r
}\r
\r
- XmlObject[] returns = get("Protocols", xPath);\r
- if (returns != null && returns.length > 0) {\r
- return (ProtocolsDocument.Protocols.ProtocolNotify[]) returns;\r
+ Object[] returns = get("Protocols", xPath);\r
+ if (returns == null) {\r
+ return new String[0];\r
}\r
\r
- return null;\r
+ String[] protocolNotifyList = new String[returns.length];\r
+\r
+ for (int i = 0; i < returns.length; i++) {\r
+ protocolNotifyList[i] = ((ProtocolNotify) returns[i]).getProtocolNotifyCName();\r
+ }\r
+ return protocolNotifyList;\r
}\r
\r
/**\r
- Retrieve ModuleUnloadImage names\r
-\r
- @returns ModuleUnloadImage name list if elements are found at the known xpath\r
- @returns null if nothing is there\r
- **/\r
+ * Retrieve ModuleUnloadImage names\r
+ * \r
+ * @returns ModuleUnloadImage name list if elements are found at the known\r
+ * xpath\r
+ * @returns null if nothing is there\r
+ */\r
public static String[] getModuleUnloadImageArray() {\r
String[] xPath = new String[] { "/Extern/ModuleUnloadImage" };\r
\r
- XmlObject[] returns = get("Externs", xPath);\r
+ Object[] returns = get("Externs", xPath);\r
if (returns != null && returns.length > 0) {\r
String[] stringArray = new String[returns.length];\r
- XmlNormalizedString[] doc = (XmlNormalizedString[])returns;\r
+ CNameType[] doc = (CNameType[]) returns;\r
\r
for (int i = 0; i < returns.length; ++i) {\r
stringArray[i] = doc[i].getStringValue();\r
}\r
\r
/**\r
- Retrieve Extern\r
-\r
- @returns Extern objects list if elements are found at the known xpath\r
- @returns null if nothing is there\r
- **/\r
+ * Retrieve Extern\r
+ * \r
+ * @returns Extern objects list if elements are found at the known xpath\r
+ * @returns null if nothing is there\r
+ */\r
public static ExternsDocument.Externs.Extern[] getExternArray() {\r
String[] xPath = new String[] { "/Extern" };\r
\r
- XmlObject[] returns = get("Externs", xPath);\r
+ Object[] returns = get("Externs", xPath);\r
if (returns != null && returns.length > 0) {\r
return (ExternsDocument.Externs.Extern[]) returns;\r
}\r
}\r
\r
/**\r
- Retrieve Ppi information\r
-\r
- @param usage Ppi usage\r
-\r
- @returns Ppi objects list if elements are found at the known xpath\r
- @returns null if nothing is there\r
- **/\r
- public static PPIsDocument.PPIs.Ppi[] getPpiArray(String usage) {\r
+ * Retrieve PpiNotify for specified arch\r
+ * \r
+ * @param arch\r
+ * PpiNotify arch\r
+ * \r
+ * @returns String[] if elements are found at the known xpath\r
+ * @returns String[0] if nothing is there\r
+ */\r
+ public static String[] getPpiNotifyArray(String arch) {\r
String[] xPath;\r
\r
- if (usage == null || usage.equals("")) {\r
- xPath = new String[] { "/Ppi" };\r
+ if (arch == null || arch.equals("")) {\r
+ return new String[0];\r
} else {\r
- xPath = new String[] { "/Ppi[@Usage='" + usage + "']" };\r
+ xPath = new String[] { "/PpiNotify" };\r
}\r
\r
- XmlObject[] returns = get("PPIs", xPath);\r
- if (returns != null && returns.length > 0) {\r
- return (PPIsDocument.PPIs.Ppi[])returns;\r
+ Object[] returns = get("PPIs", xPath);\r
+ if (returns == null) {\r
+ return new String[0];\r
}\r
\r
- return null;\r
+ \r
+ List<String> ppiNotifyList = new ArrayList<String>();\r
+ for (int i = 0; i < returns.length; i++) {\r
+ List<String> archList = ((PPIsDocument.PPIs.PpiNotify) returns[i]).getSupArchList();\r
+ if (archList == null || archList.contains(arch)){\r
+ ppiNotifyList.add(((PPIsDocument.PPIs.PpiNotify) returns[i]).getPpiNotifyCName()); \r
+ }\r
+ \r
+ }\r
+ String[] ppiNotifyArray = new String[ppiNotifyList.size()];\r
+ for (int i = 0; i < ppiNotifyList.size(); i++) {\r
+ ppiNotifyArray[i] = ppiNotifyList.get(i);\r
+ }\r
+\r
+ return ppiNotifyArray;\r
}\r
\r
/**\r
- Retrive PpiNotify information\r
- \r
- @param usage\r
+ * Retrieve PpiNotify for specified usage and arch\r
+ * \r
+ * @param arch\r
+ * PpiNotify arch usage PpiNotify usage\r
+ * \r
+ * \r
+ * @returns String[] if elements are found at the known xpath\r
+ * @returns String[0] if nothing is there\r
+ */\r
+ public static String[] getPpiNotifyArray(String arch, String usage) {\r
\r
- @returns PpiNotify objects list if elements are found at the known xpath\r
- @returns null if nothing is there\r
- **/\r
- public static PPIsDocument.PPIs.PpiNotify[] getPpiNotifyArray(String usage) {\r
String[] xPath;\r
+ String usageXpath;\r
+ String archXpath;\r
\r
- if (usage == null || usage.equals("")) {\r
- xPath = new String[] { "/PpiNotify" };\r
+ if (arch == null || arch.equals("")) {\r
+ return new String[0];\r
} else {\r
- xPath = new String[] { "/PpiNotify[@Usage='" + usage + "']" };\r
+ archXpath = "/PpiNotify";\r
+ if (usage != null && !usage.equals("")) {\r
+ usageXpath = "/PpiNotify[@Usage='" + arch + "']";\r
+ xPath = new String[] { archXpath, usageXpath };\r
+ } else {\r
+ return getProtocolNotifyArray(arch);\r
+ }\r
}\r
\r
- XmlObject[] returns = get("PPIs", xPath);\r
- if (returns != null && returns.length > 0) {\r
- return (PPIsDocument.PPIs.PpiNotify[])returns;\r
+ Object[] returns = get("PPIs", xPath);\r
+ if (returns == null) {\r
+ return new String[0];\r
}\r
\r
- return null;\r
+ String[] ppiNotifyList = new String[returns.length];\r
+\r
+ for (int i = 0; i < returns.length; i++) {\r
+ ppiNotifyList[i] = ((PPIsDocument.PPIs.PpiNotify) returns[i]).getPpiNotifyCName();\r
+ }\r
+ return ppiNotifyList;\r
}\r
\r
/**\r
- Retrieve GuidEntry information for specified usage\r
-\r
- @param usage GuidEntry usage\r
-\r
- @returns GuidEntry objects list if elements are found at the known xpath\r
- @returns null if nothing is there\r
- **/\r
- public static GuidsDocument.Guids.GuidEntry[] getGuidEntryArray(String usage) {\r
+ * Retrieve Ppi for specified arch\r
+ * \r
+ * @param arch\r
+ * Ppi arch\r
+ * \r
+ * @returns String[] if elements are found at the known xpath\r
+ * @returns String[0] if nothing is there\r
+ */\r
+ public static String[] getPpiArray(String arch) {\r
String[] xPath;\r
\r
- if (usage == null || usage.equals("")) {\r
- xPath = new String[] { "/GuidEntry" };\r
+ if (arch == null || arch.equals("")) {\r
+ return new String[0];\r
} else {\r
- xPath = new String[] { "/GuidEntry[@Usage='" + usage + "']" };\r
+ xPath = new String[] { "/Ppi" };\r
}\r
\r
- XmlObject[] returns = get("Guids", xPath);\r
- if (returns != null && returns.length > 0) {\r
- return (GuidsDocument.Guids.GuidEntry[])returns;\r
+ Object[] returns = get("PPIs", xPath);\r
+ if (returns == null) {\r
+ return new String[0];\r
}\r
\r
- return null;\r
+ List<String> ppiList = new ArrayList<String>();\r
+ for (int i = 0; i < returns.length; i++) {\r
+ List<String> archList = ((PPIsDocument.PPIs.Ppi) returns[i]).getSupArchList();\r
+ if (archList == null || archList.contains(arch)){\r
+ ppiList.add(((PPIsDocument.PPIs.Ppi) returns[i]).getPpiCName()); \r
+ }\r
+ \r
+ }\r
+ String[] ppiArray = new String[ppiList.size()];\r
+ for (int i = 0; i < ppiList.size(); i++) {\r
+ ppiArray[i] = ppiList.get(i);\r
+ }\r
+ return ppiArray;\r
}\r
\r
/**\r
- Retrieve Library instance information\r
+ * Retrieve PpiNotify for specified usage and arch\r
+ * \r
+ * @param arch\r
+ * PpiNotify arch usage PpiNotify usage\r
+ * \r
+ * \r
+ * @returns String[] if elements are found at the known xpath\r
+ * @returns String[0] if nothing is there\r
+ */\r
+ public static String[] getPpiArray(String arch, String usage) {\r
\r
- @param arch Architecture name\r
- @param usage Library instance usage\r
-\r
- @returns library instance name list if elements are found at the known xpath\r
- @returns null if nothing is there\r
- **/\r
- public static List<String> getLibraryInstance(String arch, String usage) {\r
String[] xPath;\r
- String archAttribute = "";\r
- String usageAttribute = "";\r
+ String usageXpath;\r
+ String archXpath;\r
\r
- if ((arch != null) || (!arch.equals(""))) {\r
- archAttribute = "[@ArchType='ALL' or @ArchType='" + arch + "']";\r
- }\r
- \r
- if ((usage != null) || (!usage.equals(""))) {\r
- // if no Usage attribute specified, default to ALWAYS_CONSUMED\r
- if (usage.equals(LibraryUsage.ALWAYS_CONSUMED.toString())) {\r
- usageAttribute = "[not(@Usage) or @Usage='" + usage + "']";\r
+ if (arch == null || arch.equals("")) {\r
+ return new String[0];\r
+ } else {\r
+ archXpath = "/Ppi";\r
+ if (usage != null && !usage.equals("")) {\r
+ usageXpath = "/Ppi[@Usage='" + arch + "']";\r
+ xPath = new String[] { archXpath, usageXpath };\r
} else {\r
- usageAttribute = "[@Usage='" + usage + "']";\r
+ return getProtocolNotifyArray(arch);\r
}\r
}\r
- \r
- xPath = new String[] {\r
- "/Library" + archAttribute, //usageAttribute,\r
- "/Library[not(@SupArchList) or @SupArchList='" + arch + "']",\r
- "/Arch" + archAttribute + "/Library" + usageAttribute\r
- };\r
\r
- XmlObject[] returns = get("Libraries", xPath);\r
- if (returns == null || returns.length == 0) {\r
- return null;\r
+ Object[] returns = get("PPIs", xPath);\r
+ if (returns == null) {\r
+ return new String[0];\r
}\r
- \r
- List<String> instances = new ArrayList<String>();\r
- for (int i = 0; i < returns.length; ++i) {\r
- if (returns[i] instanceof LibrariesDocument.Libraries.Library) {\r
- LibrariesDocument.Libraries.Library lib = (LibrariesDocument.Libraries.Library)returns[i];\r
- instances.add(lib.getStringValue());\r
- } else if (returns[i] instanceof LibrariesDocument.Libraries.Arch.Library) {\r
- LibrariesDocument.Libraries.Arch.Library lib = (LibrariesDocument.Libraries.Arch.Library)returns[i];\r
- instances.add(lib.getStringValue());\r
+\r
+ String[] ppiList = new String[returns.length];\r
+\r
+ for (int i = 0; i < returns.length; i++) {\r
+ ppiList[i] = ((PPIsDocument.PPIs.Ppi) returns[i]).getPpiCName();\r
+ }\r
+ return ppiList;\r
+ }\r
+\r
+ /**\r
+ * Retrieve GuidEntry information for specified usage\r
+ * \r
+ * @param arch\r
+ * GuidEntry arch\r
+ * \r
+ * @returns GuidEntry objects list if elements are found at the known xpath\r
+ * @returns null if nothing is there\r
+ */\r
+ public static String[] getGuidEntryArray(String arch) {\r
+ String[] xPath;\r
+\r
+ if (arch == null || arch.equals("")) {\r
+ xPath = new String[] { "/GuidCNames" };\r
+ } else {\r
+ xPath = new String[] { "/GuidCNames" };\r
+ }\r
+\r
+ Object[] returns = get("Guids", xPath);\r
+ if (returns == null) {\r
+ return new String[0];\r
+ }\r
+\r
+ List<String> guidList = new ArrayList<String>();\r
+ for (int i = 0; i < returns.length; i++) {\r
+ List<String> archList = ((GuidsDocument.Guids.GuidCNames) returns[i]).getSupArchList();\r
+ if (archList == null || archList.contains(arch)){\r
+ guidList.add(((GuidsDocument.Guids.GuidCNames) returns[i]).getGuidCName()); \r
}\r
+ \r
+ }\r
+ String[] guidArray = new String[guidList.size()];\r
+ for (int i = 0; i < guidList.size(); i++) {\r
+ guidArray[i] = guidList.get(i);\r
}\r
+ return guidArray;\r
\r
- return instances;\r
}\r
\r
- ///\r
- /// This method is used for retrieving the elements information which has \r
- /// CName sub-element\r
- ///\r
+ /**\r
+ * Retrieve GuidEntry information for specified usage\r
+ * \r
+ * @param arch\r
+ * GuidEntry arch usage GuidEntry usage\r
+ * \r
+ * @returns GuidEntry objects list if elements are found at the known xpath\r
+ * @returns null if nothing is there\r
+ */\r
+ public static String[] getGuidEntryArray(String arch, String usage) {\r
+ String[] xPath;\r
+ String archXpath;\r
+ String usageXpath;\r
+\r
+ if (arch == null || arch.equals("")) {\r
+ return new String[0];\r
+ } else {\r
+ archXpath = "/GuidEntry";\r
+ if (usage != null && !usage.equals("")) {\r
+ usageXpath = "/GuidEntry[@Usage='" + arch + "']";\r
+ xPath = new String[] { archXpath, usageXpath };\r
+ } else {\r
+ return getProtocolNotifyArray(arch);\r
+ }\r
+ }\r
+\r
+ Object[] returns = get("Guids", xPath);\r
+ if (returns == null) {\r
+ return new String[0];\r
+ }\r
+\r
+ String[] guidList = new String[returns.length];\r
+\r
+ for (int i = 0; i < returns.length; i++) {\r
+ guidList[i] = ((GuidsDocument.Guids.GuidCNames) returns[i]).getGuidCName();\r
+ }\r
+ return guidList;\r
+ }\r
+\r
+ /**\r
+ * Retrieve Library instance information\r
+ * \r
+ * @param arch\r
+ * Architecture name\r
+ * @param usage\r
+ * Library instance usage\r
+ * \r
+ * @returns library instance name list if elements are found at the known\r
+ * xpath\r
+ * @returns null if nothing is there\r
+ */\r
+ public static ModuleIdentification[] getLibraryInstance(String arch) {\r
+ String[] xPath;\r
+ String saGuid = null;\r
+ String saVersion = null;\r
+ String pkgGuid = null;\r
+ String pkgVersion = null;\r
+\r
+ if (arch == null || arch.equalsIgnoreCase("")) {\r
+ xPath = new String[] { "/Instance" };\r
+ } else {\r
+ //\r
+ // Since Schema don't have SupArchList now, so the follow Xpath is \r
+ // equal to "/Instance" and [not(@SupArchList) or @SupArchList= arch]\r
+ // don't have effect.\r
+ //\r
+ xPath = new String[] { "/Instance[not(@SupArchList) or @SupArchList='"\r
+ + arch + "']" };\r
+ }\r
+\r
+ Object[] returns = get("Libraries", xPath);\r
+ if (returns == null || returns.length == 0) {\r
+ return new ModuleIdentification[0];\r
+ }\r
+\r
+ ModuleIdentification[] saIdList = new ModuleIdentification[returns.length];\r
+ for (int i = 0; i < returns.length; i++) {\r
+ LibrariesDocument.Libraries.Instance library = (LibrariesDocument.Libraries.Instance) returns[i];\r
+ saGuid = library.getModuleGuid();\r
+ saVersion = library.getModuleVersion();\r
+\r
+ pkgGuid = library.getPackageGuid();\r
+ pkgVersion = library.getPackageVersion();\r
+\r
+ ModuleIdentification saId = new ModuleIdentification(null, saGuid,\r
+ saVersion);\r
+ PackageIdentification pkgId = new PackageIdentification(null,\r
+ pkgGuid, pkgVersion);\r
+ saId.setPackage(pkgId);\r
+\r
+ saIdList[i] = saId;\r
+\r
+ }\r
+ return saIdList;\r
+ }\r
+\r
+ // /\r
+ // / This method is used for retrieving the elements information which has\r
+ // / CName sub-element\r
+ // /\r
private static String[] getCNames(String from, String xPath[]) {\r
- XmlObject[] returns = get(from, xPath);\r
+ Object[] returns = get(from, xPath);\r
if (returns == null || returns.length == 0) {\r
return null;\r
}\r
- \r
+\r
String[] strings = new String[returns.length];\r
for (int i = 0; i < returns.length; ++i) {\r
- strings[i] = ((CName)returns[i]).getStringValue(); \r
+ // TBD\r
+ strings[i] = ((CNameType) returns[i]).getStringValue();\r
}\r
- \r
- return strings; \r
+\r
+ return strings;\r
}\r
- \r
- /**\r
- Retrive library's constructor name\r
\r
- @returns constructor name list if elements are found at the known xpath\r
- @returns null if nothing is there\r
- **/\r
+ /**\r
+ * Retrive library's constructor name\r
+ * \r
+ * @returns constructor name list if elements are found at the known xpath\r
+ * @returns null if nothing is there\r
+ */\r
public static String getLibConstructorName() {\r
- String[] xPath = new String[] {"/Extern/Constructor"};\r
+ String[] xPath = new String[] { "/Extern/Constructor" };\r
\r
- XmlObject[] returns = get("Externs", xPath);\r
+ Object[] returns = get("Externs", xPath);\r
if (returns != null && returns.length > 0) {\r
- CName constructor = (CName)returns[0]; \r
- return constructor.getStringValue(); \r
+ CNameType constructor = ((CNameType) returns[0]);\r
+ return constructor.getStringValue();\r
}\r
\r
return null;\r
}\r
\r
/**\r
- Retrive library's destructor name\r
-\r
- @returns destructor name list if elements are found at the known xpath\r
- @returns null if nothing is there\r
- **/\r
+ * Retrive library's destructor name\r
+ * \r
+ * @returns destructor name list if elements are found at the known xpath\r
+ * @returns null if nothing is there\r
+ */\r
public static String getLibDestructorName() {\r
- String[] xPath = new String[] {"/Extern/Destructor"};\r
+ String[] xPath = new String[] { "/Extern/Destructor" };\r
\r
- XmlObject[] returns = get("Externs", xPath);\r
+ Object[] returns = get("Externs", xPath);\r
if (returns != null && returns.length > 0) {\r
- CName destructor = (CName)returns[0]; \r
- return destructor.getStringValue(); \r
+ //\r
+ // Only support one Destructor function.\r
+ //\r
+ CNameType destructor = (CNameType) returns[0];\r
+ return destructor.getStringValue();\r
}\r
\r
return null;\r
}\r
- \r
- /**\r
- Retrive DriverBinding names\r
\r
- @returns DriverBinding name list if elements are found at the known xpath\r
- @returns null if nothing is there\r
- **/\r
+ /**\r
+ * Retrive DriverBinding names\r
+ * \r
+ * @returns DriverBinding name list if elements are found at the known xpath\r
+ * @returns null if nothing is there\r
+ */\r
public static String[] getDriverBindingArray() {\r
- String[] xPath = new String[] {"/Extern/DriverBinding"};\r
+ String[] xPath = new String[] { "/Extern/DriverBinding" };\r
return getCNames("Externs", xPath);\r
}\r
- \r
- /**\r
- Retrive ComponentName names\r
\r
- @returns ComponentName name list if elements are found at the known xpath\r
- @returns null if nothing is there\r
- **/\r
+ /**\r
+ * Retrive ComponentName names\r
+ * \r
+ * @returns ComponentName name list if elements are found at the known xpath\r
+ * @returns null if nothing is there\r
+ */\r
public static String[] getComponentNameArray() {\r
- String[] xPath = new String[] {"/Extern/ComponentName"};\r
+ String[] xPath = new String[] { "/Extern/ComponentName" };\r
return getCNames("Externs", xPath);\r
}\r
- \r
- /**\r
- Retrive DriverConfig names\r
\r
- @returns DriverConfig name list if elements are found at the known xpath\r
- @returns null if nothing is there\r
- **/\r
+ /**\r
+ * Retrive DriverConfig names\r
+ * \r
+ * @returns DriverConfig name list if elements are found at the known xpath\r
+ * @returns null if nothing is there\r
+ */\r
public static String[] getDriverConfigArray() {\r
- String[] xPath = new String[] {"/Extern/DriverConfig"};\r
+ String[] xPath = new String[] { "/Extern/DriverConfig" };\r
return getCNames("Externs", xPath);\r
}\r
- \r
- /**\r
- Retrive DriverDiag names\r
\r
- @returns DriverDiag name list if elements are found at the known xpath\r
- @returns null if nothing is there\r
- **/\r
+ /**\r
+ * Retrive DriverDiag names\r
+ * \r
+ * @returns DriverDiag name list if elements are found at the known xpath\r
+ * @returns null if nothing is there\r
+ */\r
public static String[] getDriverDiagArray() {\r
- String[] xPath = new String[] {"/Extern/DriverDiag"};\r
+ String[] xPath = new String[] { "/Extern/DriverDiag" };\r
return getCNames("Externs", xPath);\r
}\r
\r
/**\r
- Retrive SetVirtualAddressMapCallBack names\r
-\r
- @returns SetVirtualAddressMapCallBack name list \r
- if elements are found at the known xpath\r
- @returns null if nothing is there\r
- **/\r
+ * Retrive SetVirtualAddressMapCallBack names\r
+ * \r
+ * @returns SetVirtualAddressMapCallBack name list if elements are found at\r
+ * the known xpath\r
+ * @returns null if nothing is there\r
+ */\r
public static String[] getSetVirtualAddressMapCallBackArray() {\r
- String[] xPath = new String[] {"/Extern/SetVirtualAddressMapCallBack"};\r
+ String[] xPath = new String[] { "/Extern/SetVirtualAddressMapCallBack" };\r
return getCNames("Externs", xPath);\r
}\r
- \r
- /**\r
- Retrive ExitBootServicesCallBack names\r
\r
- @returns ExitBootServicesCallBack name list \r
- if elements are found at the known xpath\r
- @returns null if nothing is there\r
- **/\r
+ /**\r
+ * Retrive ExitBootServicesCallBack names\r
+ * \r
+ * @returns ExitBootServicesCallBack name list if elements are found at the\r
+ * known xpath\r
+ * @returns null if nothing is there\r
+ */\r
public static String[] getExitBootServicesCallBackArray() {\r
- String[] xPath = new String[] {"/Extern/ExitBootServicesCallBack"};\r
+ String[] xPath = new String[] { "/Extern/ExitBootServicesCallBack" };\r
return getCNames("Externs", xPath);\r
}\r
\r
/**\r
- Retrieve module surface area file information\r
-\r
- @returns ModuleSA objects list if elements are found at the known xpath\r
- @returns Empty ModuleSA list if nothing is there\r
- **/\r
- public static ModuleSADocument.ModuleSA[] getFpdModules() {\r
- String[] xPath = new String[] { "/TianoImage/*/ModuleSA" };\r
+ * Retrieve module surface area file information\r
+ * \r
+ * @returns ModuleSA objects list if elements are found at the known xpath\r
+ * @returns Empty ModuleSA list if nothing is there\r
+ */\r
+ public static Map<FpdModuleIdentification, Map<String, XmlObject>> getFpdModules() {\r
+ String[] xPath = new String[] { "/FrameworkModules/ModuleSA" };\r
+ Object[] result = get("PlatformSurfaceArea", xPath);\r
+ String arch = null;\r
+ String fvBinding = null;\r
+ String saGuid = null;\r
+ String saVersion = null;\r
+ String pkgGuid = null;\r
+ String pkgVersion = null;\r
+\r
+ Map<FpdModuleIdentification, Map<String, XmlObject>> fpdModuleMap = new LinkedHashMap<FpdModuleIdentification, Map<String, XmlObject>>();\r
\r
- XmlObject[] result = get("FrameworkPlatformDescription", xPath);\r
if (result == null) {\r
- xPath = new String[] { "/FrameworkModules/*/ModuleSA" };\r
- result = get("FrameworkPlatformDescription", xPath);\r
- if (result != null) {\r
- return (ModuleSADocument.ModuleSA[]) result;\r
- }\r
- return new ModuleSADocument.ModuleSA[0];\r
+ return fpdModuleMap;\r
}\r
\r
- return (ModuleSADocument.ModuleSA[]) result;\r
+ for (int i = 0; i < result.length; i++) {\r
+ //\r
+ // Get Fpd SA Module element node and add to ObjectMap.\r
+ //\r
+ Map<String, XmlObject> ObjectMap = new HashMap<String, XmlObject>();\r
+ ModuleSADocument.ModuleSA moduleSA = (ModuleSADocument.ModuleSA) result[i];\r
+ if (((ModuleSADocument.ModuleSA) result[i]).getLibraries() != null) {\r
+ ObjectMap.put("Libraries", moduleSA.getLibraries());\r
+ }\r
+ if (((ModuleSADocument.ModuleSA) result[i]).getPcdBuildDefinition() != null) {\r
+ ObjectMap.put("PcdBuildDefinition", moduleSA\r
+ .getPcdBuildDefinition());\r
+ }\r
+ if (((ModuleSADocument.ModuleSA) result[i])\r
+ .getModuleSaBuildOptions() != null) {\r
+ ObjectMap.put("ModuleSaBuildOptions", moduleSA\r
+ .getModuleSaBuildOptions());\r
+ }\r
+\r
+ //\r
+ // Get Fpd SA Module attribute and create FpdMoudleIdentification.\r
+ //\r
+ arch = moduleSA.getSupArchList().toString();\r
+\r
+ // TBD\r
+ fvBinding = null;\r
+ saVersion = ((ModuleSADocument.ModuleSA) result[i])\r
+ .getModuleVersion();\r
+\r
+ saGuid = moduleSA.getModuleGuid();\r
+ pkgGuid = moduleSA.getPackageGuid();\r
+ pkgVersion = moduleSA.getPackageVersion();\r
+\r
+ //\r
+ // Create Module Identification which have class member of package\r
+ // identification.\r
+ //\r
+ PackageIdentification pkgId = new PackageIdentification(null,\r
+ pkgGuid, pkgVersion);\r
+ ModuleIdentification saId = new ModuleIdentification(null, saGuid,\r
+ saVersion);\r
+\r
+ saId.setPackage(pkgId);\r
+\r
+ //\r
+ // Create FpdModule Identification which have class member of module\r
+ // identification\r
+ //\r
+ if (arch != null) {\r
+ String[] archList = arch.split(" ");\r
+ for (int j = 0; j < archList.length; j++) {\r
+ FpdModuleIdentification fpdSaId = new FpdModuleIdentification(saId, archList[j]);\r
+ \r
+ if (fvBinding != null) {\r
+ fpdSaId.setFvBinding(fvBinding);\r
+ }\r
+ \r
+ //\r
+ // Put element to Map<FpdModuleIdentification, Map<String,\r
+ // Object>>.\r
+ //\r
+ fpdModuleMap.put(fpdSaId, ObjectMap);\r
+ }\r
+ }\r
+ }\r
+ return fpdModuleMap;\r
}\r
\r
/**\r
- Retrieve variables for FV images\r
-\r
- @returns name/value list if elements are found at the known xpath\r
- @returns empty list if nothing is there\r
- **/\r
- public static String[][] getFpdGlobalVariable() {\r
- String[] xPath = new String[] { "/Flash/FvImages/NameValue" };\r
-\r
- XmlObject[] queryResult = get("FrameworkPlatformDescription", xPath);\r
+ * Retrieve valid image names\r
+ * \r
+ * @returns valid iamges name list if elements are found at the known xpath\r
+ * @returns empty list if nothing is there\r
+ */\r
+ public static String[] getFpdValidImageNames() {\r
+ String[] xPath = new String[] { "/Flash/FvImages/FvImage[@Type='ImageName']/FvImageNames" };\r
+\r
+ Object[] queryResult = get("PlatformSurfaceArea", xPath);\r
if (queryResult == null) {\r
- return new String[0][];\r
+ return new String[0];\r
}\r
\r
- String[][] result = new String[queryResult.length][2];\r
- for (int i = 0; i < queryResult.length; i++){\r
- result[i][0] = ((NameValueDocument.NameValue)queryResult[i]).getName();\r
- result[i][1] = ((NameValueDocument.NameValue)queryResult[i]).getValue();\r
+ String[] result = new String[queryResult.length];\r
+ for (int i = 0; i < queryResult.length; i++) {\r
+ result[i] = ((XmlString) queryResult[i]).getStringValue();\r
}\r
\r
return result;\r
}\r
\r
+ public static XmlObject getFpdUserExtension() {\r
+ String[] xPath = new String[] { "" };\r
+\r
+ Object[] queryResult = get("PlatformSurfaceArea", xPath);\r
+ if (queryResult == null) {\r
+ return null;\r
+ }\r
+ return null;\r
+ }\r
+\r
/**\r
- Retrieve valid image names\r
+ * Retrieve FV image option information\r
+ * \r
+ * @param fvName\r
+ * FV image name\r
+ * \r
+ * @returns option name/value list if elements are found at the known xpath\r
+ * @returns empty list if nothing is there\r
+ */\r
+ public static String[][] getFpdOptions(String fvName) {\r
+ String[] xPath = new String[] { "/Flash/FvImages/FvImage[@Type='Options' and ./FvImageNames='"\r
+ + fvName.toUpperCase() + "']/FvImageOptions" };\r
+ Object[] queryResult = get("PlatformSurfaceArea", xPath);\r
+ if (queryResult == null) {\r
+ return new String[0][];\r
+ }\r
+ ArrayList<String[]> list = new ArrayList<String[]>();\r
+ for (int i = 0; i < queryResult.length; i++) {\r
+ FvImagesDocument.FvImages.FvImage.FvImageOptions item = (FvImagesDocument.FvImages.FvImage.FvImageOptions) queryResult[i];\r
+ List<FvImagesDocument.FvImages.FvImage.FvImageOptions.NameValue> namevalues = item\r
+ .getNameValueList();\r
+ Iterator iter = namevalues.iterator();\r
+ while (iter.hasNext()) {\r
+ FvImagesDocument.FvImages.FvImage.FvImageOptions.NameValue nvItem = (FvImagesDocument.FvImages.FvImage.FvImageOptions.NameValue) iter\r
+ .next();\r
+ list.add(new String[] { nvItem.getName(), nvItem.getValue() });\r
+ }\r
+ }\r
+ String[][] result = new String[list.size()][2];\r
+ for (int i = 0; i < list.size(); i++) {\r
+ result[i][0] = list.get(i)[0];\r
+ result[i][1] = list.get(i)[1];\r
+ }\r
+ return result;\r
\r
- @returns valid iamges name list if elements are found at the known xpath\r
- @returns empty list if nothing is there\r
- **/\r
- public static String[] getFpdValidImageNames(){\r
- String[] xPath = new String[] { "/Flash/FvImages/FvImage[@Type='ValidImageNames']/FvImageNames" };\r
+ }\r
\r
- XmlObject[] queryResult = get("FrameworkPlatformDescription", xPath);\r
- if (queryResult == null) {\r
- return new String[0];\r
+ public static XmlObject getFpdBuildOptions() {\r
+ String[] xPath = new String[] { "/BuildOptions" };\r
+\r
+ Object[] queryResult = get("PlatformSurfaceArea", xPath);\r
+\r
+ if (queryResult == null || queryResult.length == 0) {\r
+ return null;\r
}\r
+ return (XmlObject)queryResult[0];\r
+ }\r
\r
- String[] result = new String[queryResult.length];\r
- for (int i = 0; i < queryResult.length; i++){\r
- result[i] = ((XmlString)queryResult[i]).getStringValue();\r
+ public static PlatformIdentification getFpdHeader() {\r
+ String[] xPath = new String[] { "/PlatformHeader" };\r
+\r
+ Object[] returns = get("PlatformSurfaceArea", xPath);\r
+\r
+ if (returns == null || returns.length == 0) {\r
+ return null;\r
}\r
+ PlatformHeaderDocument.PlatformHeader header = (PlatformHeaderDocument.PlatformHeader) returns[0];\r
\r
- return result;\r
+ String name = header.getPlatformName();\r
+\r
+ String guid = header.getGuidValue();\r
+\r
+ String version = header.getVersion();\r
+\r
+ return new PlatformIdentification(name, guid, version);\r
}\r
\r
/**\r
- Retrieve FV image option information\r
+ * Retrieve FV image attributes information\r
+ * \r
+ * @param fvName\r
+ * FV image name\r
+ * \r
+ * @returns attribute name/value list if elements are found at the known\r
+ * xpath\r
+ * @returns empty list if nothing is there\r
+ */\r
+ public static String[][] getFpdAttributes(String fvName) {\r
+ String[] xPath = new String[] { "/Flash/FvImages/FvImage[@Type='Attributes' and ./FvImageNames='"\r
+ + fvName.toUpperCase() + "']/FvImageOptions" };\r
+ Object[] queryResult = get("PlatformSurfaceArea", xPath);\r
+ if (queryResult == null) {\r
+ return new String[0][];\r
+ }\r
+ ArrayList<String[]> list = new ArrayList<String[]>();\r
+ for (int i = 0; i < queryResult.length; i++) {\r
+ \r
+ FvImagesDocument.FvImages.FvImage.FvImageOptions item = (FvImagesDocument.FvImages.FvImage.FvImageOptions) queryResult[i];\r
+ List<FvImagesDocument.FvImages.FvImage.FvImageOptions.NameValue> namevalues = item.getNameValueList();\r
+ Iterator iter = namevalues.iterator();\r
+ while (iter.hasNext()) {\r
+ FvImagesDocument.FvImages.FvImage.FvImageOptions.NameValue nvItem = (FvImagesDocument.FvImages.FvImage.FvImageOptions.NameValue) iter\r
+ .next();\r
+ list.add(new String[] { nvItem.getName(), nvItem.getValue() });\r
+ }\r
+ }\r
+ String[][] result = new String[list.size()][2];\r
+ for (int i = 0; i < list.size(); i++) {\r
+ result[i][0] = list.get(i)[0];\r
+ result[i][1] = list.get(i)[1];\r
+ }\r
+ return result;\r
+ }\r
\r
- @param fvName FV image name\r
+ /**\r
+ * Retrieve flash definition file name\r
+ * \r
+ * @returns file name if elements are found at the known xpath\r
+ * @returns null if nothing is there\r
+ */\r
+ public static String getFlashDefinitionFile() {\r
+ String[] xPath = new String[] { "/PlatformDefinitions/FlashDeviceDefinitions/FlashDefinitionFile" };\r
+\r
+ Object[] queryResult = get("PlatformSurfaceArea", xPath);\r
+ if (queryResult == null || queryResult.length == 0) {\r
+ return null;\r
+ }\r
\r
- @returns option name/value list if elements are found at the known xpath\r
- @returns empty list if nothing is there\r
- **/\r
- public static String[][] getFpdOptions(String fvName){\r
- String[] xPath = new String[] {"/Flash/FvImages/FvImageName[@Name='" + fvName.toUpperCase() + "']/FvImageOptions/NameValue" };\r
+ FileNameConvention filename = (FileNameConvention) queryResult[queryResult.length - 1];\r
+ return filename.getStringValue();\r
+ }\r
\r
- XmlObject[] queryResult = get("FrameworkPlatformDescription", xPath);\r
+ public static String[][] getFpdGlobalVariable() {\r
+ String[] xPath = new String[] { "/Flash/FvImages/NameValue" };\r
+ Object[] queryResult = get("PlatformSurfaceArea", xPath);\r
if (queryResult == null) {\r
return new String[0][];\r
}\r
\r
String[][] result = new String[queryResult.length][2];\r
- for (int i = 0; i < queryResult.length; i++){\r
- result[i][0] = ((NameValueDocument.NameValue)queryResult[i]).getName();\r
- result[i][1] = ((NameValueDocument.NameValue)queryResult[i]).getValue();\r
+ \r
+ for (int i = 0; i < queryResult.length; i++) {\r
+ FvImagesDocument.FvImages.NameValue item = (FvImagesDocument.FvImages.NameValue)queryResult[i];\r
+ result[i][0] = item.getName();\r
+ result[i][1] = item.getValue();\r
}\r
-\r
- return result;\r
+ return result; \r
}\r
\r
/**\r
- Retrieve FV image attributes information\r
-\r
- @param fvName FV image name\r
-\r
- @returns attribute name/value list if elements are found at the known xpath\r
- @returns empty list if nothing is there\r
- **/\r
- public static String[][] getFpdAttributes(String fvName){\r
- String[] xPath = new String[] {"/Flash/FvImages/FvImage[@Type='Attributes' and ./FvImageNames='" + fvName.toUpperCase() + "']/FvImageOptions" };\r
-\r
- XmlObject[] queryResult = get("FrameworkPlatformDescription", xPath);\r
+ * Retrieve FV image component options\r
+ * \r
+ * @param fvName\r
+ * FV image name\r
+ * \r
+ * @returns name/value pairs list if elements are found at the known xpath\r
+ * @returns empty list if nothing is there\r
+ */\r
+ public static String[][] getFpdComponents(String fvName) {\r
+ String[] xPath = new String[] { "/Flash/FvImages/FvImage[@Type='Components' and ./FvImageNames='"+ fvName.toUpperCase() + "']/FvImageOptions" };\r
+ Object[] queryResult = get("PlatformSurfaceArea", xPath);\r
if (queryResult == null) {\r
return new String[0][];\r
}\r
\r
ArrayList<String[]> list = new ArrayList<String[]>();\r
- for (int i = 0 ; i < queryResult.length; i++){\r
- FvImageOptionsDocument.FvImageOptions item = (FvImageOptionsDocument.FvImageOptions)queryResult[i];\r
+ for (int i = 0; i < queryResult.length; i++) {\r
+ FvImagesDocument.FvImages.FvImage.FvImageOptions item = (FvImagesDocument.FvImages.FvImage.FvImageOptions) queryResult[i];\r
+ List<FvImagesDocument.FvImages.FvImage.FvImageOptions.NameValue> namevalues = item.getNameValueList();\r
+ Iterator iter = namevalues.iterator();\r
+ while (iter.hasNext()) {\r
+ FvImagesDocument.FvImages.FvImage.FvImageOptions.NameValue nvItem = (FvImagesDocument.FvImages.FvImage.FvImageOptions.NameValue) iter\r
+ .next();\r
+ list.add(new String[] { nvItem.getName(), nvItem.getValue() });\r
+ }\r
+ }\r
+ String[][] result = new String[list.size()][2];\r
+ for (int i = 0; i < list.size(); i++) {\r
+ result[i][0] = list.get(i)[0];\r
+ result[i][1] = list.get(i)[1];\r
+ }\r
+ return result; \r
+ }\r
\r
- List<NameValueDocument.NameValue> namevalues = item.getNameValueList();\r
- Iterator iter = namevalues.iterator();\r
- while (iter.hasNext()) {\r
- NameValueDocument.NameValue nvItem = (NameValueDocument.NameValue)iter.next();\r
- list.add(new String[]{nvItem.getName(), nvItem.getValue()});\r
- }\r
+ /**\r
+ * Retrieve PCD tokens\r
+ * \r
+ * @returns CName/ItemType pairs list if elements are found at the known\r
+ * xpath\r
+ * @returns null if nothing is there\r
+ */\r
+ public static String[][] getPcdTokenArray() {\r
+ String[] xPath = new String[] { "/PcdData" };\r
+\r
+ Object[] returns = get("PCDs", xPath);\r
+ if (returns == null || returns.length == 0) {\r
+ return null;\r
+ }\r
\r
- List<String> enables = item.getEnableList();\r
- iter = enables.iterator();\r
- while (iter.hasNext()) {\r
- String enableItem = (String)iter.next();\r
- list.add(new String[]{enableItem, "TRUE"});\r
- }\r
+ // PcdCoded.PcdData[] pcds = (PcdCoded.PcdData[]) returns;\r
+ // String[][] result = new String[pcds.length][2];\r
+ // for (int i = 0; i < returns.length; ++i) {\r
+ // if (pcds[i].getItemType() != null) {\r
+ // result[i][1] = pcds[i].getItemType().toString();\r
+ // } else {\r
+ // result[i][1] = null;\r
+ // }\r
+ // result[i][0] = pcds[i].getCName();\r
+ // }\r
\r
- List<String> disables = item.getDisableList();\r
- iter = disables.iterator();\r
- while (iter.hasNext()) {\r
- String disableItem = (String)iter.next();\r
- list.add(new String[]{disableItem, "FALSE"});\r
- }\r
+ return null;\r
+ }\r
+\r
+ /**\r
+ * Get the PcdToken array from module's surface area document. The array\r
+ * should contains following data:\r
+ * <p>\r
+ * -------------------------------------------------------------------\r
+ * </p>\r
+ * <p>\r
+ * CName | ItemType | TokenspaceName | DefaultValue | Usage | HelpText\r
+ * </p>\r
+ * <p>\r
+ * -------------------------------------------------------------------\r
+ * </p>\r
+ * <p>\r
+ * Note: Until new schema applying, now we can only get CName, ItemType,\r
+ * </p>\r
+ * \r
+ * @return 2-array table contains all information of PCD token retrieved\r
+ * from MSA.\r
+ */\r
+ public static Object[][] etModulePCDTokenArray() {\r
+ return null;\r
+ // int index;\r
+ // Object[][] result;\r
+ // PCDs.PcdData[] pcds;\r
+ // String[] xPath = new String[] { "/PcdData" };\r
+ // Object[] returns = get("PCDs", xPath);\r
+ //\r
+ // if ((returns == null) || (returns.length == 0)) {\r
+ // return null;\r
+ // }\r
+ //\r
+ // pcds = (PCDs.PcdData[]) returns;\r
+ // result = new Object[pcds.length][6];\r
+ // for (index = 0; index < pcds.length; index++) {\r
+ // //\r
+ // // Get CName\r
+ // //\r
+ // result[index][0] = pcds[index].getCName();\r
+ // //\r
+ // // Get ItemType: FEATURE_FLAG, FIXED_AT_BUILD, PATCHABLE_IN_MODLE,\r
+ // // DYNAMIC, DYNAMIC_EX\r
+ // //\r
+ // if (pcds[index].getItemType() != null) {\r
+ // result[index][1] = pcds[index].getItemType().toString();\r
+ // } else {\r
+ // result[index][1] = null;\r
+ // }\r
+ //\r
+ // //\r
+ // // BUGBUG: following field can *not* be got from current MSA until\r
+ // // schema changed.\r
+ // //\r
+ // // result [index][2] = pcds[index].getTokenSpaceName();\r
+ // result[index][2] = null;\r
+ // result[index][3] = pcds[index].getDefaultValue();\r
+ // // result [index][4] = pcds[index].getUsage ();\r
+ // result[index][4] = null;\r
+ // // result [index][5] = pcds[index].getHelpText ();\r
+ // result[index][5] = null;\r
+ // }\r
+ // return result;\r
+ }\r
+\r
+ /**\r
+ * Retrieve MAS header\r
+ * \r
+ * @return\r
+ * @return\r
+ */\r
+ public static ModuleIdentification getMsaHeader() {\r
+ String[] xPath = new String[] { "/" };\r
+ Object[] returns = get("MsaHeader", xPath);\r
+\r
+ if (returns == null || returns.length == 0) {\r
+ return null;\r
}\r
\r
- String[][] result = new String[list.size()][2];\r
- for (int i = 0; i < list.size(); i++){\r
- result[i][0] = list.get(i)[0];\r
- result[i][1] = list.get(i)[1];\r
+ MsaHeader msaHeader = (MsaHeader) returns[0];\r
+ //\r
+ // Get BaseName, ModuleType, GuidValue, Version\r
+ // which in MsaHeader.\r
+ //\r
+ String name = msaHeader.getModuleName();\r
+ String moduleType = msaHeader.getModuleType().toString();\r
+ String guid = msaHeader.getGuidValue();\r
+ String version = msaHeader.getVersion();\r
+\r
+ ModuleIdentification moduleId = new ModuleIdentification(name, guid,\r
+ version);\r
+\r
+ moduleId.setModuleType(moduleType);\r
+\r
+ return moduleId;\r
+ }\r
+\r
+ /**\r
+ * Retrieve Extern Specification\r
+ * \r
+ * @param\r
+ * \r
+ * @return String[] If have specification element in the <extern> String[0]\r
+ * If no specification element in the <extern>\r
+ * \r
+ */\r
+\r
+ public static String[] getExternSpecificaiton() {\r
+ String[] xPath = new String[] { "/Specification" };\r
+\r
+ Object[] queryResult = get("Externs", xPath);\r
+ if (queryResult == null) {\r
+ return new String[0];\r
}\r
\r
- return result;\r
+ String[] specificationList = new String[queryResult.length];\r
+ for (int i = 0; i < queryResult.length; i++) {\r
+ specificationList[i] = ((Sentence)queryResult[i])\r
+ .getStringValue();\r
+ }\r
+ return specificationList;\r
}\r
- \r
+\r
/**\r
- Retrieve flash definition file name\r
+ * Retreive MsaFile which in SPD\r
+ * \r
+ * @param\r
+ * @return String[][3] The string sequence is ModuleName, ModuleGuid,\r
+ * ModuleVersion, MsaFile String[0][] If no msafile in SPD\r
+ */\r
+ public static String[] getSpdMsaFile() {\r
+ String[] xPath = new String[] { "/MsaFiles" };\r
+\r
+ Object[] returns = get("PackageSurfaceArea", xPath);\r
+ if (returns == null) {\r
+ return new String[0];\r
+ }\r
\r
- @returns file name if elements are found at the known xpath\r
- @returns null if nothing is there\r
- **/\r
- public static String getFlashDefinitionFile(){\r
- String[] xPath = new String[] {"/Flash/FlashDefinitionFile" };\r
+ List<String> filenameList = ((MsaFilesDocument.MsaFiles) returns[0])\r
+ .getFilenameList();\r
+ return filenameList.toArray(new String[filenameList.size()]);\r
+ }\r
\r
- XmlObject[] queryResult = get("FrameworkPlatformDescription", xPath);\r
- if (queryResult == null || queryResult.length == 0) {\r
- return null;\r
+ /**\r
+ * Reteive\r
+ */\r
+ public static Map<String, String[]> getSpdLibraryClasses() {\r
+ String[] xPath = new String[] { "/LibraryClassDeclarations/LibraryClass" };\r
+\r
+ Object[] returns = get("PackageSurfaceArea", xPath);\r
+\r
+ //\r
+ // Create Map, Key - LibraryClass, String[] - LibraryClass Header file.\r
+ //\r
+ Map<String, String[]> libClassHeaderMap = new HashMap<String, String[]>();\r
+\r
+ if (returns == null) {\r
+ return libClassHeaderMap;\r
}\r
\r
- FileNameConvention filename = (FileNameConvention)queryResult[queryResult.length - 1];\r
- return filename.getStringValue();\r
+ for (int i = 0; i < returns.length; i++) {\r
+ LibraryClassDeclarationsDocument.LibraryClassDeclarations.LibraryClass library = (LibraryClassDeclarationsDocument.LibraryClassDeclarations.LibraryClass) returns[i];\r
+ libClassHeaderMap.put(library.getName(), new String[] { library\r
+ .getIncludeHeader() });\r
+ }\r
+ return libClassHeaderMap;\r
}\r
- \r
+\r
/**\r
- Retrieve FV image component options\r
+ * Reteive\r
+ */\r
+ public static Map<String, String> getSpdPackageHeaderFiles() {\r
+ String[] xPath = new String[] { "/PackageHeaders/IncludePkgHeader" };\r
\r
- @param fvName FV image name\r
+ Object[] returns = get("PackageSurfaceArea", xPath);\r
\r
- @returns name/value pairs list if elements are found at the known xpath\r
- @returns empty list if nothing is there\r
- **/\r
- public static String[][] getFpdComponents(String fvName){\r
- String[] xPath = new String[] {"/Flash/FvImages/FvImage[@Type='Components' and ./FvImageNames='" + fvName.toUpperCase() + "']/FvImageOptions" };\r
+ //\r
+ // Create Map, Key - ModuleType, String - PackageInclude Header file.\r
+ //\r
+ Map<String, String> packageIncludeMap = new HashMap<String, String>();\r
\r
- XmlObject[] queryResult = get("FrameworkPlatformDescription", xPath);\r
- if (queryResult == null) {\r
- return new String[0][];\r
+ if (returns == null) {\r
+ return packageIncludeMap;\r
+ }\r
+// GlobalData.log.info("" + returns[0].getClass().getName());\r
+ for (int i = 0; i < returns.length; i++) {\r
+ PackageHeadersDocument.PackageHeaders.IncludePkgHeader includeHeader = (PackageHeadersDocument.PackageHeaders.IncludePkgHeader) returns[i];\r
+ packageIncludeMap.put(includeHeader.getModuleType().toString(),\r
+ includeHeader.getStringValue());\r
}\r
+ return packageIncludeMap;\r
+ }\r
\r
- ArrayList<String[]> list = new ArrayList<String[]>();\r
- for (int i = 0 ; i < queryResult.length; i++){\r
- FvImageOptionsDocument.FvImageOptions item = (FvImageOptionsDocument.FvImageOptions)queryResult[i];\r
+ public static PackageIdentification getSpdHeader() {\r
+ String[] xPath = new String[] { "/SpdHeader" };\r
\r
- List<NameValueDocument.NameValue> namevalues = item.getNameValueList();\r
- Iterator iter = namevalues.iterator();\r
- while (iter.hasNext()) {\r
- NameValueDocument.NameValue nvItem = (NameValueDocument.NameValue)iter.next();\r
- list.add(new String[]{nvItem.getName(), nvItem.getValue()});\r
- }\r
+ Object[] returns = get("PackageSurfaceArea", xPath);\r
\r
- List<String> enables = item.getEnableList();\r
- iter = enables.iterator();\r
- while (iter.hasNext()) {\r
- String enableItem = (String)iter.next();\r
- list.add(new String[]{enableItem, "TRUE"});\r
- }\r
+ if (returns == null || returns.length == 0) {\r
+ return null;\r
+ }\r
\r
- List<String> disables = item.getDisableList();\r
- iter = disables.iterator();\r
- while (iter.hasNext()) {\r
- String disableItem = (String)iter.next();\r
- list.add(new String[]{disableItem, "FALSE"});\r
- }\r
+ SpdHeaderDocument.SpdHeader header = (SpdHeaderDocument.SpdHeader) returns[0];\r
+\r
+ String name = header.getPackageName();\r
+\r
+ String guid = header.getGuidValue();\r
+\r
+ String version = header.getVersion();\r
+\r
+ return new PackageIdentification(name, guid, version);\r
+ }\r
+\r
+ /**\r
+ * Reteive\r
+ */\r
+ public static Map<String, String[]> getSpdGuid() {\r
+ String[] xPath = new String[] { "/GuidDeclarations/Entry" };\r
+\r
+ Object[] returns = get("PackageSurfaceArea", xPath);\r
+\r
+ //\r
+ // Create Map, Key - GuidName, String[] - C_NAME & GUID value.\r
+ //\r
+ Map<String, String[]> guidDeclMap = new HashMap<String, String[]>();\r
+ if (returns == null) {\r
+ return guidDeclMap;\r
}\r
\r
- String[][] result = new String[list.size()][2];\r
- for (int i = 0; i < list.size(); i++){\r
- result[i][0] = list.get(i)[0];\r
- result[i][1] = list.get(i)[1];\r
+ for (int i = 0; i < returns.length; i++) {\r
+ GuidDeclarationsDocument.GuidDeclarations.Entry entry = (GuidDeclarationsDocument.GuidDeclarations.Entry) returns[i];\r
+ String[] guidPair = new String[2];\r
+ guidPair[0] = entry.getCName();\r
+ guidPair[1] = entry.getGuidValue();\r
+ guidDeclMap.put(entry.getName(), guidPair);\r
+ EdkLog.log(EdkLog.EDK_VERBOSE, entry.getName());\r
+ EdkLog.log(EdkLog.EDK_VERBOSE, guidPair[0]);\r
+ EdkLog.log(EdkLog.EDK_VERBOSE, guidPair[1]);\r
}\r
+ return guidDeclMap;\r
+ }\r
\r
- return result;\r
+ /**\r
+ * Reteive\r
+ */\r
+ public static Map<String, String[]> getSpdProtocol() {\r
+ String[] xPath = new String[] { "/ProtocolDeclarations/Entry" };\r
+\r
+ Object[] returns = get("PackageSurfaceArea", xPath);\r
+\r
+ //\r
+ // Create Map, Key - protocolName, String[] - C_NAME & GUID value.\r
+ //\r
+ Map<String, String[]> protoclMap = new HashMap<String, String[]>();\r
+\r
+ if (returns == null) {\r
+ return protoclMap;\r
+ }\r
+\r
+ for (int i = 0; i < returns.length; i++) {\r
+ ProtocolDeclarationsDocument.ProtocolDeclarations.Entry entry = (ProtocolDeclarationsDocument.ProtocolDeclarations.Entry) returns[i];\r
+ String[] protocolPair = new String[2];\r
+\r
+ protocolPair[0] = entry.getCName();\r
+ protocolPair[1] = entry.getGuidValue();\r
+ protoclMap.put(entry.getName(), protocolPair);\r
+ EdkLog.log(EdkLog.EDK_VERBOSE, entry.getName());\r
+ EdkLog.log(EdkLog.EDK_VERBOSE, protocolPair[0]);\r
+ EdkLog.log(EdkLog.EDK_VERBOSE, protocolPair[1]);\r
+ }\r
+ return protoclMap;\r
}\r
- \r
+\r
/**\r
- Get name array of PCD in a module. In one module, token space\r
- is same, and token name should not be conflicted.\r
- \r
- @return String[]\r
- **/\r
- public static String[] getModulePcdEntryNameArray() {\r
- PcdCoded.PcdEntry[] pcdEntries = null;\r
- String[] results;\r
- int index;\r
- String[] xPath = new String[] {"/PcdEntry"};\r
- XmlObject[] returns = get ("PcdCoded", xPath);\r
+ * getSpdPpi() Retrieve the SPD PPI Entry\r
+ * \r
+ * @param\r
+ * @return Map<String, String[2]> if get the PPI entry from SPD. Key - PPI\r
+ * Name String[0] - PPI CNAME String[1] - PPI Guid Null if no PPI\r
+ * entry in SPD.\r
+ */\r
+ public static Map<String, String[]> getSpdPpi() {\r
+ String[] xPath = new String[] { "/PpiDeclarations/Entry" };\r
+\r
+ Object[] returns = get("PackageSurfaceArea", xPath);\r
+\r
+ //\r
+ // Create Map, Key - protocolName, String[] - C_NAME & GUID value.\r
+ //\r
+ Map<String, String[]> ppiMap = new HashMap<String, String[]>();\r
+\r
if (returns == null) {\r
+ return ppiMap;\r
+ }\r
+\r
+ for (int i = 0; i < returns.length; i++) {\r
+ PpiDeclarationsDocument.PpiDeclarations.Entry entry = (PpiDeclarationsDocument.PpiDeclarations.Entry) returns[i];\r
+ String[] ppiPair = new String[2];\r
+ ppiPair[0] = entry.getCName();\r
+ ppiPair[1] = entry.getGuidValue();\r
+ ppiMap.put(entry.getName(), ppiPair);\r
+ }\r
+ return ppiMap;\r
+ }\r
+\r
+ /**\r
+ * getToolChainFamily\r
+ * \r
+ * This function is to retrieve ToolChainFamily attribute of FPD\r
+ * <BuildOptions>\r
+ * \r
+ * @param\r
+ * @return toolChainFamily If find toolChainFamily attribute in\r
+ * <BuildOptions> Null If don't have toolChainFamily in\r
+ * <BuildOptions>.\r
+ */\r
+ public String getToolChainFamily() {\r
+ String toolChainFamily;\r
+ String[] xPath = new String[] { "/BuildOptions" };\r
+\r
+ Object[] result = get("PlatformSurfaceArea", xPath);\r
+ if (result == null) {\r
return null;\r
}\r
+ // toolChainFamily =\r
+ // ((BuildOptionsDocument.BuildOptions)result[0]).getToolChainFamilies();\r
+ // return toolChainFamily;\r
+ return null;\r
+ }\r
\r
- pcdEntries = (PcdCoded.PcdEntry[])returns;\r
- results = new String[pcdEntries.length];\r
- \r
- for (index = 0; index < pcdEntries.length; index ++) {\r
- results[index] = pcdEntries[index].getCName();\r
+ /**\r
+ * Retrieve module Guid string\r
+ * \r
+ * @returns GUILD string if elements are found at the known xpath\r
+ * @returns null if nothing is there\r
+ */\r
+ public static String getModuleGuid() {\r
+ String[] xPath = new String[] { "" };\r
+\r
+ Object[] returns = get("MsaHeader", xPath);\r
+ if (returns != null && returns.length > 0) {\r
+ String guid = ((MsaHeaderDocument.MsaHeader) returns[0])\r
+ .getGuidValue();\r
+ return guid;\r
}\r
- return results;\r
+\r
+ return null;\r
}\r
+\r
+ //\r
+ // For new Pcd\r
+ //\r
+ public static ModuleSADocument.ModuleSA[] getFpdModuleSAs() {\r
+ String[] xPath = new String[] { "/FrameworkModules/ModuleSA" };\r
+ Object[] result = get("PlatformSurfaceArea", xPath);\r
+ if (result != null) {\r
+ return (ModuleSADocument.ModuleSA[]) result;\r
+ }\r
+ return new ModuleSADocument.ModuleSA[0];\r
+\r
+ }\r
+ /**\r
+ Get name array of PCD in a module. In one module, token space\r
+ is same, and token name should not be conflicted.\r
+ \r
+ @return String[]\r
+ **/\r
+ public static String[] getModulePcdEntryNameArray() {\r
+ PcdCodedDocument.PcdCoded.PcdEntry[] pcdEntries = null;\r
+ String[] results;\r
+ int index;\r
+ String[] xPath = new String[] {"/PcdEntry"};\r
+ Object[] returns = get ("PcdCoded", xPath);\r
+ \r
+ if (returns == null) {\r
+ return new String[0];\r
+ }\r
+ \r
+ pcdEntries = (PcdCodedDocument.PcdCoded.PcdEntry[])returns;\r
+ results = new String[pcdEntries.length];\r
+ \r
+ for (index = 0; index < pcdEntries.length; index ++) {\r
+ results[index] = pcdEntries[index].getCName();\r
+ }\r
+ return results;\r
+ }\r
}\r