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();
353 if (stringToList(hdrAttribArch
) != null){
354 lc
.setSupArchList(stringToList(hdrAttribArch
));
356 if (lc
.isSetSupArchList()) {
357 lc
.unsetSupArchList();
360 if (stringToList(hdrAttribModType
) != null){
361 lc
.setSupModuleList(stringToList(hdrAttribModType
));
363 if (lc
.isSetSupModuleList()) {
364 lc
.unsetSupModuleList();
372 public void updateSpdMsaFile(int i
, String msaFile
, String mName
, String v
, String g
){
373 XmlObject o
= psaRoot
.getMsaFiles();
377 XmlCursor cursor
= o
.newCursor();
378 if (cursor
.toFirstChild()) {
379 for (int j
= 0; j
< i
; ++j
) {
380 cursor
.toNextSibling();
382 cursor
.setTextValue(msaFile
);
389 public void updateSpdGuidDecl(int i
, String name
, String cName
, String guid
, String hlp
, String archList
,
390 String modTypeList
, String guidTypeList
){
391 XmlObject o
= psaRoot
.getGuidDeclarations();
396 XmlCursor cursor
= o
.newCursor();
397 if (cursor
.toFirstChild()) {
398 for (int j
= 0; j
< i
; ++j
) {
399 cursor
.toNextSibling();
401 GuidDeclarationsDocument
.GuidDeclarations
.Entry e
= (GuidDeclarationsDocument
.GuidDeclarations
.Entry
)cursor
.getObject();
404 e
.setGuidValue(guid
);
406 if (stringToList(guidTypeList
) != null) {
407 e
.setGuidTypeList(stringToList(guidTypeList
));
410 if (e
.isSetGuidTypeList()) {
411 e
.unsetGuidTypeList();
414 if (stringToList(archList
) != null){
415 e
.setSupArchList(stringToList(archList
));
418 if (e
.isSetSupArchList()) {
419 e
.unsetSupArchList();
422 if (stringToList(modTypeList
) != null) {
423 e
.setSupModuleList(stringToList(modTypeList
));
426 if (e
.isSetSupModuleList()) {
427 e
.unsetSupModuleList();
435 public void updateSpdPpiDecl(int i
, String name
, String cName
, String guid
, String hlp
, String archList
,
437 XmlObject o
= psaRoot
.getPpiDeclarations();
442 XmlCursor cursor
= o
.newCursor();
443 if (cursor
.toFirstChild()) {
444 for (int j
= 0; j
< i
; ++j
) {
445 cursor
.toNextSibling();
447 PpiDeclarationsDocument
.PpiDeclarations
.Entry e
= (PpiDeclarationsDocument
.PpiDeclarations
.Entry
)cursor
.getObject();
450 e
.setGuidValue(guid
);
452 if (stringToList(archList
) != null){
453 e
.setSupArchList(stringToList(archList
));
456 if (e
.isSetSupArchList()) {
457 e
.unsetSupArchList();
460 if (stringToList(modTypeList
) != null) {
461 e
.setSupModuleList(stringToList(modTypeList
));
464 if (e
.isSetSupModuleList()) {
465 e
.unsetSupModuleList();
472 public void updateSpdProtocolDecl(int i
, String name
, String cName
, String guid
, String hlp
, String archList
,
474 XmlObject o
= psaRoot
.getProtocolDeclarations();
479 XmlCursor cursor
= o
.newCursor();
480 if (cursor
.toFirstChild()) {
481 for (int j
= 0; j
< i
; ++j
) {
482 cursor
.toNextSibling();
484 ProtocolDeclarationsDocument
.ProtocolDeclarations
.Entry e
= (ProtocolDeclarationsDocument
.ProtocolDeclarations
.Entry
)cursor
.getObject();
487 e
.setGuidValue(guid
);
489 if (stringToList(archList
) != null){
490 e
.setSupArchList(stringToList(archList
));
493 if (e
.isSetSupArchList()) {
494 e
.unsetSupArchList();
497 if (stringToList(modTypeList
) != null) {
498 e
.setSupModuleList(stringToList(modTypeList
));
501 if (e
.isSetSupModuleList()) {
502 e
.unsetSupModuleList();
509 public void updateSpdPkgHdr(int i
, String pkgName
, String hdrName
){
510 XmlObject o
= psaRoot
.getPackageHeaders();
515 XmlCursor cursor
= o
.newCursor();
516 if (cursor
.toFirstChild()) {
517 for (int j
= 0; j
< i
; ++j
) {
518 cursor
.toNextSibling();
521 PackageHeadersDocument
.PackageHeaders
.IncludePkgHeader iph
= (PackageHeadersDocument
.PackageHeaders
.IncludePkgHeader
)cursor
.getObject();
522 iph
.setModuleType(ModuleTypeDef
.Enum
.forString(pkgName
));
523 iph
.setStringValue(hdrName
);
528 public void updateSpdPcdDefinition(int i
, String cName
, String token
, String dataType
, String pcdItemTypes
,
529 String spaceGuid
, String defaultString
, String help
, String archList
, String modTypeList
){
530 XmlObject o
= psaRoot
.getPcdDeclarations();
533 XmlCursor cursor
= o
.newCursor();
534 if (cursor
.toFirstChild()) {
535 for (int j
= 0; j
< i
; ++j
) {
536 cursor
.toNextSibling();
538 PcdDeclarationsDocument
.PcdDeclarations
.PcdEntry e
= (PcdDeclarationsDocument
.PcdDeclarations
.PcdEntry
)cursor
.getObject();
541 e
.setDatumType(PcdDataTypes
.Enum
.forString(dataType
));
542 if (pcdItemTypes
!= null && pcdItemTypes
.length() > 0) {
543 String usage
[] = pcdItemTypes
.split("( )+");
544 List
<String
> l
= new ArrayList
<String
>();
545 for (int k
= 0; k
< usage
.length
; ++k
) {
551 e
.setTokenSpaceGuidCName(spaceGuid
);
552 e
.setDefaultValue(defaultString
);
554 if (archList
!= null && archList
.length() > 0){
555 e
.setSupArchList(stringToList(archList
));
557 if (modTypeList
!= null && modTypeList
.length() > 0){
558 e
.setSupModuleList(stringToList(modTypeList
));
564 Get spd file header contents into String array
566 @param s Caller allocated String array
568 public void getSpdHdrDetails(String
[] s
) {
569 if (getSpdHdr() == null) {
570 spdHdr
= psaRoot
.addNewSpdHeader();
572 s
[0] = getSpdHdrPkgName();
573 s
[1] = getSpdHdr().getGuidValue();
574 s
[2] = getSpdHdrVer();
575 // s[3] = getSpdHdr().getAbstract();
576 s
[4] = getSpdHdr().getDescription();
577 s
[5] = getSpdHdr().getCopyright();
578 s
[6] = getSpdHdrLicense();
583 Get the number of library class declarations from the size of List
587 public int getSpdLibClassDeclarationCount() {
588 if (psaRoot
.getLibraryClassDeclarations() == null
589 || psaRoot
.getLibraryClassDeclarations().getLibraryClassList() == null) {
592 return psaRoot
.getLibraryClassDeclarations().getLibraryClassList().size();
596 Get available library class declaration into String array
597 @param libClass Caller allocated two-dimentional String array
599 public void getSpdLibClassDeclarations(String
[][] libClass
) {
600 if (psaRoot
.getLibraryClassDeclarations() == null){
604 List
<LibraryClassDeclarationsDocument
.LibraryClassDeclarations
.LibraryClass
> l
= psaRoot
.getLibraryClassDeclarations().getLibraryClassList();
606 ListIterator li
= l
.listIterator();
607 while (li
.hasNext()) {
608 LibraryClassDeclarationsDocument
.LibraryClassDeclarations
.LibraryClass lc
= (LibraryClassDeclarationsDocument
.LibraryClassDeclarations
.LibraryClass
) li
.next();
610 libClass
[i
][0] = lc
.getName();
611 libClass
[i
][1] = lc
.getIncludeHeader();
612 libClass
[i
][2] = lc
.getHelpText();
613 // LAH added logic so you cannot set the version unless the GUID is defined.
614 /* LAH do not set now
615 if (lc.getRecommendedInstanceGuid() != null) {
616 libClass[i][3] = lc.getRecommendedInstanceGuid();
617 if (lc.getRecommendedInstanceVersion() != null) {
618 libClass[i][4] = lc.getRecommendedInstanceVersion();
622 if (lc
.getSupArchList() != null) {
623 libClass
[i
][5] = listToString(lc
.getSupArchList());
625 if (lc
.getSupModuleList() != null) {
626 libClass
[i
][6] = listToString(lc
.getSupModuleList());
637 Get the number of Msa files from the size of List
641 public int getSpdMsaFileCount() {
642 if (psaRoot
.getMsaFiles() == null || psaRoot
.getMsaFiles().getFilenameList() == null) {
645 return psaRoot
.getMsaFiles().getFilenameList().size();
649 Get available Msa file into String array
651 @param msaFile Caller allocated two-dimentional String array
653 public void getSpdMsaFiles(String
[][] msaFile
) {
654 if (psaRoot
.getMsaFiles() == null) {
657 List
<String
> l
= psaRoot
.getMsaFiles().getFilenameList();
659 ListIterator li
= l
.listIterator();
660 while (li
.hasNext()) {
661 msaFile
[i
][0] = (String
)li
.next();
668 Get the number of include header files in PackageHeaders from the size of List
672 public int getSpdPackageHeaderCount() {
673 if (psaRoot
.getPackageHeaders() == null || psaRoot
.getPackageHeaders().getIncludePkgHeaderList() == null) {
676 return psaRoot
.getPackageHeaders().getIncludePkgHeaderList().size();
680 Get available package header contents into String array
682 @param pkgHeader Caller allocated two-dimentional String array
684 public void getSpdPackageHeaders(String
[][] pkgHeader
) {
685 if (psaRoot
.getPackageHeaders() == null) {
689 List
<PackageHeadersDocument
.PackageHeaders
.IncludePkgHeader
> l
= psaRoot
.getPackageHeaders().getIncludePkgHeaderList();
691 ListIterator li
= l
.listIterator();
692 while (li
.hasNext()) {
693 PackageHeadersDocument
.PackageHeaders
.IncludePkgHeader ih
= (PackageHeadersDocument
.PackageHeaders
.IncludePkgHeader
) li
.next();
694 if (ih
.getModuleType() != null) {
695 pkgHeader
[i
][0] = ih
.getModuleType().toString();
698 pkgHeader
[i
][1] = ih
.getStringValue();
704 Get the number of GUID declarations from the size of List
708 public int getSpdGuidDeclarationCount() {
709 if (psaRoot
.getGuidDeclarations() == null || psaRoot
.getGuidDeclarations().getEntryList() == null) {
712 return psaRoot
.getGuidDeclarations().getEntryList().size();
716 Get available Guid declaration contents into String array
718 @param guid Caller allocated two-dimentional String array
720 public void getSpdGuidDeclarations(String
[][] guid
) {
721 if (psaRoot
.getGuidDeclarations() == null) {
725 List
<GuidDeclarationsDocument
.GuidDeclarations
.Entry
> l
= psaRoot
.getGuidDeclarations().getEntryList();
727 ListIterator li
= l
.listIterator();
728 while (li
.hasNext()) {
729 GuidDeclarationsDocument
.GuidDeclarations
.Entry e
= (GuidDeclarationsDocument
.GuidDeclarations
.Entry
) li
731 guid
[i
][0] = e
.getName();
732 guid
[i
][1] = e
.getCName();
733 if (e
.getGuidValue() != null) {
734 guid
[i
][2] = e
.getGuidValue();
736 guid
[i
][3] = e
.getHelpText();
737 guid
[i
][4] = listToString(e
.getSupArchList());
738 guid
[i
][5] = listToString(e
.getSupModuleList());
739 guid
[i
][6] = listToString(e
.getGuidTypeList());
745 Get the number of protocol declarations from the size of List
749 public int getSpdProtocolDeclarationCount() {
750 if (psaRoot
.getProtocolDeclarations() == null || psaRoot
.getProtocolDeclarations().getEntryList() == null) {
753 return psaRoot
.getProtocolDeclarations().getEntryList().size();
757 Get available protocol declaration contents into String array
759 @param protocol Caller allocated two-dimentional String array
761 public void getSpdProtocolDeclarations(String
[][] protocol
) {
762 if (psaRoot
.getProtocolDeclarations() == null) {
766 List
<ProtocolDeclarationsDocument
.ProtocolDeclarations
.Entry
> l
= psaRoot
.getProtocolDeclarations()
769 ListIterator li
= l
.listIterator();
770 while (li
.hasNext()) {
771 ProtocolDeclarationsDocument
.ProtocolDeclarations
.Entry e
= (ProtocolDeclarationsDocument
.ProtocolDeclarations
.Entry
) li
773 protocol
[i
][0] = e
.getName();
774 protocol
[i
][1] = e
.getCName();
775 if (e
.getGuidValue() != null) {
776 protocol
[i
][2] = e
.getGuidValue();
778 protocol
[i
][3] = e
.getHelpText();
779 protocol
[i
][4] = listToString(e
.getSupArchList());
780 protocol
[i
][5] = listToString(e
.getSupModuleList());
786 Get the number of Ppi declarations from the size of List
790 public int getSpdPpiDeclarationCount() {
791 if (psaRoot
.getPpiDeclarations() == null || psaRoot
.getPpiDeclarations().getEntryList() == null) {
794 return psaRoot
.getPpiDeclarations().getEntryList().size();
798 Get available Ppi declaration contents into String array
800 @param ppi Caller allocated two-dimentional String array
802 public void getSpdPpiDeclarations(String
[][] ppi
) {
803 if (psaRoot
.getPpiDeclarations() == null) {
807 List
<PpiDeclarationsDocument
.PpiDeclarations
.Entry
> l
= psaRoot
.getPpiDeclarations().getEntryList();
809 ListIterator li
= l
.listIterator();
810 while (li
.hasNext()) {
811 PpiDeclarationsDocument
.PpiDeclarations
.Entry e
= (PpiDeclarationsDocument
.PpiDeclarations
.Entry
) li
.next();
812 ppi
[i
][0] = e
.getName();
813 ppi
[i
][1] = e
.getCName();
814 if (e
.getGuidValue() != null) {
815 ppi
[i
][2] = e
.getGuidValue();
817 ppi
[i
][3] = e
.getHelpText();
818 ppi
[i
][4] = listToString(e
.getSupArchList());
819 ppi
[i
][5] = listToString(e
.getSupModuleList());
826 Get the number of Pcd definitions from the size of List
830 public int getSpdPcdDefinitionCount() {
831 if (psaRoot
.getPcdDeclarations() == null || psaRoot
.getPcdDeclarations().getPcdEntryList() == null) {
834 return psaRoot
.getPcdDeclarations().getPcdEntryList().size();
838 Get available Pcd definition contents into String array
840 @param pcd Caller allocated two-dimentional String array
842 public void getSpdPcdDefinitions(String
[][] pcd
, String pcdUsage
[][]) {
843 if (psaRoot
.getPcdDeclarations() == null) {
847 List
<PcdDeclarationsDocument
.PcdDeclarations
.PcdEntry
> l
= psaRoot
.getPcdDeclarations().getPcdEntryList();
849 while (i
< l
.size()) {
850 PcdDeclarationsDocument
.PcdDeclarations
.PcdEntry e
= (PcdDeclarationsDocument
.PcdDeclarations
.PcdEntry
)l
.get(i
);
851 pcd
[i
][0] = e
.getCName();
852 pcd
[i
][1] = e
.getToken() + "";
853 pcd
[i
][2] = e
.getTokenSpaceGuidCName();
854 if (e
.getDatumType() != null) {
855 pcd
[i
][3] = e
.getDatumType().toString();
857 pcd
[i
][4] = e
.getDefaultValue()+"";
858 pcd
[i
][5] = e
.getHelpText();
859 String archList
= listToString(e
.getSupArchList());
860 if (archList
!= null) {
861 pcd
[i
][6] = archList
;
863 String modTypeList
= listToString(e
.getSupModuleList());
864 if (modTypeList
!= null) {
865 pcd
[i
][7] = modTypeList
;
869 while (j
< e
.getValidUsage().size() && j
< 5) {
870 pcdUsage
[i
][j
] = (String
)e
.getValidUsage().get(j
);
878 Save the processed xml contents to file
880 @param spdFile The file to save xml contents
881 @throws IOException Exceptions during file operation
883 public void saveAs(File spdFile
) throws IOException
{
885 XmlOptions options
= new XmlOptions();
887 options
.setCharacterEncoding("UTF-8");
888 options
.setSavePrettyPrint();
889 options
.setSavePrettyPrintIndent(2);
891 psad
.save(spdFile
, options
);
892 } catch (IOException e
) {
899 Generate SpdHeader contents using parameters passed in.
901 @param pkgName PackageName
903 @param pkgVer Version
904 @param pkgAbs Abstract
905 @param pkgDes Description
906 @param pkgCpRight Copyright
907 @param pkgLicense License
908 @param pkgCreateDate Created
909 @param pkgUpdateDate Updated
911 @param pkgType PackageType
912 @param pkgRdOnly ReadOnly
913 @param pkgRePkg RePackage
914 @param pkgSpec Reserved
915 @param pkgOutDir Reserved
917 public void genSpdHeader(String pkgName
, String pkgGuid
, String pkgVer
, String pkgAbs
, String pkgDes
,
918 String pkgCpRight
, String pkgLicense
, String pkgCreateDate
, String pkgUpdateDate
,
919 String pkgURL
, String pkgType
, String pkgRdOnly
, String pkgRePkg
, String pkgSpec
,
921 if (getSpdHdr() == null) {
922 spdHdr
= psaRoot
.addNewSpdHeader();
925 setSpdHdrPkgName(pkgName
);
926 setSpdHdrGuidValue(pkgGuid
);
927 setSpdHdrVer(pkgVer
);
928 setSpdHdrAbs(pkgAbs
);
929 setSpdHdrDescription(pkgDes
);
930 setSpdHdrCopyright(pkgCpRight
);
931 setSpdHdrLicense(pkgLicense
);
934 setSpdHdrSpec(pkgSpec
);
938 Generate library class declaration element using parameters passed in
940 @param libClassBaseName LibraryClass element value
941 @param libClassUsage Reserved
942 @param incHdrFileName IncludeHeader element value
943 @param incHdrAttribGuid Reserved
944 @param incHdrAttribArch Reserved
945 @param incHdrAttribPath Reserved
946 @param incHdrAttribClass Reserved
947 @param incHdrAttribVer Reserved
948 @param incHdrAttribOverrideID Reserved
949 @param incHdrAttribModuleType Reserved
951 public void genSpdLibClassDeclarations(String libClassBaseName
, String instanceUsage
, String incHdrFileName
,
952 String help
, String incHdrAttribArch
, String incHdrAttribPath
,
953 String incHdrAttribClass
, String incHdrAttribVer
,
954 String incHdrAttribOverrideID
, String incHdrAttribModuleType
) {
955 if (getSpdLibClassDeclarations() == null) {
956 spdLibClassDeclarations
= psaRoot
.addNewLibraryClassDeclarations();
959 // add contents under LibraryClassDeclarations tag
961 setSpdLibClassDeclaration(libClassBaseName
, instanceUsage
, incHdrFileName
, help
, incHdrAttribArch
,
962 incHdrAttribPath
, incHdrAttribClass
, incHdrAttribVer
, incHdrAttribOverrideID
,
963 incHdrAttribModuleType
, spdLibClassDeclarations
);
967 Set library class declaration contents under parent tag
969 @param clsName LibraryClass element value
970 @param clsUsage Reserved
971 @param hdrFile IncludeHeader element value
972 @param hdrAttribGuid Reserved
973 @param hdrAttribArch Reserved
974 @param hdrAttribPath Reserved
975 @param hdrAttribClass Reserved
976 @param hdrAttribVer Reserved
977 @param hdrAttribOverID Reserved
978 @param hdrAttribModType Reserved
979 @param parent The tag under which library class declaration goes to
981 public void setSpdLibClassDeclaration(String clsName
, String clsUsage
, String hdrFile
, String help
,
982 String hdrAttribArch
, String hdrAttribPath
, String hdrAttribClass
,
983 String instanceVer
, String hdrAttribOverID
, String hdrAttribModType
,
986 setSpdLibraryClass(clsName
, hdrFile
, help
, clsUsage
, instanceVer
, hdrAttribArch
, hdrAttribModType
, parent
);
991 Set the contents of LibraryClass under parent element
993 @param clsName LibraryClass element value
994 @param clsUsage Reserved
995 @param parent The tag under which library class declaration goes to
997 public void setSpdLibraryClass(String clsName
, String clsIncludeFile
, String help
, String clsUsage
, String instanceVer
, String hdrAttribArch
, String hdrAttribModType
, XmlObject parent
) {
998 LibraryClassDeclarationsDocument
.LibraryClassDeclarations
.LibraryClass lc
= ((LibraryClassDeclarationsDocument
.LibraryClassDeclarations
) parent
).addNewLibraryClass();
1000 lc
.setIncludeHeader(clsIncludeFile
);
1001 lc
.setHelpText(help
);
1002 // LAH added logic so you cannot set the version unless the GUID is defined.
1004 if (clsUsage != null) {
1005 lc.setRecommendedInstanceGuid(clsUsage);
1006 if (instanceVer != null) {
1007 lc.setRecommendedInstanceVersion(instanceVer);
1011 if (hdrAttribArch
!= null) {
1012 lc
.setSupArchList(stringToList(hdrAttribArch
));
1014 if (lc
.isSetSupArchList()) {
1015 lc
.unsetSupArchList();
1019 if (hdrAttribModType
!= null) {
1020 lc
.setSupModuleList(stringToList(hdrAttribModType
));
1022 if (lc
.isSetSupModuleList()) {
1023 lc
.unsetSupModuleList();
1030 Set contents of IncludeHeader under parent element
1032 @param modType Reserved
1033 @param hdrFile IncludeHeader element value
1034 @param hdrAttribGuid Reserved
1035 @param hdrAttribArch Reserved
1036 @param hdrAttribPath Reserved
1037 @param hdrAttribClass Reserved
1038 @param hdrAttribVer Reserved
1039 @param hdrAttribOverID Reserved
1040 @param parent The tag under which library class declaration goes to
1042 public void setSpdIncludeHeader(String modType
, String hdrFile
, String hdrAttribGuid
, String hdrAttribArch
,
1043 String hdrAttribPath
, String hdrAttribClass
, String hdrAttribVer
,
1044 String hdrAttribOverID
, XmlObject parent
) {
1046 if (parent
instanceof LibraryClassDeclarationsDocument
.LibraryClassDeclarations
) {
1047 } else if (parent
instanceof PackageHeadersDocument
.PackageHeaders
) {
1048 PackageHeadersDocument
.PackageHeaders
.IncludePkgHeader ih
= null;
1049 ih
= ((PackageHeadersDocument
.PackageHeaders
) parent
).addNewIncludePkgHeader();
1050 ih
.setStringValue(hdrFile
);
1051 ih
.setModuleType(ModuleTypeDef
.Enum
.forString(modType
));
1056 if (hdrAttribGuid
!= null) {
1058 if (hdrAttribPath
!= null) {
1060 if (hdrAttribClass
!= null) {
1062 if (hdrAttribVer
!= null) {
1064 if (hdrAttribOverID
!= null) {
1070 Generate MsaFile element.
1072 @param msaFileName MsaFile element value
1073 @param archType Reserved
1075 public void genSpdMsaFiles(String msaFileName
, String moduleName
, String ver
, String guid
) {
1076 if (getSpdMsaFiles() == null) {
1077 spdMsaFiles
= psaRoot
.addNewMsaFiles();
1079 setSpdMsaFile(msaFileName
, moduleName
, ver
, guid
, spdMsaFiles
);
1084 Set MsaFile contents under parent element.
1086 @param msaFileName MsaFile element value
1087 @param parent Element under which MsaFile goes to
1089 public void setSpdMsaFile(String msaFileName
, String moduleName
, String ver
, String guid
, XmlObject parent
) {
1090 MsaFilesDocument
.MsaFiles f
= (MsaFilesDocument
.MsaFiles
)parent
;
1091 f
.addNewFilename().setStringValue(msaFileName
);
1092 // f.setFilename(msaFileName);
1093 // f.setModuleName(moduleName);
1094 // f.setModuleVersion(ver);
1095 // f.setModuleGuid(guid);
1099 Generate PackageHeader element using parameters passed in.
1101 @param ModHdrModType ModuleType attribute of IncludeHeader element
1102 @param hdrFile IncludeHeader element value
1103 @param hdrAttribGuid Reserved
1104 @param hdrAttribArch Reserved
1105 @param hdrAttribPath Reserved
1106 @param hdrAttribClass Reserved
1107 @param hdrAttribVer Reserved
1108 @param hdrAttribOverID Reserved
1110 public void genSpdModuleHeaders(String ModHdrModType
, String hdrFile
, String hdrAttribGuid
, String hdrAttribArch
,
1111 String hdrAttribPath
, String hdrAttribClass
, String hdrAttribVer
,
1112 String hdrAttribOverID
) {
1113 if (getSpdModHdrs() == null) {
1114 spdModHdrs
= psaRoot
.addNewPackageHeaders();
1118 // add IncludeHeader under PackageHeaders element
1120 setSpdIncludeHeader(ModHdrModType
, hdrFile
, hdrAttribGuid
, hdrAttribArch
, hdrAttribPath
, hdrAttribClass
,
1121 hdrAttribVer
, hdrAttribOverID
, spdModHdrs
);
1125 Generate GUID declaration element using parameters passed in.
1127 @param guidDeclEntryName Name attribute of Entry element
1128 @param guidDeclCName CName element value
1129 @param guidDeclGuid Guid element value
1130 @param guidDeclFeatureFlag Reserved
1132 public void genSpdGuidDeclarations(String guidDeclEntryName
, String guidDeclCName
, String guidDeclGuid
,
1133 String guidDeclHelp
, Vector
<String
> archList
, Vector
<String
> modTypeList
,
1134 Vector
<String
> guidTypeList
) {
1135 if (getSpdGuidDeclarations() == null) {
1136 spdGuidDeclarations
= psaRoot
.addNewGuidDeclarations();
1139 setSpdEntry(guidDeclEntryName
, guidDeclCName
, guidDeclGuid
, guidDeclHelp
, archList
, modTypeList
, guidTypeList
, spdGuidDeclarations
);
1143 Generate protocol declaration element using parameters passed in.
1145 @param protocolDeclEntryName Name attribute of Entry element
1146 @param protocolDeclCName CName element value
1147 @param protocolDeclGuid Guid element value
1148 @param protocolDeclFeatureFlag Reserved
1150 public void genSpdProtocolDeclarations(String protocolDeclEntryName
, String protocolDeclCName
,
1151 String protocolDeclGuid
, String protocolDeclFeatureFlag
,
1152 Vector
<String
> archList
, Vector
<String
> modTypeList
) {
1153 if (getSpdProtocolDeclarations() == null) {
1154 spdProtocolDeclarations
= psaRoot
.addNewProtocolDeclarations();
1157 setSpdEntry(protocolDeclEntryName
, protocolDeclCName
, protocolDeclGuid
, protocolDeclFeatureFlag
,
1158 archList
, modTypeList
, null, spdProtocolDeclarations
);
1162 Generate PPI declaration element using parameters passed in.
1164 @param ppiDeclEntryName Name attribute of Entry element
1165 @param ppiDeclCName CName element value
1166 @param ppiDeclGuid Guid element value
1167 @param ppiDeclFeatureFlag Reserved
1169 public void genSpdPpiDeclarations(String ppiDeclEntryName
, String ppiDeclCName
, String ppiDeclGuid
,
1170 String ppiDeclFeatureFlag
, Vector
<String
> archList
, Vector
<String
> modTypeList
) {
1171 if (getSpdPpiDeclarations() == null) {
1172 spdPpiDeclarations
= psaRoot
.addNewPpiDeclarations();
1175 setSpdEntry(ppiDeclEntryName
, ppiDeclCName
, ppiDeclGuid
, ppiDeclFeatureFlag
, archList
, modTypeList
, null, spdPpiDeclarations
);
1179 Set Entry contents using parameters passed in
1181 @param entryName Name attribute of Entry element
1182 @param cName CName element value
1183 @param guid Guid element value
1184 @param featureFlag Reserved
1185 @param parent The tag under which Entry element goes to
1187 public void setSpdEntry(String entryName
, String cName
, String guid
, String help
,
1188 Vector
<String
> archList
, Vector
<String
> modTypeList
,
1189 Vector
<String
> guidTypeList
, XmlObject parent
) {
1191 if (parent
instanceof GuidDeclarationsDocument
.GuidDeclarations
) {
1192 GuidDeclarationsDocument
.GuidDeclarations
.Entry e
= ((GuidDeclarations
) parent
).addNewEntry();
1193 e
.setName(entryName
);
1195 e
.setGuidValue(guid
);
1196 e
.setHelpText(help
);
1197 e
.setGuidTypeList(guidTypeList
);
1198 e
.setSupArchList(archList
);
1199 e
.setSupModuleList(modTypeList
);
1200 // if (guidTypeList != null && guidTypeList.size() > 0) {
1201 // e.setGuidTypeList(new ArrayList<String>(guidTypeList));
1203 // if (archList != null && archList.size() > 0){
1204 // e.setSupArchList(new ArrayList<String>(archList));
1206 // if (modTypeList != null && modTypeList.size() > 0) {
1207 // e.setSupModuleList(new ArrayList<String>(modTypeList));
1211 if (parent
instanceof ProtocolDeclarationsDocument
.ProtocolDeclarations
) {
1212 ProtocolDeclarationsDocument
.ProtocolDeclarations
.Entry pe
= ((ProtocolDeclarationsDocument
.ProtocolDeclarations
) parent
)
1214 pe
.setName(entryName
);
1216 pe
.setGuidValue(guid
);
1217 pe
.setHelpText(help
);
1218 pe
.setSupArchList(archList
);
1219 pe
.setSupModuleList(modTypeList
);
1220 // if (archList != null && archList.size() > 0){
1221 // pe.setSupArchList(new ArrayList<String>(archList));
1223 // if (modTypeList != null && modTypeList.size() > 0) {
1224 // pe.setSupModuleList(new ArrayList<String>(modTypeList));
1228 if (parent
instanceof PpiDeclarationsDocument
.PpiDeclarations
) {
1229 PpiDeclarationsDocument
.PpiDeclarations
.Entry ppe
= ((PpiDeclarationsDocument
.PpiDeclarations
) parent
)
1231 ppe
.setName(entryName
);
1232 ppe
.setCName(cName
);
1233 ppe
.setGuidValue(guid
);
1234 ppe
.setHelpText(help
);
1235 ppe
.setSupArchList(archList
);
1236 ppe
.setSupModuleList(modTypeList
);
1237 // if (archList != null && archList.size() > 0){
1238 // ppe.setSupArchList(new ArrayList<String>(archList));
1240 // if (archList != null && modTypeList.size() > 0) {
1241 // ppe.setSupModuleList(new ArrayList<String>(modTypeList));
1251 Generate Pcd definition using parameters passed in
1253 @param pcdItemTypes ItemType attribute of PcdEntry element
1254 @param cName C_Name element value
1255 @param token Token element value
1256 @param dataType DatumType element value
1257 @param skuEnable Reserved
1259 @param maxSku Reserved
1260 @param hiiEnable Reserved
1261 @param varGuid Reserved
1262 @param varName Reserved
1263 @param defaultString DefaultString element value
1265 public void genSpdPcdDefinitions(String cName
, String token
, String dataType
, String pcdItemTypes
,
1266 String spaceGuid
, String defaultString
, String help
, String archList
,
1267 String modTypeList
) {
1268 if (getSpdPcdDefinitions() == null) {
1269 spdPcdDefinitions
= psaRoot
.addNewPcdDeclarations();
1272 setSpdPcdEntry(pcdItemTypes
, cName
, token
, dataType
, spaceGuid
, help
,
1273 defaultString
, archList
, modTypeList
, spdPcdDefinitions
);
1277 Set Pcd entry contents under parent tag
1279 @param pcdItemTypes ItemType attribute of PcdEntry element
1280 @param cName C_Name element value
1281 @param token Token element value
1282 @param dataType DatumType element value
1283 @param spaceGuid Reserved
1284 @param help Reserved
1285 @param defaultString DefaultString element value
1286 @param parent Tag under which PcdEntry goes to
1288 public void setSpdPcdEntry(String pcdItemTypes
, String cName
, String token
, String dataType
, String spaceGuid
, String help
,
1289 String defaultString
, String archList
, String modTypeList
, XmlObject parent
) {
1291 PcdDeclarationsDocument
.PcdDeclarations
.PcdEntry pe
= ((PcdDeclarationsDocument
.PcdDeclarations
) parent
).addNewPcdEntry();
1293 //ToDo: maybe multiple types in, need parse pcdItemTypes.
1294 String usage
[] = pcdItemTypes
.split("( )+");
1295 List
<String
> l
= new ArrayList
<String
>();
1296 for (int i
= 0; i
< usage
.length
; ++i
) {
1299 pe
.setValidUsage(l
);
1302 pe
.setDatumType(PcdDataTypes
.Enum
.forString(dataType
));
1303 pe
.setDefaultValue(defaultString
);
1304 pe
.setTokenSpaceGuidCName(spaceGuid
);
1305 pe
.setHelpText(help
);
1306 if (archList
!= null){
1307 pe
.setSupArchList(stringToList(archList
));
1309 if (pe
.isSetSupArchList()) {
1310 pe
.unsetSupArchList();
1313 if (modTypeList
!= null){
1314 pe
.setSupModuleList(stringToList(modTypeList
));
1316 if (pe
.isSetSupModuleList()) {
1317 pe
.unsetSupModuleList();
1323 Get PpiDeclarations element
1325 @return PpiDeclarationsDocument.PpiDeclarations
1327 public PpiDeclarationsDocument
.PpiDeclarations
getSpdPpiDeclarations() {
1328 if (spdPpiDeclarations
== null) {
1329 spdPpiDeclarations
= psaRoot
.getPpiDeclarations();
1331 return spdPpiDeclarations
;
1335 Get ProtocolDeclarations element
1337 @return ProtocolDeclarationsDocument.ProtocolDeclarations
1339 public ProtocolDeclarationsDocument
.ProtocolDeclarations
getSpdProtocolDeclarations() {
1340 if (spdProtocolDeclarations
== null) {
1341 spdProtocolDeclarations
= psaRoot
.getProtocolDeclarations();
1343 return spdProtocolDeclarations
;
1347 Get GuidDeclarations element
1349 @return GuidDeclarationsDocument.GuidDeclarations
1351 public GuidDeclarationsDocument
.GuidDeclarations
getSpdGuidDeclarations() {
1352 if (spdGuidDeclarations
== null) {
1353 spdGuidDeclarations
= psaRoot
.getGuidDeclarations();
1355 return spdGuidDeclarations
;
1359 Get PcdDefinitions element
1361 @return PcdDefinitionsDocument.PcdDefinitions
1363 public PcdDeclarationsDocument
.PcdDeclarations
getSpdPcdDefinitions() {
1364 if (spdPcdDefinitions
== null) {
1365 spdPcdDefinitions
= psaRoot
.getPcdDeclarations();
1367 return spdPcdDefinitions
;
1371 Get PackageHeaders element
1373 @return PackageHeadersDocument.PackageHeaders
1375 public PackageHeadersDocument
.PackageHeaders
getSpdModHdrs() {
1376 if (spdModHdrs
== null) {
1377 spdModHdrs
= psaRoot
.getPackageHeaders();
1383 Get MsaFiles element
1385 @return MsaFilesDocument.MsaFiles
1387 public MsaFilesDocument
.MsaFiles
getSpdMsaFiles() {
1388 if (spdMsaFiles
== null) {
1389 spdMsaFiles
= psaRoot
.getMsaFiles();
1395 Get LibraryClassDeclarations element
1397 @return LibraryClassDeclarationsDocument.LibraryClassDeclarations
1399 public LibraryClassDeclarationsDocument
.LibraryClassDeclarations
getSpdLibClassDeclarations() {
1400 if (spdLibClassDeclarations
== null) {
1401 spdLibClassDeclarations
= psaRoot
.getLibraryClassDeclarations();
1403 return spdLibClassDeclarations
;
1406 public PackageDefinitionsDocument
.PackageDefinitions
getSpdPkgDefs() {
1407 if (spdPkgDefs
== null) {
1408 spdPkgDefs
= psaRoot
.addNewPackageDefinitions();
1413 Get SpdHeader element
1415 @return SpdHeaderDocument.SpdHeader
1417 public SpdHeaderDocument
.SpdHeader
getSpdHdr() {
1418 if (spdHdr
== null) {
1419 spdHdr
= psaRoot
.addNewSpdHeader();
1425 Set value to Guid element
1427 @param guid The value set to Guid element
1429 public void setSpdHdrGuidValue(String guid
) {
1430 getSpdHdr().setGuidValue(guid
);
1434 Get Version element under SpdHdr
1438 public String
getSpdHdrVer() {
1439 return getSpdHdr().getVersion();
1443 Set value to Version element
1445 @param ver The value set to Version element
1447 public void setSpdHdrVer(String ver
) {
1448 getSpdHdr().setVersion(ver
);
1451 public String
getSpdHdrAbs(){
1452 return getSpdHdr().getAbstract();
1457 Set value to Abstract element
1459 @param abs The value set to Abstract element
1461 public void setSpdHdrAbs(String abs
) {
1463 getSpdHdr().setAbstract(abs
);
1466 public String
getSpdHdrDescription(){
1467 return getSpdHdr().getDescription();
1470 Set value to Description element
1472 @param des The value set to Description element
1474 public void setSpdHdrDescription(String des
) {
1475 getSpdHdr().setDescription(des
);
1478 public String
getSpdHdrCopyright(){
1479 return getSpdHdr().getCopyright();
1482 Set value to Copyright element
1484 @param cpRit The value set to Copyright element
1486 public void setSpdHdrCopyright(String cpRit
) {
1488 getSpdHdr().setCopyright(cpRit
);
1492 Get License element under SpdHdr
1496 public String
getSpdHdrLicense() {
1497 if (getSpdHdr().getLicense() != null) {
1498 return getSpdHdr().getLicense().getStringValue();
1504 Set value to License element
1506 @param license The value set to License element
1508 public void setSpdHdrLicense(String license
) {
1509 if (getSpdHdr().getLicense() == null){
1510 getSpdHdr().addNewLicense().setStringValue(license
);
1513 getSpdHdr().getLicense().setStringValue(license
);
1517 public String
getSpdHdrUrl(){
1518 if (getSpdHdr().getLicense() != null) {
1519 return getSpdHdr().getLicense().getURL();
1524 public void setSpdHdrUrl(String url
){
1525 getSpdHdr().getLicense().setURL(url
);
1529 Get PackageName element under SpdHdr
1533 public String
getSpdHdrPkgName() {
1535 return getSpdHdr().getPackageName();
1539 Set value to PackageName element
1541 @param pkgName The value set to PackageName element
1543 public void setSpdHdrPkgName(String pkgName
) {
1544 getSpdHdr().setPackageName(pkgName
);
1547 public String
getSpdHdrGuidValue(){
1548 return getSpdHdr().getGuidValue();
1554 @return SpecificationDocument.Specification
1556 public String
getSpdHdrSpec() {
1557 return "FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052";
1558 // return getSpdHdr().getSpecification();
1566 public void setSpdHdrSpec(String spec
) {
1567 spec
= "FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052";
1568 getSpdHdr().setSpecification(spec
);
1572 public String
getSpdPkgDefsRdOnly(){
1573 return getSpdPkgDefs().getReadOnly() + "";
1576 Set value to ReadOnly element
1578 @param rdOnly The value set to ReadOnly element
1580 public void setSpdPkgDefsRdOnly(String rdOnly
) {
1582 getSpdPkgDefs().setReadOnly(new Boolean(rdOnly
));
1585 public String
getSpdPkgDefsRePkg(){
1586 return getSpdPkgDefs().getRePackage() + "";
1589 Set value to RePackage element
1591 @param rePkg The value set to RePackage element
1593 public void setSpdPkgDefsRePkg(String rePkg
) {
1595 getSpdPkgDefs().setRePackage(new Boolean(rePkg
));
1599 Set value to URL element
1601 @param url The value set to URL element
1603 // public void setSpdHdrURL(String url) {
1604 // getSpdHdr().setURL(url);
1612 public File
getFile() {
1619 @param file File with xml format
1621 public void setFile(File file
) {
1625 private List
<String
> stringToList(String s
){
1626 if (s
== null || s
.length() == 0) {
1629 Vector
<String
> al
= new Vector
<String
>();
1630 String
[] sArray
= s
.split(" ");
1631 for(int i
= 0; i
< sArray
.length
; ++i
){
1637 private String
listToString(List l
) {
1642 ListIterator li
= l
.listIterator();
1643 while(li
.hasNext()) {