2 Java class SpdFileContents is used to parse spd xml file.
4 Copyright (c) 2006, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 package org
.tianocore
.frameworkwizard
.packaging
.ui
;
16 import java
.io
.IOException
;
17 import java
.util
.ArrayList
;
18 import java
.util
.List
;
19 import java
.util
.ListIterator
;
20 import java
.util
.Vector
;
23 import org
.apache
.xmlbeans
.XmlObject
;
24 import org
.apache
.xmlbeans
.XmlOptions
;
25 import org
.apache
.xmlbeans
.XmlCursor
;
27 import org
.tianocore
.GuidDeclarationsDocument
;
29 import org
.tianocore
.LibraryClassDeclarationsDocument
;
31 import org
.tianocore
.ModuleTypeDef
;
32 import org
.tianocore
.MsaFilesDocument
;
33 import org
.tianocore
.PackageDefinitionsDocument
;
34 import org
.tianocore
.PackageHeadersDocument
;
35 import org
.tianocore
.PackageSurfaceAreaDocument
;
36 import org
.tianocore
.PcdDataTypes
;
37 import org
.tianocore
.PcdDeclarationsDocument
;
38 import org
.tianocore
.PpiDeclarationsDocument
;
39 import org
.tianocore
.ProtocolDeclarationsDocument
;
40 import org
.tianocore
.SpdHeaderDocument
;
41 import org
.tianocore
.GuidDeclarationsDocument
.GuidDeclarations
;
44 This class processes spd file contents such as add remove xml elements.
46 @since PackageEditor 1.0
49 public class SpdFileContents
{
51 private File file
= null;
53 private PackageSurfaceAreaDocument psad
= null;
55 private PackageSurfaceAreaDocument
.PackageSurfaceArea psaRoot
= null;
57 private SpdHeaderDocument
.SpdHeader spdHdr
= null;
59 private PackageDefinitionsDocument
.PackageDefinitions spdPkgDefs
= null;
61 private LibraryClassDeclarationsDocument
.LibraryClassDeclarations spdLibClassDeclarations
= null;
63 private MsaFilesDocument
.MsaFiles spdMsaFiles
= null;
65 private PackageHeadersDocument
.PackageHeaders spdModHdrs
= null;
67 private GuidDeclarationsDocument
.GuidDeclarations spdGuidDeclarations
= null;
69 private ProtocolDeclarationsDocument
.ProtocolDeclarations spdProtocolDeclarations
= null;
71 private PpiDeclarationsDocument
.PpiDeclarations spdPpiDeclarations
= null;
73 private PcdDeclarationsDocument
.PcdDeclarations spdPcdDefinitions
= null;
76 Constructor to create a new spd file
78 public SpdFileContents() {
80 psad
= PackageSurfaceAreaDocument
.Factory
.newInstance();
81 psaRoot
= psad
.addNewPackageSurfaceArea();
86 Constructor for existing document object
89 public SpdFileContents(PackageSurfaceAreaDocument
.PackageSurfaceArea psa
) {
91 spdHdr
= psaRoot
.getSpdHeader();
92 spdPkgDefs
= psaRoot
.getPackageDefinitions();
95 Constructor based on an existing spd file
97 @param f Existing spd file
99 public SpdFileContents(File f
) {
101 psad
= PackageSurfaceAreaDocument
.Factory
.parse(f
);
102 psaRoot
= psad
.getPackageSurfaceArea();
104 } catch (Exception e
) {
105 System
.out
.println(e
.toString());
110 Remove existing pcd definitions elements using XmlCursor
112 public void removeSpdPcdDefinition() {
113 XmlObject o
= psaRoot
.getPcdDeclarations();
116 XmlCursor cursor
= o
.newCursor();
118 spdPcdDefinitions
= null;
122 public void removeSpdPcdDefinition(int i
){
123 XmlObject o
= psaRoot
.getPcdDeclarations();
126 XmlCursor cursor
= o
.newCursor();
127 if (cursor
.toFirstChild()) {
128 for (int j
= 0; j
< i
; ++j
) {
129 cursor
.toNextSibling();
132 if (getSpdPcdDefinitionCount() == 0) {
141 Remove existing ppi declarations using XmlCursor
143 public void removeSpdPpiDeclaration() {
144 XmlObject o
= psaRoot
.getPpiDeclarations();
147 XmlCursor cursor
= o
.newCursor();
149 spdPpiDeclarations
= null;
153 public void removeSpdPpiDeclaration(int i
){
154 XmlObject o
= psaRoot
.getPpiDeclarations();
157 XmlCursor cursor
= o
.newCursor();
158 if (cursor
.toFirstChild()) {
159 for (int j
= 0; j
< i
; ++j
) {
160 cursor
.toNextSibling();
163 if (getSpdPpiDeclarationCount() == 0){
171 Remove existing protocols declarations using XmlCursor
173 public void removeSpdProtocolDeclaration() {
174 XmlObject o
= psaRoot
.getProtocolDeclarations();
177 XmlCursor cursor
= o
.newCursor();
179 spdProtocolDeclarations
= null;
183 public void removeSpdProtocolDeclaration(int i
) {
184 XmlObject o
= psaRoot
.getProtocolDeclarations();
187 XmlCursor cursor
= o
.newCursor();
188 if (cursor
.toFirstChild()) {
189 for (int j
= 0; j
< i
; ++j
) {
190 cursor
.toNextSibling();
193 if (getSpdProtocolDeclarationCount() == 0) {
201 Remove existing GUID declarations using XmlCursor
203 public void removeSpdGuidDeclaration() {
204 XmlObject o
= psaRoot
.getGuidDeclarations();
207 XmlCursor cursor
= o
.newCursor();
209 spdGuidDeclarations
= null;
213 public void removeSpdGuidDeclaration(int i
) {
214 XmlObject o
= psaRoot
.getGuidDeclarations();
217 XmlCursor cursor
= o
.newCursor();
218 if (cursor
.toFirstChild()) {
219 for (int j
= 0; j
< i
; ++j
) {
220 cursor
.toNextSibling();
223 if (getSpdGuidDeclarationCount() == 0) {
232 Remove existing spd package include files using XmlCursor
234 public void removeSpdPkgHeader() {
235 XmlObject o
= psaRoot
.getPackageHeaders();
238 XmlCursor cursor
= o
.newCursor();
244 public void removeSpdPkgHeader(int i
){
245 XmlObject o
= psaRoot
.getPackageHeaders();
248 XmlCursor cursor
= o
.newCursor();
249 if (cursor
.toFirstChild()) {
250 for (int j
= 0; j
< i
; ++j
) {
251 cursor
.toNextSibling();
254 if (getSpdPackageHeaderCount() == 0) {
263 Remove existing msa files using XmlCursor
265 public void removeSpdMsaFile() {
266 XmlObject o
= psaRoot
.getMsaFiles();
269 XmlCursor cursor
= o
.newCursor();
275 public void removeSpdMsaFile(int i
){
276 XmlObject o
= psaRoot
.getMsaFiles();
279 XmlCursor cursor
= o
.newCursor();
280 if (cursor
.toFirstChild()) {
281 for (int j
= 0; j
< i
; ++j
) {
282 cursor
.toNextSibling();
285 if (getSpdMsaFileCount() == 0) {
294 Remove existing library class declarations using XmlCursor
296 public void removeSpdLibClass() {
297 XmlObject o
= psaRoot
.getLibraryClassDeclarations();
300 XmlCursor cursor
= o
.newCursor();
302 spdLibClassDeclarations
= null;
306 public void removeSpdLibClass(int i
) {
307 XmlObject o
= psaRoot
.getLibraryClassDeclarations();
310 XmlCursor cursor
= o
.newCursor();
311 if (cursor
.toFirstChild()) {
312 for (int j
= 0; j
< i
; ++j
) {
313 cursor
.toNextSibling();
316 if (getSpdLibClassDeclarationCount() == 0) {
324 public void updateSpdLibClass(int i
, String lib
, String hdr
, String hlp
, String clsUsage
, String instanceVer
, String hdrAttribArch
, String hdrAttribModType
) {
325 XmlObject o
= psaRoot
.getLibraryClassDeclarations();
329 XmlCursor cursor
= o
.newCursor();
330 if (cursor
.toFirstChild()) {
331 for (int j
= 0; j
< i
; ++j
) {
332 cursor
.toNextSibling();
334 LibraryClassDeclarationsDocument
.LibraryClassDeclarations
.LibraryClass lc
= (LibraryClassDeclarationsDocument
.LibraryClassDeclarations
.LibraryClass
)cursor
.getObject();
336 lc
.setIncludeHeader(hdr
);
338 if (clsUsage
!= null) {
339 lc
.setRecommendedInstanceGuid(clsUsage
);
340 if (instanceVer
!= null){
341 lc
.setRecommendedInstanceVersion(instanceVer
);
343 if (lc
.isSetRecommendedInstanceVersion()) {
344 lc
.unsetRecommendedInstanceVersion();
348 if (lc
.isSetRecommendedInstanceGuid()) {
349 lc
.unsetRecommendedInstanceGuid();
351 if (lc
.isSetRecommendedInstanceVersion()) {
352 lc
.unsetRecommendedInstanceVersion();
356 if (stringToList(hdrAttribArch
) != null){
357 lc
.setSupArchList(stringToList(hdrAttribArch
));
359 if (lc
.isSetSupArchList()) {
360 lc
.unsetSupArchList();
363 if (stringToList(hdrAttribModType
) != null){
364 lc
.setSupModuleList(stringToList(hdrAttribModType
));
366 if (lc
.isSetSupModuleList()) {
367 lc
.unsetSupModuleList();
375 public void updateSpdMsaFile(int i
, String msaFile
, String mName
, String v
, String g
){
376 XmlObject o
= psaRoot
.getMsaFiles();
380 XmlCursor cursor
= o
.newCursor();
381 if (cursor
.toFirstChild()) {
382 for (int j
= 0; j
< i
; ++j
) {
383 cursor
.toNextSibling();
385 cursor
.setTextValue(msaFile
);
392 public void updateSpdGuidDecl(int i
, String name
, String cName
, String guid
, String hlp
, String archList
,
393 String modTypeList
, String guidTypeList
){
394 XmlObject o
= psaRoot
.getGuidDeclarations();
399 XmlCursor cursor
= o
.newCursor();
400 if (cursor
.toFirstChild()) {
401 for (int j
= 0; j
< i
; ++j
) {
402 cursor
.toNextSibling();
404 GuidDeclarationsDocument
.GuidDeclarations
.Entry e
= (GuidDeclarationsDocument
.GuidDeclarations
.Entry
)cursor
.getObject();
407 e
.setGuidValue(guid
);
409 if (stringToList(guidTypeList
) != null) {
410 e
.setGuidTypeList(stringToList(guidTypeList
));
413 if (e
.isSetGuidTypeList()) {
414 e
.unsetGuidTypeList();
417 if (stringToList(archList
) != null){
418 e
.setSupArchList(stringToList(archList
));
421 if (e
.isSetSupArchList()) {
422 e
.unsetSupArchList();
425 if (stringToList(modTypeList
) != null) {
426 e
.setSupModuleList(stringToList(modTypeList
));
429 if (e
.isSetSupModuleList()) {
430 e
.unsetSupModuleList();
438 public void updateSpdPpiDecl(int i
, String name
, String cName
, String guid
, String hlp
, String archList
,
440 XmlObject o
= psaRoot
.getPpiDeclarations();
445 XmlCursor cursor
= o
.newCursor();
446 if (cursor
.toFirstChild()) {
447 for (int j
= 0; j
< i
; ++j
) {
448 cursor
.toNextSibling();
450 PpiDeclarationsDocument
.PpiDeclarations
.Entry e
= (PpiDeclarationsDocument
.PpiDeclarations
.Entry
)cursor
.getObject();
453 e
.setGuidValue(guid
);
455 if (stringToList(archList
) != null){
456 e
.setSupArchList(stringToList(archList
));
459 if (e
.isSetSupArchList()) {
460 e
.unsetSupArchList();
463 if (stringToList(modTypeList
) != null) {
464 e
.setSupModuleList(stringToList(modTypeList
));
467 if (e
.isSetSupModuleList()) {
468 e
.unsetSupModuleList();
475 public void updateSpdProtocolDecl(int i
, String name
, String cName
, String guid
, String hlp
, String archList
,
477 XmlObject o
= psaRoot
.getProtocolDeclarations();
482 XmlCursor cursor
= o
.newCursor();
483 if (cursor
.toFirstChild()) {
484 for (int j
= 0; j
< i
; ++j
) {
485 cursor
.toNextSibling();
487 ProtocolDeclarationsDocument
.ProtocolDeclarations
.Entry e
= (ProtocolDeclarationsDocument
.ProtocolDeclarations
.Entry
)cursor
.getObject();
490 e
.setGuidValue(guid
);
492 if (stringToList(archList
) != null){
493 e
.setSupArchList(stringToList(archList
));
496 if (e
.isSetSupArchList()) {
497 e
.unsetSupArchList();
500 if (stringToList(modTypeList
) != null) {
501 e
.setSupModuleList(stringToList(modTypeList
));
504 if (e
.isSetSupModuleList()) {
505 e
.unsetSupModuleList();
512 public void updateSpdPkgHdr(int i
, String pkgName
, String hdrName
){
513 XmlObject o
= psaRoot
.getPackageHeaders();
518 XmlCursor cursor
= o
.newCursor();
519 if (cursor
.toFirstChild()) {
520 for (int j
= 0; j
< i
; ++j
) {
521 cursor
.toNextSibling();
524 PackageHeadersDocument
.PackageHeaders
.IncludePkgHeader iph
= (PackageHeadersDocument
.PackageHeaders
.IncludePkgHeader
)cursor
.getObject();
525 iph
.setModuleType(ModuleTypeDef
.Enum
.forString(pkgName
));
526 iph
.setStringValue(hdrName
);
531 public void updateSpdPcdDefinition(int i
, String cName
, String token
, String dataType
, String pcdItemTypes
,
532 String spaceGuid
, String defaultString
, String help
, String archList
, String modTypeList
){
533 XmlObject o
= psaRoot
.getPcdDeclarations();
536 XmlCursor cursor
= o
.newCursor();
537 if (cursor
.toFirstChild()) {
538 for (int j
= 0; j
< i
; ++j
) {
539 cursor
.toNextSibling();
541 PcdDeclarationsDocument
.PcdDeclarations
.PcdEntry e
= (PcdDeclarationsDocument
.PcdDeclarations
.PcdEntry
)cursor
.getObject();
544 e
.setDatumType(PcdDataTypes
.Enum
.forString(dataType
));
545 if (pcdItemTypes
!= null && pcdItemTypes
.length() > 0) {
546 String usage
[] = pcdItemTypes
.split("( )+");
547 List
<String
> l
= new ArrayList
<String
>();
548 for (int k
= 0; k
< usage
.length
; ++k
) {
554 e
.setTokenSpaceGuidCName(spaceGuid
);
555 e
.setDefaultValue(defaultString
);
557 if (stringToList(archList
) != null){
558 e
.setSupArchList(stringToList(archList
));
561 if (e
.isSetSupArchList()) {
562 e
.unsetSupArchList();
565 if (stringToList(modTypeList
) != null) {
566 e
.setSupModuleList(stringToList(modTypeList
));
569 if (e
.isSetSupModuleList()) {
570 e
.unsetSupModuleList();
578 Get spd file header contents into String array
580 @param s Caller allocated String array
582 public void getSpdHdrDetails(String
[] s
) {
583 if (getSpdHdr() == null) {
584 spdHdr
= psaRoot
.addNewSpdHeader();
586 s
[0] = getSpdHdrPkgName();
587 s
[1] = getSpdHdr().getGuidValue();
588 s
[2] = getSpdHdrVer();
589 // s[3] = getSpdHdr().getAbstract();
590 s
[4] = getSpdHdr().getDescription();
591 s
[5] = getSpdHdr().getCopyright();
592 s
[6] = getSpdHdrLicense();
597 Get the number of library class declarations from the size of List
601 public int getSpdLibClassDeclarationCount() {
602 if (psaRoot
.getLibraryClassDeclarations() == null
603 || psaRoot
.getLibraryClassDeclarations().getLibraryClassList() == null) {
606 return psaRoot
.getLibraryClassDeclarations().getLibraryClassList().size();
610 Get available library class declaration into String array
611 @param libClass Caller allocated two-dimentional String array
613 public void getSpdLibClassDeclarations(String
[][] libClass
) {
614 if (psaRoot
.getLibraryClassDeclarations() == null){
618 List
<LibraryClassDeclarationsDocument
.LibraryClassDeclarations
.LibraryClass
> l
= psaRoot
.getLibraryClassDeclarations().getLibraryClassList();
620 ListIterator li
= l
.listIterator();
621 while (li
.hasNext()) {
622 LibraryClassDeclarationsDocument
.LibraryClassDeclarations
.LibraryClass lc
= (LibraryClassDeclarationsDocument
.LibraryClassDeclarations
.LibraryClass
) li
.next();
624 libClass
[i
][0] = lc
.getName();
625 libClass
[i
][1] = lc
.getIncludeHeader();
626 libClass
[i
][2] = lc
.getHelpText();
627 // LAH added logic so you cannot set the version unless the GUID is defined.
628 /* LAH do not set now
629 if (lc.getRecommendedInstanceGuid() != null) {
630 libClass[i][3] = lc.getRecommendedInstanceGuid();
631 if (lc.getRecommendedInstanceVersion() != null) {
632 libClass[i][4] = lc.getRecommendedInstanceVersion();
636 if (lc
.getSupArchList() != null) {
637 libClass
[i
][5] = listToString(lc
.getSupArchList());
639 if (lc
.getSupModuleList() != null) {
640 libClass
[i
][6] = listToString(lc
.getSupModuleList());
651 Get the number of Msa files from the size of List
655 public int getSpdMsaFileCount() {
656 if (psaRoot
.getMsaFiles() == null || psaRoot
.getMsaFiles().getFilenameList() == null) {
659 return psaRoot
.getMsaFiles().getFilenameList().size();
663 Get available Msa file into String array
665 @param msaFile Caller allocated two-dimentional String array
667 public void getSpdMsaFiles(String
[][] msaFile
) {
668 if (psaRoot
.getMsaFiles() == null) {
671 List
<String
> l
= psaRoot
.getMsaFiles().getFilenameList();
673 ListIterator li
= l
.listIterator();
674 while (li
.hasNext()) {
675 msaFile
[i
][0] = (String
)li
.next();
682 Get the number of include header files in PackageHeaders from the size of List
686 public int getSpdPackageHeaderCount() {
687 if (psaRoot
.getPackageHeaders() == null || psaRoot
.getPackageHeaders().getIncludePkgHeaderList() == null) {
690 return psaRoot
.getPackageHeaders().getIncludePkgHeaderList().size();
694 Get available package header contents into String array
696 @param pkgHeader Caller allocated two-dimentional String array
698 public void getSpdPackageHeaders(String
[][] pkgHeader
) {
699 if (psaRoot
.getPackageHeaders() == null) {
703 List
<PackageHeadersDocument
.PackageHeaders
.IncludePkgHeader
> l
= psaRoot
.getPackageHeaders().getIncludePkgHeaderList();
705 ListIterator li
= l
.listIterator();
706 while (li
.hasNext()) {
707 PackageHeadersDocument
.PackageHeaders
.IncludePkgHeader ih
= (PackageHeadersDocument
.PackageHeaders
.IncludePkgHeader
) li
.next();
708 if (ih
.getModuleType() != null) {
709 pkgHeader
[i
][0] = ih
.getModuleType().toString();
712 pkgHeader
[i
][1] = ih
.getStringValue();
718 Get the number of GUID declarations from the size of List
722 public int getSpdGuidDeclarationCount() {
723 if (psaRoot
.getGuidDeclarations() == null || psaRoot
.getGuidDeclarations().getEntryList() == null) {
726 return psaRoot
.getGuidDeclarations().getEntryList().size();
730 Get available Guid declaration contents into String array
732 @param guid Caller allocated two-dimentional String array
734 public void getSpdGuidDeclarations(String
[][] guid
) {
735 if (psaRoot
.getGuidDeclarations() == null) {
739 List
<GuidDeclarationsDocument
.GuidDeclarations
.Entry
> l
= psaRoot
.getGuidDeclarations().getEntryList();
741 ListIterator li
= l
.listIterator();
742 while (li
.hasNext()) {
743 GuidDeclarationsDocument
.GuidDeclarations
.Entry e
= (GuidDeclarationsDocument
.GuidDeclarations
.Entry
) li
745 guid
[i
][0] = e
.getName();
746 guid
[i
][1] = e
.getCName();
747 if (e
.getGuidValue() != null) {
748 guid
[i
][2] = e
.getGuidValue();
750 guid
[i
][3] = e
.getHelpText();
751 guid
[i
][4] = listToString(e
.getSupArchList());
752 guid
[i
][5] = listToString(e
.getSupModuleList());
753 guid
[i
][6] = listToString(e
.getGuidTypeList());
759 Get the number of protocol declarations from the size of List
763 public int getSpdProtocolDeclarationCount() {
764 if (psaRoot
.getProtocolDeclarations() == null || psaRoot
.getProtocolDeclarations().getEntryList() == null) {
767 return psaRoot
.getProtocolDeclarations().getEntryList().size();
771 Get available protocol declaration contents into String array
773 @param protocol Caller allocated two-dimentional String array
775 public void getSpdProtocolDeclarations(String
[][] protocol
) {
776 if (psaRoot
.getProtocolDeclarations() == null) {
780 List
<ProtocolDeclarationsDocument
.ProtocolDeclarations
.Entry
> l
= psaRoot
.getProtocolDeclarations()
783 ListIterator li
= l
.listIterator();
784 while (li
.hasNext()) {
785 ProtocolDeclarationsDocument
.ProtocolDeclarations
.Entry e
= (ProtocolDeclarationsDocument
.ProtocolDeclarations
.Entry
) li
787 protocol
[i
][0] = e
.getName();
788 protocol
[i
][1] = e
.getCName();
789 if (e
.getGuidValue() != null) {
790 protocol
[i
][2] = e
.getGuidValue();
792 protocol
[i
][3] = e
.getHelpText();
793 protocol
[i
][4] = listToString(e
.getSupArchList());
794 protocol
[i
][5] = listToString(e
.getSupModuleList());
800 Get the number of Ppi declarations from the size of List
804 public int getSpdPpiDeclarationCount() {
805 if (psaRoot
.getPpiDeclarations() == null || psaRoot
.getPpiDeclarations().getEntryList() == null) {
808 return psaRoot
.getPpiDeclarations().getEntryList().size();
812 Get available Ppi declaration contents into String array
814 @param ppi Caller allocated two-dimentional String array
816 public void getSpdPpiDeclarations(String
[][] ppi
) {
817 if (psaRoot
.getPpiDeclarations() == null) {
821 List
<PpiDeclarationsDocument
.PpiDeclarations
.Entry
> l
= psaRoot
.getPpiDeclarations().getEntryList();
823 ListIterator li
= l
.listIterator();
824 while (li
.hasNext()) {
825 PpiDeclarationsDocument
.PpiDeclarations
.Entry e
= (PpiDeclarationsDocument
.PpiDeclarations
.Entry
) li
.next();
826 ppi
[i
][0] = e
.getName();
827 ppi
[i
][1] = e
.getCName();
828 if (e
.getGuidValue() != null) {
829 ppi
[i
][2] = e
.getGuidValue();
831 ppi
[i
][3] = e
.getHelpText();
832 ppi
[i
][4] = listToString(e
.getSupArchList());
833 ppi
[i
][5] = listToString(e
.getSupModuleList());
840 Get the number of Pcd definitions from the size of List
844 public int getSpdPcdDefinitionCount() {
845 if (psaRoot
.getPcdDeclarations() == null || psaRoot
.getPcdDeclarations().getPcdEntryList() == null) {
848 return psaRoot
.getPcdDeclarations().getPcdEntryList().size();
852 Get available Pcd definition contents into String array
854 @param pcd Caller allocated two-dimentional String array
856 public void getSpdPcdDefinitions(String
[][] pcd
, String pcdUsage
[][]) {
857 if (psaRoot
.getPcdDeclarations() == null) {
861 List
<PcdDeclarationsDocument
.PcdDeclarations
.PcdEntry
> l
= psaRoot
.getPcdDeclarations().getPcdEntryList();
863 while (i
< l
.size()) {
864 PcdDeclarationsDocument
.PcdDeclarations
.PcdEntry e
= (PcdDeclarationsDocument
.PcdDeclarations
.PcdEntry
)l
.get(i
);
865 pcd
[i
][0] = e
.getCName();
866 pcd
[i
][1] = e
.getToken() + "";
867 pcd
[i
][2] = e
.getTokenSpaceGuidCName();
868 if (e
.getDatumType() != null) {
869 pcd
[i
][3] = e
.getDatumType().toString();
871 pcd
[i
][4] = e
.getDefaultValue()+"";
872 pcd
[i
][5] = e
.getHelpText();
873 String archList
= listToString(e
.getSupArchList());
874 if (archList
!= null) {
875 pcd
[i
][6] = archList
;
877 String modTypeList
= listToString(e
.getSupModuleList());
878 if (modTypeList
!= null) {
879 pcd
[i
][7] = modTypeList
;
883 while (j
< e
.getValidUsage().size() && j
< 5) {
884 pcdUsage
[i
][j
] = (String
)e
.getValidUsage().get(j
);
892 Save the processed xml contents to file
894 @param spdFile The file to save xml contents
895 @throws IOException Exceptions during file operation
897 public void saveAs(File spdFile
) throws IOException
{
899 XmlOptions options
= new XmlOptions();
901 options
.setCharacterEncoding("UTF-8");
902 options
.setSavePrettyPrint();
903 options
.setSavePrettyPrintIndent(2);
905 psad
.save(spdFile
, options
);
906 } catch (IOException e
) {
913 Generate SpdHeader contents using parameters passed in.
915 @param pkgName PackageName
917 @param pkgVer Version
918 @param pkgAbs Abstract
919 @param pkgDes Description
920 @param pkgCpRight Copyright
921 @param pkgLicense License
922 @param pkgCreateDate Created
923 @param pkgUpdateDate Updated
925 @param pkgType PackageType
926 @param pkgRdOnly ReadOnly
927 @param pkgRePkg RePackage
928 @param pkgSpec Reserved
929 @param pkgOutDir Reserved
931 public void genSpdHeader(String pkgName
, String pkgGuid
, String pkgVer
, String pkgAbs
, String pkgDes
,
932 String pkgCpRight
, String pkgLicense
, String pkgCreateDate
, String pkgUpdateDate
,
933 String pkgURL
, String pkgType
, String pkgRdOnly
, String pkgRePkg
, String pkgSpec
,
935 if (getSpdHdr() == null) {
936 spdHdr
= psaRoot
.addNewSpdHeader();
939 setSpdHdrPkgName(pkgName
);
940 setSpdHdrGuidValue(pkgGuid
);
941 setSpdHdrVer(pkgVer
);
942 setSpdHdrAbs(pkgAbs
);
943 setSpdHdrDescription(pkgDes
);
944 setSpdHdrCopyright(pkgCpRight
);
945 setSpdHdrLicense(pkgLicense
);
948 setSpdHdrSpec(pkgSpec
);
952 Generate library class declaration element using parameters passed in
954 @param libClassBaseName LibraryClass element value
955 @param libClassUsage Reserved
956 @param incHdrFileName IncludeHeader element value
957 @param incHdrAttribGuid Reserved
958 @param incHdrAttribArch Reserved
959 @param incHdrAttribPath Reserved
960 @param incHdrAttribClass Reserved
961 @param incHdrAttribVer Reserved
962 @param incHdrAttribOverrideID Reserved
963 @param incHdrAttribModuleType Reserved
965 public void genSpdLibClassDeclarations(String libClassBaseName
, String instanceUsage
, String incHdrFileName
,
966 String help
, String incHdrAttribArch
, String incHdrAttribPath
,
967 String incHdrAttribClass
, String incHdrAttribVer
,
968 String incHdrAttribOverrideID
, String incHdrAttribModuleType
) {
969 if (getSpdLibClassDeclarations() == null) {
970 spdLibClassDeclarations
= psaRoot
.addNewLibraryClassDeclarations();
973 // add contents under LibraryClassDeclarations tag
975 setSpdLibClassDeclaration(libClassBaseName
, instanceUsage
, incHdrFileName
, help
, incHdrAttribArch
,
976 incHdrAttribPath
, incHdrAttribClass
, incHdrAttribVer
, incHdrAttribOverrideID
,
977 incHdrAttribModuleType
, spdLibClassDeclarations
);
981 Set library class declaration contents under parent tag
983 @param clsName LibraryClass element value
984 @param clsUsage Reserved
985 @param hdrFile IncludeHeader element value
986 @param hdrAttribGuid Reserved
987 @param hdrAttribArch Reserved
988 @param hdrAttribPath Reserved
989 @param hdrAttribClass Reserved
990 @param hdrAttribVer Reserved
991 @param hdrAttribOverID Reserved
992 @param hdrAttribModType Reserved
993 @param parent The tag under which library class declaration goes to
995 public void setSpdLibClassDeclaration(String clsName
, String clsUsage
, String hdrFile
, String help
,
996 String hdrAttribArch
, String hdrAttribPath
, String hdrAttribClass
,
997 String instanceVer
, String hdrAttribOverID
, String hdrAttribModType
,
1000 setSpdLibraryClass(clsName
, hdrFile
, help
, clsUsage
, instanceVer
, hdrAttribArch
, hdrAttribModType
, parent
);
1005 Set the contents of LibraryClass under parent element
1007 @param clsName LibraryClass element value
1008 @param clsUsage Reserved
1009 @param parent The tag under which library class declaration goes to
1011 public void setSpdLibraryClass(String clsName
, String clsIncludeFile
, String help
, String clsUsage
, String instanceVer
, String hdrAttribArch
, String hdrAttribModType
, XmlObject parent
) {
1012 LibraryClassDeclarationsDocument
.LibraryClassDeclarations
.LibraryClass lc
= ((LibraryClassDeclarationsDocument
.LibraryClassDeclarations
) parent
).addNewLibraryClass();
1013 lc
.setName(clsName
);
1014 lc
.setIncludeHeader(clsIncludeFile
);
1015 lc
.setHelpText(help
);
1016 // LAH added logic so you cannot set the version unless the GUID is defined.
1018 if (clsUsage
!= null) {
1019 lc
.setRecommendedInstanceGuid(clsUsage
);
1020 if (instanceVer
!= null) {
1021 lc
.setRecommendedInstanceVersion(instanceVer
);
1025 if (lc
.isSetRecommendedInstanceGuid()) {
1026 lc
.unsetRecommendedInstanceGuid();
1028 if (lc
.isSetRecommendedInstanceVersion()) {
1029 lc
.unsetRecommendedInstanceVersion();
1033 if (hdrAttribArch
!= null) {
1034 lc
.setSupArchList(stringToList(hdrAttribArch
));
1036 if (lc
.isSetSupArchList()) {
1037 lc
.unsetSupArchList();
1041 if (hdrAttribModType
!= null) {
1042 lc
.setSupModuleList(stringToList(hdrAttribModType
));
1044 if (lc
.isSetSupModuleList()) {
1045 lc
.unsetSupModuleList();
1052 Set contents of IncludeHeader under parent element
1054 @param modType Reserved
1055 @param hdrFile IncludeHeader element value
1056 @param hdrAttribGuid Reserved
1057 @param hdrAttribArch Reserved
1058 @param hdrAttribPath Reserved
1059 @param hdrAttribClass Reserved
1060 @param hdrAttribVer Reserved
1061 @param hdrAttribOverID Reserved
1062 @param parent The tag under which library class declaration goes to
1064 public void setSpdIncludeHeader(String modType
, String hdrFile
, String hdrAttribGuid
, String hdrAttribArch
,
1065 String hdrAttribPath
, String hdrAttribClass
, String hdrAttribVer
,
1066 String hdrAttribOverID
, XmlObject parent
) {
1068 if (parent
instanceof LibraryClassDeclarationsDocument
.LibraryClassDeclarations
) {
1069 } else if (parent
instanceof PackageHeadersDocument
.PackageHeaders
) {
1070 PackageHeadersDocument
.PackageHeaders
.IncludePkgHeader ih
= null;
1071 ih
= ((PackageHeadersDocument
.PackageHeaders
) parent
).addNewIncludePkgHeader();
1072 ih
.setStringValue(hdrFile
);
1073 ih
.setModuleType(ModuleTypeDef
.Enum
.forString(modType
));
1078 if (hdrAttribGuid
!= null) {
1080 if (hdrAttribPath
!= null) {
1082 if (hdrAttribClass
!= null) {
1084 if (hdrAttribVer
!= null) {
1086 if (hdrAttribOverID
!= null) {
1092 Generate MsaFile element.
1094 @param msaFileName MsaFile element value
1095 @param archType Reserved
1097 public void genSpdMsaFiles(String msaFileName
, String moduleName
, String ver
, String guid
) {
1098 if (getSpdMsaFiles() == null) {
1099 spdMsaFiles
= psaRoot
.addNewMsaFiles();
1101 setSpdMsaFile(msaFileName
, moduleName
, ver
, guid
, spdMsaFiles
);
1106 Set MsaFile contents under parent element.
1108 @param msaFileName MsaFile element value
1109 @param parent Element under which MsaFile goes to
1111 public void setSpdMsaFile(String msaFileName
, String moduleName
, String ver
, String guid
, XmlObject parent
) {
1112 MsaFilesDocument
.MsaFiles f
= (MsaFilesDocument
.MsaFiles
)parent
;
1113 f
.addNewFilename().setStringValue(msaFileName
);
1114 // f.setFilename(msaFileName);
1115 // f.setModuleName(moduleName);
1116 // f.setModuleVersion(ver);
1117 // f.setModuleGuid(guid);
1121 Generate PackageHeader element using parameters passed in.
1123 @param ModHdrModType ModuleType attribute of IncludeHeader element
1124 @param hdrFile IncludeHeader element value
1125 @param hdrAttribGuid Reserved
1126 @param hdrAttribArch Reserved
1127 @param hdrAttribPath Reserved
1128 @param hdrAttribClass Reserved
1129 @param hdrAttribVer Reserved
1130 @param hdrAttribOverID Reserved
1132 public void genSpdModuleHeaders(String ModHdrModType
, String hdrFile
, String hdrAttribGuid
, String hdrAttribArch
,
1133 String hdrAttribPath
, String hdrAttribClass
, String hdrAttribVer
,
1134 String hdrAttribOverID
) {
1135 if (getSpdModHdrs() == null) {
1136 spdModHdrs
= psaRoot
.addNewPackageHeaders();
1140 // add IncludeHeader under PackageHeaders element
1142 setSpdIncludeHeader(ModHdrModType
, hdrFile
, hdrAttribGuid
, hdrAttribArch
, hdrAttribPath
, hdrAttribClass
,
1143 hdrAttribVer
, hdrAttribOverID
, spdModHdrs
);
1147 Generate GUID declaration element using parameters passed in.
1149 @param guidDeclEntryName Name attribute of Entry element
1150 @param guidDeclCName CName element value
1151 @param guidDeclGuid Guid element value
1152 @param guidDeclFeatureFlag Reserved
1154 public void genSpdGuidDeclarations(String guidDeclEntryName
, String guidDeclCName
, String guidDeclGuid
,
1155 String guidDeclHelp
, Vector
<String
> archList
, Vector
<String
> modTypeList
,
1156 Vector
<String
> guidTypeList
) {
1157 if (getSpdGuidDeclarations() == null) {
1158 spdGuidDeclarations
= psaRoot
.addNewGuidDeclarations();
1161 setSpdEntry(guidDeclEntryName
, guidDeclCName
, guidDeclGuid
, guidDeclHelp
, archList
, modTypeList
, guidTypeList
, spdGuidDeclarations
);
1165 Generate protocol declaration element using parameters passed in.
1167 @param protocolDeclEntryName Name attribute of Entry element
1168 @param protocolDeclCName CName element value
1169 @param protocolDeclGuid Guid element value
1170 @param protocolDeclFeatureFlag Reserved
1172 public void genSpdProtocolDeclarations(String protocolDeclEntryName
, String protocolDeclCName
,
1173 String protocolDeclGuid
, String protocolDeclFeatureFlag
,
1174 Vector
<String
> archList
, Vector
<String
> modTypeList
) {
1175 if (getSpdProtocolDeclarations() == null) {
1176 spdProtocolDeclarations
= psaRoot
.addNewProtocolDeclarations();
1179 setSpdEntry(protocolDeclEntryName
, protocolDeclCName
, protocolDeclGuid
, protocolDeclFeatureFlag
,
1180 archList
, modTypeList
, null, spdProtocolDeclarations
);
1184 Generate PPI declaration element using parameters passed in.
1186 @param ppiDeclEntryName Name attribute of Entry element
1187 @param ppiDeclCName CName element value
1188 @param ppiDeclGuid Guid element value
1189 @param ppiDeclFeatureFlag Reserved
1191 public void genSpdPpiDeclarations(String ppiDeclEntryName
, String ppiDeclCName
, String ppiDeclGuid
,
1192 String ppiDeclFeatureFlag
, Vector
<String
> archList
, Vector
<String
> modTypeList
) {
1193 if (getSpdPpiDeclarations() == null) {
1194 spdPpiDeclarations
= psaRoot
.addNewPpiDeclarations();
1197 setSpdEntry(ppiDeclEntryName
, ppiDeclCName
, ppiDeclGuid
, ppiDeclFeatureFlag
, archList
, modTypeList
, null, spdPpiDeclarations
);
1201 Set Entry contents using parameters passed in
1203 @param entryName Name attribute of Entry element
1204 @param cName CName element value
1205 @param guid Guid element value
1206 @param featureFlag Reserved
1207 @param parent The tag under which Entry element goes to
1209 public void setSpdEntry(String entryName
, String cName
, String guid
, String help
,
1210 Vector
<String
> archList
, Vector
<String
> modTypeList
,
1211 Vector
<String
> guidTypeList
, XmlObject parent
) {
1213 if (parent
instanceof GuidDeclarationsDocument
.GuidDeclarations
) {
1214 GuidDeclarationsDocument
.GuidDeclarations
.Entry e
= ((GuidDeclarations
) parent
).addNewEntry();
1215 e
.setName(entryName
);
1217 e
.setGuidValue(guid
);
1218 e
.setHelpText(help
);
1219 e
.setGuidTypeList(guidTypeList
);
1220 e
.setSupArchList(archList
);
1221 e
.setSupModuleList(modTypeList
);
1222 // if (guidTypeList != null && guidTypeList.size() > 0) {
1223 // e.setGuidTypeList(new ArrayList<String>(guidTypeList));
1225 // if (archList != null && archList.size() > 0){
1226 // e.setSupArchList(new ArrayList<String>(archList));
1228 // if (modTypeList != null && modTypeList.size() > 0) {
1229 // e.setSupModuleList(new ArrayList<String>(modTypeList));
1233 if (parent
instanceof ProtocolDeclarationsDocument
.ProtocolDeclarations
) {
1234 ProtocolDeclarationsDocument
.ProtocolDeclarations
.Entry pe
= ((ProtocolDeclarationsDocument
.ProtocolDeclarations
) parent
)
1236 pe
.setName(entryName
);
1238 pe
.setGuidValue(guid
);
1239 pe
.setHelpText(help
);
1240 pe
.setSupArchList(archList
);
1241 pe
.setSupModuleList(modTypeList
);
1242 // if (archList != null && archList.size() > 0){
1243 // pe.setSupArchList(new ArrayList<String>(archList));
1245 // if (modTypeList != null && modTypeList.size() > 0) {
1246 // pe.setSupModuleList(new ArrayList<String>(modTypeList));
1250 if (parent
instanceof PpiDeclarationsDocument
.PpiDeclarations
) {
1251 PpiDeclarationsDocument
.PpiDeclarations
.Entry ppe
= ((PpiDeclarationsDocument
.PpiDeclarations
) parent
)
1253 ppe
.setName(entryName
);
1254 ppe
.setCName(cName
);
1255 ppe
.setGuidValue(guid
);
1256 ppe
.setHelpText(help
);
1257 ppe
.setSupArchList(archList
);
1258 ppe
.setSupModuleList(modTypeList
);
1259 // if (archList != null && archList.size() > 0){
1260 // ppe.setSupArchList(new ArrayList<String>(archList));
1262 // if (archList != null && modTypeList.size() > 0) {
1263 // ppe.setSupModuleList(new ArrayList<String>(modTypeList));
1273 Generate Pcd definition using parameters passed in
1275 @param pcdItemTypes ItemType attribute of PcdEntry element
1276 @param cName C_Name element value
1277 @param token Token element value
1278 @param dataType DatumType element value
1279 @param skuEnable Reserved
1281 @param maxSku Reserved
1282 @param hiiEnable Reserved
1283 @param varGuid Reserved
1284 @param varName Reserved
1285 @param defaultString DefaultString element value
1287 public void genSpdPcdDefinitions(String cName
, String token
, String dataType
, String pcdItemTypes
,
1288 String spaceGuid
, String defaultString
, String help
, String archList
,
1289 String modTypeList
) {
1290 if (getSpdPcdDefinitions() == null) {
1291 spdPcdDefinitions
= psaRoot
.addNewPcdDeclarations();
1294 setSpdPcdEntry(pcdItemTypes
, cName
, token
, dataType
, spaceGuid
, help
,
1295 defaultString
, archList
, modTypeList
, spdPcdDefinitions
);
1299 Set Pcd entry contents under parent tag
1301 @param pcdItemTypes ItemType attribute of PcdEntry element
1302 @param cName C_Name element value
1303 @param token Token element value
1304 @param dataType DatumType element value
1305 @param spaceGuid Reserved
1306 @param help Reserved
1307 @param defaultString DefaultString element value
1308 @param parent Tag under which PcdEntry goes to
1310 public void setSpdPcdEntry(String pcdItemTypes
, String cName
, String token
, String dataType
, String spaceGuid
, String help
,
1311 String defaultString
, String archList
, String modTypeList
, XmlObject parent
) {
1313 PcdDeclarationsDocument
.PcdDeclarations
.PcdEntry pe
= ((PcdDeclarationsDocument
.PcdDeclarations
) parent
).addNewPcdEntry();
1315 //ToDo: maybe multiple types in, need parse pcdItemTypes.
1316 String usage
[] = pcdItemTypes
.split("( )+");
1317 List
<String
> l
= new ArrayList
<String
>();
1318 for (int i
= 0; i
< usage
.length
; ++i
) {
1321 pe
.setValidUsage(l
);
1324 pe
.setDatumType(PcdDataTypes
.Enum
.forString(dataType
));
1325 pe
.setDefaultValue(defaultString
);
1326 pe
.setTokenSpaceGuidCName(spaceGuid
);
1327 pe
.setHelpText(help
);
1328 if (archList
!= null){
1329 pe
.setSupArchList(stringToList(archList
));
1331 if (pe
.isSetSupArchList()) {
1332 pe
.unsetSupArchList();
1335 if (modTypeList
!= null){
1336 pe
.setSupModuleList(stringToList(modTypeList
));
1338 if (pe
.isSetSupModuleList()) {
1339 pe
.unsetSupModuleList();
1345 Get PpiDeclarations element
1347 @return PpiDeclarationsDocument.PpiDeclarations
1349 public PpiDeclarationsDocument
.PpiDeclarations
getSpdPpiDeclarations() {
1350 if (spdPpiDeclarations
== null) {
1351 spdPpiDeclarations
= psaRoot
.getPpiDeclarations();
1353 return spdPpiDeclarations
;
1357 Get ProtocolDeclarations element
1359 @return ProtocolDeclarationsDocument.ProtocolDeclarations
1361 public ProtocolDeclarationsDocument
.ProtocolDeclarations
getSpdProtocolDeclarations() {
1362 if (spdProtocolDeclarations
== null) {
1363 spdProtocolDeclarations
= psaRoot
.getProtocolDeclarations();
1365 return spdProtocolDeclarations
;
1369 Get GuidDeclarations element
1371 @return GuidDeclarationsDocument.GuidDeclarations
1373 public GuidDeclarationsDocument
.GuidDeclarations
getSpdGuidDeclarations() {
1374 if (spdGuidDeclarations
== null) {
1375 spdGuidDeclarations
= psaRoot
.getGuidDeclarations();
1377 return spdGuidDeclarations
;
1381 Get PcdDefinitions element
1383 @return PcdDefinitionsDocument.PcdDefinitions
1385 public PcdDeclarationsDocument
.PcdDeclarations
getSpdPcdDefinitions() {
1386 if (spdPcdDefinitions
== null) {
1387 spdPcdDefinitions
= psaRoot
.getPcdDeclarations();
1389 return spdPcdDefinitions
;
1393 Get PackageHeaders element
1395 @return PackageHeadersDocument.PackageHeaders
1397 public PackageHeadersDocument
.PackageHeaders
getSpdModHdrs() {
1398 if (spdModHdrs
== null) {
1399 spdModHdrs
= psaRoot
.getPackageHeaders();
1405 Get MsaFiles element
1407 @return MsaFilesDocument.MsaFiles
1409 public MsaFilesDocument
.MsaFiles
getSpdMsaFiles() {
1410 if (spdMsaFiles
== null) {
1411 spdMsaFiles
= psaRoot
.getMsaFiles();
1417 Get LibraryClassDeclarations element
1419 @return LibraryClassDeclarationsDocument.LibraryClassDeclarations
1421 public LibraryClassDeclarationsDocument
.LibraryClassDeclarations
getSpdLibClassDeclarations() {
1422 if (spdLibClassDeclarations
== null) {
1423 spdLibClassDeclarations
= psaRoot
.getLibraryClassDeclarations();
1425 return spdLibClassDeclarations
;
1428 public PackageDefinitionsDocument
.PackageDefinitions
getSpdPkgDefs() {
1429 if (spdPkgDefs
== null) {
1430 spdPkgDefs
= psaRoot
.addNewPackageDefinitions();
1435 Get SpdHeader element
1437 @return SpdHeaderDocument.SpdHeader
1439 public SpdHeaderDocument
.SpdHeader
getSpdHdr() {
1440 if (spdHdr
== null) {
1441 spdHdr
= psaRoot
.addNewSpdHeader();
1447 Set value to Guid element
1449 @param guid The value set to Guid element
1451 public void setSpdHdrGuidValue(String guid
) {
1452 getSpdHdr().setGuidValue(guid
);
1456 Get Version element under SpdHdr
1460 public String
getSpdHdrVer() {
1461 return getSpdHdr().getVersion();
1465 Set value to Version element
1467 @param ver The value set to Version element
1469 public void setSpdHdrVer(String ver
) {
1470 getSpdHdr().setVersion(ver
);
1473 public String
getSpdHdrAbs(){
1474 return getSpdHdr().getAbstract();
1479 Set value to Abstract element
1481 @param abs The value set to Abstract element
1483 public void setSpdHdrAbs(String abs
) {
1485 getSpdHdr().setAbstract(abs
);
1488 public String
getSpdHdrDescription(){
1489 return getSpdHdr().getDescription();
1492 Set value to Description element
1494 @param des The value set to Description element
1496 public void setSpdHdrDescription(String des
) {
1497 getSpdHdr().setDescription(des
);
1500 public String
getSpdHdrCopyright(){
1501 return getSpdHdr().getCopyright();
1504 Set value to Copyright element
1506 @param cpRit The value set to Copyright element
1508 public void setSpdHdrCopyright(String cpRit
) {
1510 getSpdHdr().setCopyright(cpRit
);
1514 Get License element under SpdHdr
1518 public String
getSpdHdrLicense() {
1519 if (getSpdHdr().getLicense() != null) {
1520 return getSpdHdr().getLicense().getStringValue();
1526 Set value to License element
1528 @param license The value set to License element
1530 public void setSpdHdrLicense(String license
) {
1531 if (getSpdHdr().getLicense() == null){
1532 getSpdHdr().addNewLicense().setStringValue(license
);
1535 getSpdHdr().getLicense().setStringValue(license
);
1539 public String
getSpdHdrUrl(){
1540 if (getSpdHdr().getLicense() != null) {
1541 return getSpdHdr().getLicense().getURL();
1546 public void setSpdHdrUrl(String url
){
1547 getSpdHdr().getLicense().setURL(url
);
1551 Get PackageName element under SpdHdr
1555 public String
getSpdHdrPkgName() {
1557 return getSpdHdr().getPackageName();
1561 Set value to PackageName element
1563 @param pkgName The value set to PackageName element
1565 public void setSpdHdrPkgName(String pkgName
) {
1566 getSpdHdr().setPackageName(pkgName
);
1569 public String
getSpdHdrGuidValue(){
1570 return getSpdHdr().getGuidValue();
1576 @return SpecificationDocument.Specification
1578 public String
getSpdHdrSpec() {
1579 return "FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052";
1580 // return getSpdHdr().getSpecification();
1588 public void setSpdHdrSpec(String spec
) {
1589 spec
= "FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052";
1590 getSpdHdr().setSpecification(spec
);
1594 public String
getSpdPkgDefsRdOnly(){
1595 return getSpdPkgDefs().getReadOnly() + "";
1598 Set value to ReadOnly element
1600 @param rdOnly The value set to ReadOnly element
1602 public void setSpdPkgDefsRdOnly(String rdOnly
) {
1604 getSpdPkgDefs().setReadOnly(new Boolean(rdOnly
));
1607 public String
getSpdPkgDefsRePkg(){
1608 return getSpdPkgDefs().getRePackage() + "";
1611 Set value to RePackage element
1613 @param rePkg The value set to RePackage element
1615 public void setSpdPkgDefsRePkg(String rePkg
) {
1617 getSpdPkgDefs().setRePackage(new Boolean(rePkg
));
1621 Set value to URL element
1623 @param url The value set to URL element
1625 // public void setSpdHdrURL(String url) {
1626 // getSpdHdr().setURL(url);
1634 public File
getFile() {
1641 @param file File with xml format
1643 public void setFile(File file
) {
1647 private List
<String
> stringToList(String s
){
1648 if (s
== null || s
.length() == 0) {
1651 Vector
<String
> al
= new Vector
<String
>();
1652 String
[] sArray
= s
.split(" ");
1653 for(int i
= 0; i
< sArray
.length
; ++i
){
1659 private String
listToString(List l
) {
1664 ListIterator li
= l
.listIterator();
1665 while(li
.hasNext()) {