]> git.proxmox.com Git - mirror_edk2.git/blame - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/global/SurfaceAreaQuery.java
1. adjust contents layout of SPD header editor, FPD header editor.
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / platform / ui / global / SurfaceAreaQuery.java
CommitLineData
a13899c5 1/** @file\r
2 This file is for surface area information retrieval.\r
3\r
4 Copyright (c) 2006, Intel Corporation\r
5 All rights reserved. This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13 **/\r
14package org.tianocore.frameworkwizard.platform.ui.global;\r
15\r
16import java.util.ArrayList;\r
17import java.util.HashMap;\r
18import java.util.Iterator;\r
19import java.util.LinkedHashMap;\r
20import java.util.List;\r
21import java.util.Map;\r
22import java.util.Set;\r
23import java.util.Stack;\r
24import java.util.regex.Matcher;\r
25import java.util.regex.Pattern;\r
26\r
27import org.apache.xmlbeans.XmlNormalizedString;\r
28import org.apache.xmlbeans.XmlObject;\r
29import org.apache.xmlbeans.XmlString;\r
a13899c5 30import org.tianocore.BuildTargetList;\r
31import org.tianocore.DataIdDocument;\r
32import org.tianocore.ExternsDocument;\r
33import org.tianocore.FileNameConvention;\r
a13899c5 34//import org.tianocore.FvImageDocument;\r
a13899c5 35import org.tianocore.GuidDeclarationsDocument;\r
a13899c5 36import org.tianocore.LibrariesDocument;\r
37import org.tianocore.LibraryClassDeclarationsDocument;\r
38import org.tianocore.LibraryClassDocument;\r
39import org.tianocore.ModuleSADocument;\r
40import org.tianocore.ModuleTypeDef;\r
41import org.tianocore.MsaFilesDocument;\r
42import org.tianocore.MsaHeaderDocument;\r
a13899c5 43import org.tianocore.PackageDependenciesDocument;\r
44import org.tianocore.PackageHeadersDocument;\r
a13899c5 45import org.tianocore.PpiDeclarationsDocument;\r
46import org.tianocore.ProtocolDeclarationsDocument;\r
47import org.tianocore.SpdHeaderDocument;\r
48import org.tianocore.FilenameDocument.Filename;\r
49import org.tianocore.MsaHeaderDocument.MsaHeader;\r
a13899c5 50import org.tianocore.PlatformHeaderDocument;\r
51import org.tianocore.frameworkwizard.platform.ui.id.FpdModuleIdentification;\r
52import org.tianocore.frameworkwizard.platform.ui.id.ModuleIdentification;\r
53import org.tianocore.frameworkwizard.platform.ui.id.PackageIdentification;\r
54import org.tianocore.frameworkwizard.platform.ui.id.PlatformIdentification;\r
55\r
56/**\r
57 * SurfaceAreaQuery class is used to query Surface Area information from msa,\r
58 * mbd, spd and fpd files.\r
59 * \r
60 * This class should not instantiated. All the public interfaces is static.\r
61 * \r
62 * @since GenBuild 1.0\r
63 */\r
64public class SurfaceAreaQuery {\r
65\r
66 public static String prefix = "http://www.TianoCore.org/2006/Edk2.0";\r
67\r
68 // /\r
69 // / Contains name/value pairs of Surface Area document object. The name is\r
70 // / always the top level element name.\r
71 // /\r
72 private static Map<String, XmlObject> map = null;\r
73\r
74 // /\r
75 // / mapStack is used to do nested query\r
76 // /\r
77 private static Stack<Map<String, XmlObject>> mapStack = new Stack<Map<String, XmlObject>>();\r
78\r
79 // /\r
80 // / prefix of name space\r
81 // /\r
82 private static String nsPrefix = "sans";\r
83\r
84 // /\r
85 // / xmlbeans needs a name space for each Xpath element\r
86 // /\r
87 private static String ns = null;\r
88\r
89 // /\r
90 // / keep the namep declaration for xmlbeans Xpath query\r
91 // /\r
92 private static String queryDeclaration = null;\r
93\r
94 /**\r
95 * Set a Surface Area document for query later\r
96 * \r
97 * @param map\r
98 * A Surface Area document in TopLevelElementName/XmlObject\r
99 * format.\r
100 */\r
101 public static void setDoc(Map<String, XmlObject> map) {\r
102 ns = prefix;\r
103 queryDeclaration = "declare namespace " + nsPrefix + "='" + ns + "'; ";\r
104 SurfaceAreaQuery.map = map;\r
105 }\r
106\r
107 /**\r
108 * Push current used Surface Area document into query stack. The given new\r
109 * document will be used for any immediately followed getXXX() callings,\r
110 * untill pop() is called.\r
111 * \r
112 * @param newMap\r
113 * The TopLevelElementName/XmlObject format of a Surface Area\r
114 * document.\r
115 */\r
116 public static void push(Map<String, XmlObject> newMap) {\r
117 mapStack.push(SurfaceAreaQuery.map);\r
118 SurfaceAreaQuery.map = newMap;\r
119 }\r
120\r
121 /**\r
122 * Discard current used Surface Area document and use the top document in\r
123 * stack instead.\r
124 */\r
125 public static void pop() {\r
126 SurfaceAreaQuery.map = mapStack.pop();\r
127 }\r
128\r
129 // /\r
130 // / Convert xPath to be namespace qualified, which is necessary for\r
131 // XmlBeans\r
132 // / selectPath(). For example, converting /MsaHeader/ModuleType to\r
133 // / /ns:MsaHeader/ns:ModuleType\r
134 // /\r
135 private static String normalizeQueryString(String[] exp, String from) {\r
136 StringBuffer normQueryString = new StringBuffer(4096);\r
137\r
138 int i = 0;\r
139 while (i < exp.length) {\r
140 String newExp = from + exp[i];\r
141 Pattern pattern = Pattern.compile("([^/]*)(/|//)([^/]+)");\r
142 Matcher matcher = pattern.matcher(newExp);\r
143\r
144 while (matcher.find()) {\r
145 String starter = newExp.substring(matcher.start(1), matcher\r
146 .end(1));\r
147 String seperator = newExp.substring(matcher.start(2), matcher\r
148 .end(2));\r
149 String token = newExp.substring(matcher.start(3), matcher\r
150 .end(3));\r
151\r
152 normQueryString.append(starter);\r
153 normQueryString.append(seperator);\r
154 normQueryString.append(nsPrefix);\r
155 normQueryString.append(":");\r
156 normQueryString.append(token);\r
157 }\r
158\r
159 ++i;\r
160 if (i < exp.length) {\r
161 normQueryString.append(" | ");\r
162 }\r
163 }\r
164\r
165 return normQueryString.toString();\r
166 }\r
167\r
168 /**\r
169 * Search all XML documents stored in "map" for the specified xPath, using\r
170 * relative path (starting with '$this')\r
171 * \r
172 * @param xPath\r
173 * xpath query string array\r
174 * @returns An array of XmlObject if elements are found at the specified\r
175 * xpath\r
176 * @returns NULL if nothing is at the specified xpath\r
177 */\r
178 public static XmlObject[] get(String[] xPath) {\r
179 if (map == null) {\r
180 return null;\r
181 }\r
182\r
183 String[] keys = (String[]) map.keySet().toArray(new String[map.size()]);\r
184 List<XmlObject> result = new ArrayList<XmlObject>();\r
185 for (int i = 0; i < keys.length; ++i) {\r
186 XmlObject rootNode = (XmlObject) map.get(keys[i]);\r
187 if (rootNode == null) {\r
188 continue;\r
189 }\r
190\r
191 String query = queryDeclaration\r
192 + normalizeQueryString(xPath, "$this/" + keys[i]);\r
193 XmlObject[] tmp = rootNode.selectPath(query);\r
194 for (int j = 0; j < tmp.length; ++j) {\r
195 result.add(tmp[j]);\r
196 }\r
197 }\r
198\r
199 int size = result.size();\r
200 if (size <= 0) {\r
201 return null;\r
202 }\r
203\r
204 return (XmlObject[]) result.toArray(new XmlObject[size]);\r
205 }\r
206\r
207 /**\r
208 * Search XML documents named by "rootName" for the given xPath, using\r
209 * relative path (starting with '$this')\r
210 * \r
211 * @param rootName\r
212 * The top level element name\r
213 * @param xPath\r
214 * The xpath query string array\r
215 * @returns An array of XmlObject if elements are found at the given xpath\r
216 * @returns NULL if nothing is found at the given xpath\r
217 */\r
218 public static XmlObject[] get(String rootName, String[] xPath) {\r
219 if (map == null) {\r
220 return null;\r
221 }\r
222\r
223 XmlObject root = (XmlObject) map.get(rootName);\r
224 if (root == null) {\r
225 return null;\r
226 }\r
227\r
228 String query = queryDeclaration\r
229 + normalizeQueryString(xPath, "$this/" + rootName);\r
230 XmlObject[] result = root.selectPath(query);\r
231 if (result.length > 0) {\r
232 return result;\r
233 }\r
234\r
235 query = queryDeclaration + normalizeQueryString(xPath, "/" + rootName);\r
236 result = root.selectPath(query);\r
237 if (result.length > 0) {\r
238 return result;\r
239 }\r
240\r
241 return null;\r
242 }\r
243\r
244 /**\r
245 * Retrieve SourceFiles/Filename for specified ARCH type\r
246 * \r
247 * @param arch\r
248 * architecture name\r
249 * @returns An 2 dimension string array if elements are found at the known\r
250 * xpath\r
251 * @returns NULL if nothing is found at the known xpath\r
252 */\r
253 public static String[][] getSourceFiles(String arch) {\r
254 String[] xPath;\r
255 XmlObject[] returns;\r
256\r
257 if (arch == null || arch.equals("")) {\r
258 xPath = new String[] { "/Filename" };\r
259 } else {\r
260 xPath = new String[] { "/Filename[not(@SupArchList) or @SupArchList='"\r
261 + arch + "']" };\r
262 }\r
263\r
264 returns = get("SourceFiles", xPath);\r
265\r
266 if (returns == null || returns.length == 0) {\r
267 return null;\r
268 }\r
269\r
270 Filename[] sourceFileNames = (Filename[]) returns;\r
271 String[][] outputString = new String[sourceFileNames.length][2];\r
272 for (int i = 0; i < sourceFileNames.length; i++) {\r
273 outputString[i][0] = sourceFileNames[i].getToolCode();\r
274 outputString[i][1] = sourceFileNames[i].getStringValue();\r
275 }\r
276 return outputString;\r
277 }\r
278\r
279 /**\r
280 * Retrieve /PlatformDefinitions/OutputDirectory from FPD\r
281 * \r
282 * @returns Directory names array if elements are found at the known xpath\r
283 * @returns Empty if nothing is found at the known xpath\r
284 */\r
285 public static String getFpdOutputDirectory() {\r
286 String[] xPath = new String[] { "/PlatformDefinitions/OutputDirectory" };\r
287\r
288 XmlObject[] returns = get("FrameworkPlatformDescription", xPath);\r
289 if (returns != null && returns.length > 0) {\r
290 // String TBD\r
291 }\r
292\r
293 return null;\r
294 }\r
295\r
296 public static String getFpdIntermediateDirectories() {\r
297 String[] xPath = new String[] { "/PlatformDefinitions/IntermediateDirectories" };\r
298\r
299 XmlObject[] returns = get("FrameworkPlatformDescription", xPath);\r
300 if (returns != null && returns.length > 0) {\r
301 // TBD\r
302 }\r
303 return "UNIFIED";\r
304 }\r
305\r
a13899c5 306 public static String getBuildTarget() {\r
307 String[] xPath = new String[] { "/PlatformDefinitions/BuildTargets" };\r
308\r
309 XmlObject[] returns = get("FrameworkPlatformDescription", xPath);\r
310 if (returns != null && returns.length > 0) {\r
311 return ((BuildTargetList) returns[0]).getStringValue();\r
312 }\r
313\r
314 return null;\r
315 }\r
316\r
317 /**\r
318 * Retrieve <xxxHeader>/ModuleType\r
319 * \r
320 * @returns The module type name if elements are found at the known xpath\r
321 * @returns null if nothing is there\r
322 */\r
323 public static String getModuleType() {\r
324 String[] xPath = new String[] { "/ModuleType" };\r
325\r
326 XmlObject[] returns = get(xPath);\r
327 if (returns != null && returns.length > 0) {\r
328 ModuleTypeDef type = (ModuleTypeDef) returns[0];\r
329 return type.enumValue().toString();\r
330 }\r
331\r
332 return null;\r
333 }\r
334\r
335 /**\r
336 * Retrieve PackageDependencies/Package\r
337 * \r
338 * @param arch\r
339 * Architecture name\r
340 * \r
341 * @returns package name list if elements are found at the known xpath\r
342 * @returns null if nothing is there\r
343 */\r
344 public static PackageIdentification[] getDependencePkg(String arch) {\r
345 String[] xPath;\r
346 String packageGuid = null;\r
347 String packageVersion = null;\r
348\r
349 if (arch == null || arch.equals("")) {\r
350 xPath = new String[] { "/PackageDependencies/Package" };\r
351 } else {\r
352 xPath = new String[] { "/PackageDependencies/Package[not(@SupArchList) or @SupArchList='"\r
353 + arch + "']" };\r
354 }\r
355\r
356 XmlObject[] returns = get("ModuleSurfaceArea", xPath);\r
357 if (returns == null) {\r
358 return new PackageIdentification[0];\r
359 }\r
360 PackageIdentification[] packageIdList = new PackageIdentification[returns.length];\r
361 for (int i = 0; i < returns.length; i++) {\r
362 PackageDependenciesDocument.PackageDependencies.Package item = (PackageDependenciesDocument.PackageDependencies.Package) returns[i];\r
363 packageGuid = item.getPackageGuid();\r
364 packageVersion = item.getPackageVersion();\r
365\r
366 Set<PackageIdentification> spi = GlobalData.getPackageList();\r
367 Iterator<PackageIdentification> ispi = spi.iterator();\r
368 String ver = "";\r
369 while(ispi.hasNext()) {\r
370 PackageIdentification pi = ispi.next();\r
371 if (packageVersion != null) {\r
372 if (pi.getGuid().equals(packageGuid) && pi.getVersion().equals(packageVersion)) {\r
373 packageIdList[i] = pi;\r
374 break;\r
375 } \r
376 }\r
377 else {\r
378 if (pi.getGuid().equals(packageGuid)) {\r
379 if (pi.getVersion() != null && pi.getVersion().compareTo(ver) > 0){\r
380 ver = pi.getVersion();\r
381 packageIdList[i] = pi;\r
382 }\r
383 else if (packageIdList[i] == null){\r
384 packageIdList[i] = pi;\r
385 }\r
386 }\r
387 }\r
388 \r
389 }\r
390 }\r
391 return packageIdList;\r
392 }\r
393\r
394 /**\r
395 * Retrieve LibraryClassDefinitions/LibraryClass for specified usage\r
396 * \r
397 * @param usage\r
398 * Library class usage\r
399 * \r
400 * @returns LibraryClass objects list if elements are found at the known\r
401 * xpath\r
402 * @returns null if nothing is there\r
403 */\r
404 public static String[] getLibraryClasses(String usage) {\r
405 String[] xPath;\r
406\r
407 if (usage == null || usage.equals("")) {\r
408 xPath = new String[] { "/LibraryClass" };\r
409 } else {\r
410 xPath = new String[] { "/LibraryClass[@Usage='" + usage + "']" };\r
411 }\r
412\r
413 XmlObject[] returns = get("LibraryClassDefinitions", xPath);\r
414 if (returns == null || returns.length == 0) {\r
415 return new String[0];\r
416 }\r
417\r
418 LibraryClassDocument.LibraryClass[] libraryClassList = (LibraryClassDocument.LibraryClass[]) returns;\r
419 String[] libraryClassName = new String[libraryClassList.length];\r
420 for (int i = 0; i < libraryClassList.length; i++) {\r
421 libraryClassName[i] = libraryClassList[i].getKeyword();\r
422 }\r
423 return libraryClassName;\r
424 }\r
425\r
426 /**\r
427 * Retrieve ModuleEntryPoint names\r
428 * \r
429 * @returns ModuleEntryPoint name list if elements are found at the known\r
430 * xpath\r
431 * @returns null if nothing is there\r
432 */\r
433 public static String[] getModuleEntryPointArray() {\r
434 String[] xPath = new String[] { "/Extern/ModuleEntryPoint" };\r
435\r
436 XmlObject[] returns = get("Externs", xPath);\r
437\r
438 if (returns != null && returns.length > 0) {\r
439 String[] entryPoints = new String[returns.length];\r
440\r
441 for (int i = 0; i < returns.length; ++i) {\r
442 entryPoints[i] = ((XmlNormalizedString) returns[i])\r
443 .getStringValue();\r
444 }\r
445\r
446 return entryPoints;\r
447 }\r
448\r
449 return null;\r
450 }\r
451\r
452 \r
453 \r
454\r
455 /**\r
456 * Retrieve ModuleUnloadImage names\r
457 * \r
458 * @returns ModuleUnloadImage name list if elements are found at the known\r
459 * xpath\r
460 * @returns null if nothing is there\r
461 */\r
462 public static String[] getModuleUnloadImageArray() {\r
463 String[] xPath = new String[] { "/Extern/ModuleUnloadImage" };\r
464\r
465 XmlObject[] returns = get("Externs", xPath);\r
466 if (returns != null && returns.length > 0) {\r
467 String[] stringArray = new String[returns.length];\r
468 XmlNormalizedString[] doc = (XmlNormalizedString[]) returns;\r
469\r
470 for (int i = 0; i < returns.length; ++i) {\r
471 stringArray[i] = doc[i].getStringValue();\r
472 }\r
473\r
474 return stringArray;\r
475 }\r
476\r
477 return null;\r
478 }\r
479\r
480 /**\r
481 * Retrieve Extern\r
482 * \r
483 * @returns Extern objects list if elements are found at the known xpath\r
484 * @returns null if nothing is there\r
485 */\r
486 public static ExternsDocument.Externs.Extern[] getExternArray() {\r
487 String[] xPath = new String[] { "/Extern" };\r
488\r
489 XmlObject[] returns = get("Externs", xPath);\r
490 if (returns != null && returns.length > 0) {\r
491 return (ExternsDocument.Externs.Extern[]) returns;\r
492 }\r
493\r
494 return null;\r
495 }\r
496 \r
497 /**\r
498 * Retrieve Library instance information\r
499 * \r
500 * @param arch\r
501 * Architecture name\r
502 * @param usage\r
503 * Library instance usage\r
504 * \r
505 * @returns library instance name list if elements are found at the known\r
506 * xpath\r
507 * @returns null if nothing is there\r
508 */\r
509 public static ModuleIdentification[] getLibraryInstance(String arch) {\r
510 String[] xPath;\r
511 String saGuid = null;\r
512 String saVersion = null;\r
513 String pkgGuid = null;\r
514 String pkgVersion = null;\r
515\r
516 if (arch == null || arch.equalsIgnoreCase("")) {\r
517 xPath = new String[] { "/Instance" };\r
518 } else {\r
519 xPath = new String[] { "/Instance[not(@SupArchList) or @SupArchList='"\r
520 + arch + "']" };\r
521 }\r
522\r
523 XmlObject[] returns = get("Libraries", xPath);\r
524 if (returns == null || returns.length == 0) {\r
525 return new ModuleIdentification[0];\r
526 }\r
527\r
528 ModuleIdentification[] saIdList = new ModuleIdentification[returns.length];\r
529 for (int i = 0; i < returns.length; i++) {\r
530 LibrariesDocument.Libraries.Instance library = (LibrariesDocument.Libraries.Instance) returns[i];\r
531 saGuid = library.getModuleGuid();\r
532 saVersion = library.getModuleVersion();\r
533\r
534 pkgGuid = library.getPackageGuid();\r
535 pkgVersion = library.getPackageVersion();\r
536\r
537 ModuleIdentification saId = new ModuleIdentification(null, saGuid,\r
538 saVersion);\r
539 PackageIdentification pkgId = new PackageIdentification(null,\r
540 pkgGuid, pkgVersion);\r
541 saId.setPackage(pkgId);\r
542\r
543 saIdList[i] = saId;\r
544\r
545 }\r
546 return saIdList;\r
547 }\r
548\r
549 // /\r
550 // / This method is used for retrieving the elements information which has\r
551 // / CName sub-element\r
552 // /\r
553 private static String[] getCNames(String from, String xPath[]) {\r
554 XmlObject[] returns = get(from, xPath);\r
555 if (returns == null || returns.length == 0) {\r
556 return null;\r
557 }\r
558\r
559 String[] strings = new String[returns.length];\r
560 for (int i = 0; i < returns.length; ++i) {\r
561 // TBD\r
562 // strings[i] = ((CName) returns[i]).getStringValue();\r
563 }\r
564\r
565 return strings;\r
566 }\r
567\r
568 /**\r
569 * Retrive library's constructor name\r
570 * \r
571 * @returns constructor name list if elements are found at the known xpath\r
572 * @returns null if nothing is there\r
573 */\r
574 public static String getLibConstructorName() {\r
575 String[] xPath = new String[] { "/Extern/Constructor" };\r
576\r
577 XmlObject[] returns = get("Externs", xPath);\r
578 if (returns != null && returns.length > 0) {\r
579 // CName constructor = (CName) returns[0];\r
580 // return constructor.getStringValue();\r
581 }\r
582\r
583 return null;\r
584 }\r
585\r
586 /**\r
587 * Retrive library's destructor name\r
588 * \r
589 * @returns destructor name list if elements are found at the known xpath\r
590 * @returns null if nothing is there\r
591 */\r
592 public static String getLibDestructorName() {\r
593 String[] xPath = new String[] { "/Extern/Destructor" };\r
594\r
595 XmlObject[] returns = get("Externs", xPath);\r
596 if (returns != null && returns.length > 0) {\r
597 // CName destructor = (CName) returns[0];\r
598 // return destructor.getStringValue();\r
599 }\r
600\r
601 return null;\r
602 }\r
603\r
604 /**\r
605 * Retrive DriverBinding names\r
606 * \r
607 * @returns DriverBinding name list if elements are found at the known xpath\r
608 * @returns null if nothing is there\r
609 */\r
610 public static String[] getDriverBindingArray() {\r
611 String[] xPath = new String[] { "/Extern/DriverBinding" };\r
612 return getCNames("Externs", xPath);\r
613 }\r
614\r
615 /**\r
616 * Retrive ComponentName names\r
617 * \r
618 * @returns ComponentName name list if elements are found at the known xpath\r
619 * @returns null if nothing is there\r
620 */\r
621 public static String[] getComponentNameArray() {\r
622 String[] xPath = new String[] { "/Extern/ComponentName" };\r
623 return getCNames("Externs", xPath);\r
624 }\r
625\r
626 /**\r
627 * Retrive DriverConfig names\r
628 * \r
629 * @returns DriverConfig name list if elements are found at the known xpath\r
630 * @returns null if nothing is there\r
631 */\r
632 public static String[] getDriverConfigArray() {\r
633 String[] xPath = new String[] { "/Extern/DriverConfig" };\r
634 return getCNames("Externs", xPath);\r
635 }\r
636\r
637 /**\r
638 * Retrive DriverDiag names\r
639 * \r
640 * @returns DriverDiag name list if elements are found at the known xpath\r
641 * @returns null if nothing is there\r
642 */\r
643 public static String[] getDriverDiagArray() {\r
644 String[] xPath = new String[] { "/Extern/DriverDiag" };\r
645 return getCNames("Externs", xPath);\r
646 }\r
647\r
648 /**\r
649 * Retrive SetVirtualAddressMapCallBack names\r
650 * \r
651 * @returns SetVirtualAddressMapCallBack name list if elements are found at\r
652 * the known xpath\r
653 * @returns null if nothing is there\r
654 */\r
655 public static String[] getSetVirtualAddressMapCallBackArray() {\r
656 String[] xPath = new String[] { "/Extern/SetVirtualAddressMapCallBack" };\r
657 return getCNames("Externs", xPath);\r
658 }\r
659\r
660 /**\r
661 * Retrive ExitBootServicesCallBack names\r
662 * \r
663 * @returns ExitBootServicesCallBack name list if elements are found at the\r
664 * known xpath\r
665 * @returns null if nothing is there\r
666 */\r
667 public static String[] getExitBootServicesCallBackArray() {\r
668 String[] xPath = new String[] { "/Extern/ExitBootServicesCallBack" };\r
669 return getCNames("Externs", xPath);\r
670 }\r
671\r
672 /**\r
673 * Retrieve module surface area file information\r
674 * \r
675 * @returns ModuleSA objects list if elements are found at the known xpath\r
676 * @returns Empty ModuleSA list if nothing is there\r
677 */\r
678 public static Map<FpdModuleIdentification, Map<String, XmlObject>> getFpdModules() {\r
679 String[] xPath = new String[] { "/FrameworkModules/ModuleSA" };\r
680 XmlObject[] result = get("FrameworkPlatformDescription", xPath);\r
681 String arch = null;\r
682 String fvBinding = null;\r
683 String saGuid = null;\r
684 String saVersion = null;\r
685 String pkgGuid = null;\r
686 String pkgVersion = null;\r
687\r
688 Map<FpdModuleIdentification, Map<String, XmlObject>> fpdModuleMap = new LinkedHashMap<FpdModuleIdentification, Map<String, XmlObject>>();\r
689\r
690 if (result == null) {\r
691 return fpdModuleMap;\r
692 }\r
693\r
694 for (int i = 0; i < result.length; i++) {\r
695 //\r
696 // Get Fpd SA Module element node and add to xmlObjectMap.\r
697 //\r
698 Map<String, XmlObject> xmlObjectMap = new HashMap<String, XmlObject>();\r
699 ModuleSADocument.ModuleSA moduleSA = (ModuleSADocument.ModuleSA) result[i];\r
700 if (((ModuleSADocument.ModuleSA) result[i]).getLibraries() != null) {\r
701 xmlObjectMap.put("Libraries", moduleSA.getLibraries());\r
702 }\r
703 if (((ModuleSADocument.ModuleSA) result[i]).getPcdBuildDefinition() != null) {\r
704 xmlObjectMap.put("PcdBuildDefinition", moduleSA\r
705 .getPcdBuildDefinition());\r
706 }\r
707 if (((ModuleSADocument.ModuleSA) result[i])\r
708 .getModuleSaBuildOptions() != null) {\r
709 xmlObjectMap.put("ModuleSaBuildOptions", moduleSA\r
710 .getModuleSaBuildOptions());\r
711 }\r
712\r
713 //\r
714 // Get Fpd SA Module attribute and create FpdMoudleIdentification.\r
715 //\r
716 arch = moduleSA.getSupArchList().toString();\r
717\r
718 // TBD\r
719 fvBinding = null;\r
720 saVersion = ((ModuleSADocument.ModuleSA) result[i])\r
721 .getModuleVersion();\r
722\r
723 saGuid = moduleSA.getModuleGuid();\r
724 pkgGuid = moduleSA.getPackageGuid();\r
725 pkgVersion = moduleSA.getPackageVersion();\r
726\r
727 //\r
728 // Create Module Identification which have class member of package\r
729 // identification.\r
730 //\r
731 PackageIdentification pkgId = new PackageIdentification(null,\r
732 pkgGuid, pkgVersion);\r
733 ModuleIdentification saId = new ModuleIdentification(null, saGuid,\r
734 saVersion);\r
735\r
736 saId.setPackage(pkgId);\r
737\r
738 //\r
739 // Create FpdModule Identification which have class member of module\r
740 // identification\r
741 //\r
742 FpdModuleIdentification fpdSaId = new FpdModuleIdentification(saId,\r
743 arch);\r
744 if (arch != null) {\r
745 fpdSaId.setArch(arch);\r
746 }\r
747 if (fvBinding != null) {\r
748 fpdSaId.setFvBinding(fvBinding);\r
749 }\r
750\r
751 //\r
752 // Put element to Map<FpdModuleIdentification, Map<String,\r
753 // XmlObject>>.\r
754 //\r
755 fpdModuleMap.put(fpdSaId, xmlObjectMap);\r
756 }\r
757 return fpdModuleMap;\r
758 }\r
759\r
760 /**\r
761 * Retrieve valid image names\r
762 * \r
763 * @returns valid iamges name list if elements are found at the known xpath\r
764 * @returns empty list if nothing is there\r
765 */\r
766 public static String[] getFpdValidImageNames() {\r
767 String[] xPath = new String[] { "/PlatformDefinitions/FlashDeviceDefinitions/FvImages/FvImage[@Type='ValidImageNames']/FvImageNames" };\r
768\r
769 XmlObject[] queryResult = get("FrameworkPlatformDescription", xPath);\r
770 if (queryResult == null) {\r
771 return new String[0];\r
772 }\r
773\r
774 String[] result = new String[queryResult.length];\r
775 for (int i = 0; i < queryResult.length; i++) {\r
776 result[i] = ((XmlString) queryResult[i]).getStringValue();\r
777 }\r
778\r
779 return result;\r
780 }\r
781\r
f3b0ed9a 782 \r
a13899c5 783\r
784 public static XmlObject getFpdBuildOptions() {\r
785 String[] xPath = new String[] { "/BuildOptions" };\r
786\r
787 XmlObject[] queryResult = get("FrameworkPlatformDescription", xPath);\r
788\r
789 if (queryResult == null || queryResult.length == 0) {\r
790 return null;\r
791 }\r
792 return queryResult[0];\r
793 }\r
794\r
795 public static PlatformIdentification getFpdHeader() {\r
796 String[] xPath = new String[] { "/PlatformHeader" };\r
797\r
798 XmlObject[] returns = get("FrameworkPlatformDescription", xPath);\r
799\r
800 if (returns == null || returns.length == 0) {\r
801 return null;\r
802 }\r
803 PlatformHeaderDocument.PlatformHeader header = (PlatformHeaderDocument.PlatformHeader) returns[0];\r
804\r
805 String name = header.getPlatformName();\r
806\r
807 String guid = header.getGuidValue();\r
808\r
809 String version = header.getVersion();\r
810\r
811 return new PlatformIdentification(name, guid, version);\r
812 }\r
813\r
814 /**\r
815 * Retrieve flash definition file name\r
816 * \r
817 * @returns file name if elements are found at the known xpath\r
818 * @returns null if nothing is there\r
819 */\r
820 public static String getFlashDefinitionFile() {\r
821 String[] xPath = new String[] { "/PlatformDefinitions/FlashDeviceDefinitions/FlashDefinitionFile" };\r
822\r
823 XmlObject[] queryResult = get("FrameworkPlatformDescription", xPath);\r
824 if (queryResult == null || queryResult.length == 0) {\r
825 return null;\r
826 }\r
827\r
828 FileNameConvention filename = (FileNameConvention) queryResult[queryResult.length - 1];\r
829 return filename.getStringValue();\r
830 }\r
831\r
832 /**\r
833 * Retrieve FV image component options\r
834 * \r
835 * @param fvName\r
836 * FV image name\r
837 * \r
838 * @returns name/value pairs list if elements are found at the known xpath\r
839 * @returns empty list if nothing is there\r
840 */\r
841 public static String[][] getFpdComponents(String fvName) {\r
842 String[] xPath = new String[] { "/PlatformDefinitions/FlashDeviceDefinitions/DataRegions/FvDataRegion[@Name='"\r
843 + fvName.toUpperCase() + "']/DataId" };\r
844\r
845 XmlObject[] queryResult = get("FrameworkPlatformDescription", xPath);\r
846 if (queryResult == null) {\r
847 return new String[0][];\r
848 }\r
849\r
850 ArrayList<String[]> list = new ArrayList<String[]>();\r
851 for (int i = 0; i < queryResult.length; i++) {\r
852 DataIdDocument.DataId item = (DataIdDocument.DataId) queryResult[i];\r
853 list\r
854 .add(new String[] { item.getStringValue(),\r
855 item.getDataSize() });\r
856 }\r
857\r
858 String[][] result = new String[list.size()][2];\r
859 for (int i = 0; i < list.size(); i++) {\r
860 result[i][0] = list.get(i)[0];\r
861 result[i][1] = list.get(i)[1];\r
862 }\r
863\r
864 return result;\r
865 }\r
866\r
867 /**\r
868 * Retrieve PCD tokens\r
869 * \r
870 * @returns CName/ItemType pairs list if elements are found at the known\r
871 * xpath\r
872 * @returns null if nothing is there\r
873 */\r
874 public static String[][] getPcdTokenArray() {\r
875 String[] xPath = new String[] { "/PcdData" };\r
876\r
877 XmlObject[] returns = get("PCDs", xPath);\r
878 if (returns == null || returns.length == 0) {\r
879 return null;\r
880 }\r
881\r
882 // PcdCoded.PcdData[] pcds = (PcdCoded.PcdData[]) returns;\r
883 // String[][] result = new String[pcds.length][2];\r
884 // for (int i = 0; i < returns.length; ++i) {\r
885 // if (pcds[i].getItemType() != null) {\r
886 // result[i][1] = pcds[i].getItemType().toString();\r
887 // } else {\r
888 // result[i][1] = null;\r
889 // }\r
890 // result[i][0] = pcds[i].getCName();\r
891 // }\r
892\r
893 return null;\r
894 }\r
895\r
896 /**\r
897 * Get the PcdToken array from module's surface area document. The array\r
898 * should contains following data:\r
899 * <p>\r
900 * -------------------------------------------------------------------\r
901 * </p>\r
902 * <p>\r
903 * CName | ItemType | TokenspaceName | DefaultValue | Usage | HelpText\r
904 * </p>\r
905 * <p>\r
906 * -------------------------------------------------------------------\r
907 * </p>\r
908 * <p>\r
909 * Note: Until new schema applying, now we can only get CName, ItemType,\r
910 * </p>\r
911 * \r
912 * @return 2-array table contains all information of PCD token retrieved\r
913 * from MSA.\r
914 */\r
915 public static Object[][] etModulePCDTokenArray() {\r
916 return null;\r
917 // int index;\r
918 // Object[][] result;\r
919 // PCDs.PcdData[] pcds;\r
920 // String[] xPath = new String[] { "/PcdData" };\r
921 // XmlObject[] returns = get("PCDs", xPath);\r
922 //\r
923 // if ((returns == null) || (returns.length == 0)) {\r
924 // return null;\r
925 // }\r
926 //\r
927 // pcds = (PCDs.PcdData[]) returns;\r
928 // result = new Object[pcds.length][6];\r
929 // for (index = 0; index < pcds.length; index++) {\r
930 // //\r
931 // // Get CName\r
932 // //\r
933 // result[index][0] = pcds[index].getCName();\r
934 // //\r
935 // // Get ItemType: FEATURE_FLAG, FIXED_AT_BUILD, PATCHABLE_IN_MODLE,\r
936 // // DYNAMIC, DYNAMIC_EX\r
937 // //\r
938 // if (pcds[index].getItemType() != null) {\r
939 // result[index][1] = pcds[index].getItemType().toString();\r
940 // } else {\r
941 // result[index][1] = null;\r
942 // }\r
943 //\r
944 // //\r
945 // // BUGBUG: following field can *not* be got from current MSA until\r
946 // // schema changed.\r
947 // //\r
948 // // result [index][2] = pcds[index].getTokenSpaceName();\r
949 // result[index][2] = null;\r
950 // result[index][3] = pcds[index].getDefaultValue();\r
951 // // result [index][4] = pcds[index].getUsage ();\r
952 // result[index][4] = null;\r
953 // // result [index][5] = pcds[index].getHelpText ();\r
954 // result[index][5] = null;\r
955 // }\r
956 // return result;\r
957 }\r
958\r
959 /**\r
960 * Retrieve MAS header\r
961 * \r
962 * @return\r
963 * @return\r
964 */\r
965 public static ModuleIdentification getMsaHeader() {\r
966 String[] xPath = new String[] { "/" };\r
967 XmlObject[] returns = get("MsaHeader", xPath);\r
968\r
969 if (returns == null || returns.length == 0) {\r
970 return null;\r
971 }\r
972\r
973 MsaHeader msaHeader = (MsaHeader) returns[0];\r
974 //\r
975 // Get BaseName, ModuleType, GuidValue, Version\r
976 // which in MsaHeader.\r
977 //\r
978 String name = msaHeader.getModuleName();\r
410e0e9f 979 String moduleType = "";\r
980 if (msaHeader.getModuleType() != null) {\r
981 moduleType = msaHeader.getModuleType().toString();\r
982 }\r
983 \r
a13899c5 984 String guid = msaHeader.getGuidValue();\r
985 String version = msaHeader.getVersion();\r
986\r
987 ModuleIdentification moduleId = new ModuleIdentification(name, guid,\r
988 version);\r
989\r
990 moduleId.setModuleType(moduleType);\r
991\r
992 return moduleId;\r
993 }\r
994\r
995 /**\r
996 * Retrieve Extern Specification\r
997 * \r
998 * @param\r
999 * \r
1000 * @return String[] If have specification element in the <extern> String[0]\r
1001 * If no specification element in the <extern>\r
1002 * \r
1003 */\r
1004\r
1005 public static String[] getExternSpecificaiton() {\r
1006 String[] xPath = new String[] { "/Specification" };\r
1007\r
1008 XmlObject[] queryResult = get("Externs", xPath);\r
1009 if (queryResult == null) {\r
1010 return new String[0];\r
1011 }\r
1012\r
1013 String[] specificationList = new String[queryResult.length];\r
1014 for (int i = 0; i < queryResult.length; i++) {\r
1015 // specificationList[i] = ((SpecificationDocument.Specification)\r
1016 // queryResult[i])\r
1017 // .getStringValue();\r
1018 }\r
1019 return specificationList;\r
1020 }\r
1021\r
1022 /**\r
1023 * Retreive MsaFile which in SPD\r
1024 * \r
1025 * @param\r
1026 * @return String[][3] The string sequence is ModuleName, ModuleGuid,\r
1027 * ModuleVersion, MsaFile String[0][] If no msafile in SPD\r
1028 */\r
1029 public static String[] getSpdMsaFile() {\r
1030 String[] xPath = new String[] { "/MsaFiles" };\r
1031\r
1032 XmlObject[] returns = get("PackageSurfaceArea", xPath);\r
1033 if (returns == null) {\r
1034 return new String[0];\r
1035 }\r
1036\r
1037 List<String> filenameList = ((MsaFilesDocument.MsaFiles) returns[0])\r
1038 .getFilenameList();\r
1039 return filenameList.toArray(new String[filenameList.size()]);\r
1040 }\r
1041\r
1042 /**\r
1043 * Reteive\r
1044 */\r
1045 public static Map<String, String[]> getSpdLibraryClasses() {\r
1046 String[] xPath = new String[] { "/LibraryClassDeclarations/LibraryClass" };\r
1047\r
1048 XmlObject[] returns = get("PackageSurfaceArea", xPath);\r
1049\r
1050 //\r
1051 // Create Map, Key - LibraryClass, String[] - LibraryClass Header file.\r
1052 //\r
1053 Map<String, String[]> libClassHeaderMap = new HashMap<String, String[]>();\r
1054\r
1055 if (returns == null) {\r
1056 return libClassHeaderMap;\r
1057 }\r
1058\r
1059 for (int i = 0; i < returns.length; i++) {\r
1060 LibraryClassDeclarationsDocument.LibraryClassDeclarations.LibraryClass library = (LibraryClassDeclarationsDocument.LibraryClassDeclarations.LibraryClass) returns[i];\r
1061 libClassHeaderMap.put(library.getName(), new String[] { library\r
1062 .getIncludeHeader() });\r
1063 }\r
1064 return libClassHeaderMap;\r
1065 }\r
1066\r
1067 /**\r
1068 * Reteive\r
1069 */\r
1070 public static Map<String, String> getSpdPackageHeaderFiles() {\r
1071 String[] xPath = new String[] { "/PackageHeaders/IncludePkgHeader" };\r
1072\r
1073 XmlObject[] returns = get("PackageSurfaceArea", xPath);\r
1074\r
1075 //\r
1076 // Create Map, Key - ModuleType, String - PackageInclude Header file.\r
1077 //\r
1078 Map<String, String> packageIncludeMap = new HashMap<String, String>();\r
1079\r
1080 if (returns == null) {\r
1081 return packageIncludeMap;\r
1082 }\r
1083 GlobalData.log.info("" + returns[0].getClass().getName());\r
1084 for (int i = 0; i < returns.length; i++) {\r
1085 PackageHeadersDocument.PackageHeaders.IncludePkgHeader includeHeader = (PackageHeadersDocument.PackageHeaders.IncludePkgHeader) returns[i];\r
1086 packageIncludeMap.put(includeHeader.getModuleType().toString(),\r
1087 includeHeader.getStringValue());\r
1088 }\r
1089 return packageIncludeMap;\r
1090 }\r
1091\r
1092 public static PackageIdentification getSpdHeader() {\r
1093 String[] xPath = new String[] { "/SpdHeader" };\r
1094\r
1095 XmlObject[] returns = get("PackageSurfaceArea", xPath);\r
1096\r
1097 if (returns == null || returns.length == 0) {\r
1098 return null;\r
1099 }\r
1100\r
1101 SpdHeaderDocument.SpdHeader header = (SpdHeaderDocument.SpdHeader) returns[0];\r
1102\r
1103 String name = header.getPackageName();\r
1104\r
1105 String guid = header.getGuidValue();\r
1106\r
1107 String version = header.getVersion();\r
1108\r
1109 return new PackageIdentification(name, guid, version);\r
1110 }\r
1111\r
1112 /**\r
1113 * Reteive\r
1114 */\r
1115 public static Map<String, String[]> getSpdGuid() {\r
1116 String[] xPath = new String[] { "/GuidDeclarations/Entry" };\r
1117\r
1118 XmlObject[] returns = get("PackageSurfaceArea", xPath);\r
1119\r
1120 //\r
1121 // Create Map, Key - GuidName, String[] - C_NAME & GUID value.\r
1122 //\r
1123 Map<String, String[]> guidDeclMap = new HashMap<String, String[]>();\r
1124 if (returns == null) {\r
1125 return guidDeclMap;\r
1126 }\r
1127\r
1128 for (int i = 0; i < returns.length; i++) {\r
1129 GuidDeclarationsDocument.GuidDeclarations.Entry entry = (GuidDeclarationsDocument.GuidDeclarations.Entry) returns[i];\r
1130 String[] guidPair = new String[2];\r
1131 guidPair[0] = entry.getCName();\r
1132 guidPair[1] = entry.getGuidValue();\r
1133 guidDeclMap.put(entry.getName(), guidPair);\r
1134 }\r
1135 return guidDeclMap;\r
1136 }\r
1137\r
1138 /**\r
1139 * Reteive\r
1140 */\r
1141 public static Map<String, String[]> getSpdProtocol() {\r
1142 String[] xPath = new String[] { "/ProtocolDeclarations/Entry" };\r
1143\r
1144 XmlObject[] returns = get("PackageSurfaceArea", xPath);\r
1145\r
1146 //\r
1147 // Create Map, Key - protocolName, String[] - C_NAME & GUID value.\r
1148 //\r
1149 Map<String, String[]> protoclMap = new HashMap<String, String[]>();\r
1150\r
1151 if (returns == null) {\r
1152 return protoclMap;\r
1153 }\r
1154\r
1155 for (int i = 0; i < returns.length; i++) {\r
1156 ProtocolDeclarationsDocument.ProtocolDeclarations.Entry entry = (ProtocolDeclarationsDocument.ProtocolDeclarations.Entry) returns[i];\r
1157 String[] protocolPair = new String[2];\r
1158\r
1159 protocolPair[0] = entry.getCName();\r
1160 protocolPair[1] = entry.getGuidValue();\r
1161 protoclMap.put(entry.getName(), protocolPair);\r
1162 }\r
1163 return protoclMap;\r
1164 }\r
1165\r
1166 /**\r
1167 * getSpdPpi() Retrieve the SPD PPI Entry\r
1168 * \r
1169 * @param\r
1170 * @return Map<String, String[2]> if get the PPI entry from SPD. Key - PPI\r
1171 * Name String[0] - PPI CNAME String[1] - PPI Guid Null if no PPI\r
1172 * entry in SPD.\r
1173 */\r
1174 public static Map<String, String[]> getSpdPpi() {\r
1175 String[] xPath = new String[] { "/PpiDeclarations/Entry" };\r
1176\r
1177 XmlObject[] returns = get("PackageSurfaceArea", xPath);\r
1178\r
1179 //\r
1180 // Create Map, Key - protocolName, String[] - C_NAME & GUID value.\r
1181 //\r
1182 Map<String, String[]> ppiMap = new HashMap<String, String[]>();\r
1183\r
1184 if (returns == null) {\r
1185 return ppiMap;\r
1186 }\r
1187\r
1188 for (int i = 0; i < returns.length; i++) {\r
1189 PpiDeclarationsDocument.PpiDeclarations.Entry entry = (PpiDeclarationsDocument.PpiDeclarations.Entry) returns[i];\r
1190 String[] ppiPair = new String[2];\r
1191 ppiPair[0] = entry.getCName();\r
1192 ppiPair[1] = entry.getGuidValue();\r
1193 ppiMap.put(entry.getName(), ppiPair);\r
1194 }\r
1195 return ppiMap;\r
1196 }\r
1197\r
1198 /**\r
1199 * getModuleSupportedArchs()\r
1200 * \r
1201 * This function is to Retrieve Archs one module supported.\r
1202 * \r
1203 * @param\r
1204 * @return supportArch String of supporting archs. null No arch specified in\r
1205 * <MouduleSupport> element.\r
1206 */\r
1207 public static List<String> getModuleSupportedArchs() {\r
1208 String[] xPath = new String[] { "/ModuleDefinitions/SupportedArchitectures" };\r
1209\r
1210 XmlObject[] returns = get("ModuleSurfaceArea", xPath);\r
1211\r
1212 if (returns == null) {\r
1213 return null;\r
1214 }\r
1215\r
1216 return (List<String>)returns[0];\r
1217 }\r
1218\r
1219 public static XmlObject[] getSpdPcdDeclarations() {\r
1220 String[] xPath = null;\r
1221// if (tsGuid != null){\r
1222// xPath = new String[] { "/PcdDeclarations/PcdEntry[C_Name='" + cName + "' and TokenSpaceGuid='"+ tsGuid + "']" };\r
1223// }\r
1224// else{\r
1225// xPath = new String[] { "/PcdDeclarations/PcdEntry[C_Name='" + cName + "']" };\r
1226// } \r
1227 xPath = new String[] { "/PcdDeclarations/PcdEntry"};\r
1228 XmlObject[] returns = get("PackageSurfaceArea", xPath);\r
1229 \r
1230 return returns;\r
1231 }\r
1232 \r
1233 public static XmlObject[] getFpdPcdBuildDefinitions(String cName, String tsGuid, String type) {\r
1234 String[] xPath = new String[] { "/PcdBuildDefinition/PcdData[C_Name='" + cName + "' and TokenSpaceGuid='"\r
1235 + tsGuid + "' and DatumType!='" + type + "']" };\r
1236\r
1237 XmlObject[] returns = get("ModuleSA", xPath);\r
1238\r
1239 return returns;\r
1240 }\r
1241 /**\r
1242 * getToolChainFamily\r
1243 * \r
1244 * This function is to retrieve ToolChainFamily attribute of FPD\r
1245 * <BuildOptions>\r
1246 * \r
1247 * @param\r
1248 * @return toolChainFamily If find toolChainFamily attribute in\r
1249 * <BuildOptions> Null If don't have toolChainFamily in\r
1250 * <BuildOptions>.\r
1251 */\r
1252 public String getToolChainFamily() {\r
a13899c5 1253 String[] xPath = new String[] { "/BuildOptions" };\r
1254\r
1255 XmlObject[] result = get("FrameworkPlatformDescription", xPath);\r
1256 if (result == null) {\r
1257 return null;\r
1258 }\r
1259 // toolChainFamily =\r
1260 // ((BuildOptionsDocument.BuildOptions)result[0]).getToolChainFamilies();\r
1261 // return toolChainFamily;\r
1262 return null;\r
1263 }\r
1264\r
1265 /**\r
1266 * Retrieve module Guid string\r
1267 * \r
1268 * @returns GUILD string if elements are found at the known xpath\r
1269 * @returns null if nothing is there\r
1270 */\r
1271 public static String getModuleGuid() {\r
1272 String[] xPath = new String[] { "" };\r
1273\r
1274 XmlObject[] returns = get("MsaHeader", xPath);\r
1275 if (returns != null && returns.length > 0) {\r
1276 String guid = ((MsaHeaderDocument.MsaHeader) returns[0])\r
1277 .getGuidValue();\r
1278 return guid;\r
1279 }\r
1280\r
1281 return null;\r
1282 }\r
1283\r
1284 //\r
1285 // For new Pcd\r
1286 //\r
1287 public static ModuleSADocument.ModuleSA[] getFpdModuleSAs() {\r
1288 String[] xPath = new String[] { "/FrameworkModules/ModuleSA" };\r
1289 XmlObject[] result = get("FrameworkPlatformDescription", xPath);\r
1290 if (result != null) {\r
1291 return (ModuleSADocument.ModuleSA[]) result;\r
1292 }\r
1293 return new ModuleSADocument.ModuleSA[0];\r
1294\r
1295 }\r
1296}\r