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 (stringToList(archList
) != null){
555 e
.setSupArchList(stringToList(archList
));
558 if (e
.isSetSupArchList()) {
559 e
.unsetSupArchList();
562 if (stringToList(modTypeList
) != null) {
563 e
.setSupModuleList(stringToList(modTypeList
));
566 if (e
.isSetSupModuleList()) {
567 e
.unsetSupModuleList();
575 Get spd file header contents into String array
577 @param s Caller allocated String array
579 public void getSpdHdrDetails(String
[] s
) {
580 if (getSpdHdr() == null) {
581 spdHdr
= psaRoot
.addNewSpdHeader();
583 s
[0] = getSpdHdrPkgName();
584 s
[1] = getSpdHdr().getGuidValue();
585 s
[2] = getSpdHdrVer();
586 // s[3] = getSpdHdr().getAbstract();
587 s
[4] = getSpdHdr().getDescription();
588 s
[5] = getSpdHdr().getCopyright();
589 s
[6] = getSpdHdrLicense();
594 Get the number of library class declarations from the size of List
598 public int getSpdLibClassDeclarationCount() {
599 if (psaRoot
.getLibraryClassDeclarations() == null
600 || psaRoot
.getLibraryClassDeclarations().getLibraryClassList() == null) {
603 return psaRoot
.getLibraryClassDeclarations().getLibraryClassList().size();
607 Get available library class declaration into String array
608 @param libClass Caller allocated two-dimentional String array
610 public void getSpdLibClassDeclarations(String
[][] libClass
) {
611 if (psaRoot
.getLibraryClassDeclarations() == null){
615 List
<LibraryClassDeclarationsDocument
.LibraryClassDeclarations
.LibraryClass
> l
= psaRoot
.getLibraryClassDeclarations().getLibraryClassList();
617 ListIterator li
= l
.listIterator();
618 while (li
.hasNext()) {
619 LibraryClassDeclarationsDocument
.LibraryClassDeclarations
.LibraryClass lc
= (LibraryClassDeclarationsDocument
.LibraryClassDeclarations
.LibraryClass
) li
.next();
621 libClass
[i
][0] = lc
.getName();
622 libClass
[i
][1] = lc
.getIncludeHeader();
623 libClass
[i
][2] = lc
.getHelpText();
624 // LAH added logic so you cannot set the version unless the GUID is defined.
625 /* LAH do not set now
626 if (lc.getRecommendedInstanceGuid() != null) {
627 libClass[i][3] = lc.getRecommendedInstanceGuid();
628 if (lc.getRecommendedInstanceVersion() != null) {
629 libClass[i][4] = lc.getRecommendedInstanceVersion();
633 if (lc
.getSupArchList() != null) {
634 libClass
[i
][5] = listToString(lc
.getSupArchList());
636 if (lc
.getSupModuleList() != null) {
637 libClass
[i
][6] = listToString(lc
.getSupModuleList());
648 Get the number of Msa files from the size of List
652 public int getSpdMsaFileCount() {
653 if (psaRoot
.getMsaFiles() == null || psaRoot
.getMsaFiles().getFilenameList() == null) {
656 return psaRoot
.getMsaFiles().getFilenameList().size();
660 Get available Msa file into String array
662 @param msaFile Caller allocated two-dimentional String array
664 public void getSpdMsaFiles(String
[][] msaFile
) {
665 if (psaRoot
.getMsaFiles() == null) {
668 List
<String
> l
= psaRoot
.getMsaFiles().getFilenameList();
670 ListIterator li
= l
.listIterator();
671 while (li
.hasNext()) {
672 msaFile
[i
][0] = (String
)li
.next();
679 Get the number of include header files in PackageHeaders from the size of List
683 public int getSpdPackageHeaderCount() {
684 if (psaRoot
.getPackageHeaders() == null || psaRoot
.getPackageHeaders().getIncludePkgHeaderList() == null) {
687 return psaRoot
.getPackageHeaders().getIncludePkgHeaderList().size();
691 Get available package header contents into String array
693 @param pkgHeader Caller allocated two-dimentional String array
695 public void getSpdPackageHeaders(String
[][] pkgHeader
) {
696 if (psaRoot
.getPackageHeaders() == null) {
700 List
<PackageHeadersDocument
.PackageHeaders
.IncludePkgHeader
> l
= psaRoot
.getPackageHeaders().getIncludePkgHeaderList();
702 ListIterator li
= l
.listIterator();
703 while (li
.hasNext()) {
704 PackageHeadersDocument
.PackageHeaders
.IncludePkgHeader ih
= (PackageHeadersDocument
.PackageHeaders
.IncludePkgHeader
) li
.next();
705 if (ih
.getModuleType() != null) {
706 pkgHeader
[i
][0] = ih
.getModuleType().toString();
709 pkgHeader
[i
][1] = ih
.getStringValue();
715 Get the number of GUID declarations from the size of List
719 public int getSpdGuidDeclarationCount() {
720 if (psaRoot
.getGuidDeclarations() == null || psaRoot
.getGuidDeclarations().getEntryList() == null) {
723 return psaRoot
.getGuidDeclarations().getEntryList().size();
727 Get available Guid declaration contents into String array
729 @param guid Caller allocated two-dimentional String array
731 public void getSpdGuidDeclarations(String
[][] guid
) {
732 if (psaRoot
.getGuidDeclarations() == null) {
736 List
<GuidDeclarationsDocument
.GuidDeclarations
.Entry
> l
= psaRoot
.getGuidDeclarations().getEntryList();
738 ListIterator li
= l
.listIterator();
739 while (li
.hasNext()) {
740 GuidDeclarationsDocument
.GuidDeclarations
.Entry e
= (GuidDeclarationsDocument
.GuidDeclarations
.Entry
) li
742 guid
[i
][0] = e
.getName();
743 guid
[i
][1] = e
.getCName();
744 if (e
.getGuidValue() != null) {
745 guid
[i
][2] = e
.getGuidValue();
747 guid
[i
][3] = e
.getHelpText();
748 guid
[i
][4] = listToString(e
.getSupArchList());
749 guid
[i
][5] = listToString(e
.getSupModuleList());
750 guid
[i
][6] = listToString(e
.getGuidTypeList());
756 Get the number of protocol declarations from the size of List
760 public int getSpdProtocolDeclarationCount() {
761 if (psaRoot
.getProtocolDeclarations() == null || psaRoot
.getProtocolDeclarations().getEntryList() == null) {
764 return psaRoot
.getProtocolDeclarations().getEntryList().size();
768 Get available protocol declaration contents into String array
770 @param protocol Caller allocated two-dimentional String array
772 public void getSpdProtocolDeclarations(String
[][] protocol
) {
773 if (psaRoot
.getProtocolDeclarations() == null) {
777 List
<ProtocolDeclarationsDocument
.ProtocolDeclarations
.Entry
> l
= psaRoot
.getProtocolDeclarations()
780 ListIterator li
= l
.listIterator();
781 while (li
.hasNext()) {
782 ProtocolDeclarationsDocument
.ProtocolDeclarations
.Entry e
= (ProtocolDeclarationsDocument
.ProtocolDeclarations
.Entry
) li
784 protocol
[i
][0] = e
.getName();
785 protocol
[i
][1] = e
.getCName();
786 if (e
.getGuidValue() != null) {
787 protocol
[i
][2] = e
.getGuidValue();
789 protocol
[i
][3] = e
.getHelpText();
790 protocol
[i
][4] = listToString(e
.getSupArchList());
791 protocol
[i
][5] = listToString(e
.getSupModuleList());
797 Get the number of Ppi declarations from the size of List
801 public int getSpdPpiDeclarationCount() {
802 if (psaRoot
.getPpiDeclarations() == null || psaRoot
.getPpiDeclarations().getEntryList() == null) {
805 return psaRoot
.getPpiDeclarations().getEntryList().size();
809 Get available Ppi declaration contents into String array
811 @param ppi Caller allocated two-dimentional String array
813 public void getSpdPpiDeclarations(String
[][] ppi
) {
814 if (psaRoot
.getPpiDeclarations() == null) {
818 List
<PpiDeclarationsDocument
.PpiDeclarations
.Entry
> l
= psaRoot
.getPpiDeclarations().getEntryList();
820 ListIterator li
= l
.listIterator();
821 while (li
.hasNext()) {
822 PpiDeclarationsDocument
.PpiDeclarations
.Entry e
= (PpiDeclarationsDocument
.PpiDeclarations
.Entry
) li
.next();
823 ppi
[i
][0] = e
.getName();
824 ppi
[i
][1] = e
.getCName();
825 if (e
.getGuidValue() != null) {
826 ppi
[i
][2] = e
.getGuidValue();
828 ppi
[i
][3] = e
.getHelpText();
829 ppi
[i
][4] = listToString(e
.getSupArchList());
830 ppi
[i
][5] = listToString(e
.getSupModuleList());
837 Get the number of Pcd definitions from the size of List
841 public int getSpdPcdDefinitionCount() {
842 if (psaRoot
.getPcdDeclarations() == null || psaRoot
.getPcdDeclarations().getPcdEntryList() == null) {
845 return psaRoot
.getPcdDeclarations().getPcdEntryList().size();
849 Get available Pcd definition contents into String array
851 @param pcd Caller allocated two-dimentional String array
853 public void getSpdPcdDefinitions(String
[][] pcd
, String pcdUsage
[][]) {
854 if (psaRoot
.getPcdDeclarations() == null) {
858 List
<PcdDeclarationsDocument
.PcdDeclarations
.PcdEntry
> l
= psaRoot
.getPcdDeclarations().getPcdEntryList();
860 while (i
< l
.size()) {
861 PcdDeclarationsDocument
.PcdDeclarations
.PcdEntry e
= (PcdDeclarationsDocument
.PcdDeclarations
.PcdEntry
)l
.get(i
);
862 pcd
[i
][0] = e
.getCName();
863 pcd
[i
][1] = e
.getToken() + "";
864 pcd
[i
][2] = e
.getTokenSpaceGuidCName();
865 if (e
.getDatumType() != null) {
866 pcd
[i
][3] = e
.getDatumType().toString();
868 pcd
[i
][4] = e
.getDefaultValue()+"";
869 pcd
[i
][5] = e
.getHelpText();
870 String archList
= listToString(e
.getSupArchList());
871 if (archList
!= null) {
872 pcd
[i
][6] = archList
;
874 String modTypeList
= listToString(e
.getSupModuleList());
875 if (modTypeList
!= null) {
876 pcd
[i
][7] = modTypeList
;
880 while (j
< e
.getValidUsage().size() && j
< 5) {
881 pcdUsage
[i
][j
] = (String
)e
.getValidUsage().get(j
);
889 Save the processed xml contents to file
891 @param spdFile The file to save xml contents
892 @throws IOException Exceptions during file operation
894 public void saveAs(File spdFile
) throws IOException
{
896 XmlOptions options
= new XmlOptions();
898 options
.setCharacterEncoding("UTF-8");
899 options
.setSavePrettyPrint();
900 options
.setSavePrettyPrintIndent(2);
902 psad
.save(spdFile
, options
);
903 } catch (IOException e
) {
910 Generate SpdHeader contents using parameters passed in.
912 @param pkgName PackageName
914 @param pkgVer Version
915 @param pkgAbs Abstract
916 @param pkgDes Description
917 @param pkgCpRight Copyright
918 @param pkgLicense License
919 @param pkgCreateDate Created
920 @param pkgUpdateDate Updated
922 @param pkgType PackageType
923 @param pkgRdOnly ReadOnly
924 @param pkgRePkg RePackage
925 @param pkgSpec Reserved
926 @param pkgOutDir Reserved
928 public void genSpdHeader(String pkgName
, String pkgGuid
, String pkgVer
, String pkgAbs
, String pkgDes
,
929 String pkgCpRight
, String pkgLicense
, String pkgCreateDate
, String pkgUpdateDate
,
930 String pkgURL
, String pkgType
, String pkgRdOnly
, String pkgRePkg
, String pkgSpec
,
932 if (getSpdHdr() == null) {
933 spdHdr
= psaRoot
.addNewSpdHeader();
936 setSpdHdrPkgName(pkgName
);
937 setSpdHdrGuidValue(pkgGuid
);
938 setSpdHdrVer(pkgVer
);
939 setSpdHdrAbs(pkgAbs
);
940 setSpdHdrDescription(pkgDes
);
941 setSpdHdrCopyright(pkgCpRight
);
942 setSpdHdrLicense(pkgLicense
);
945 setSpdHdrSpec(pkgSpec
);
949 Generate library class declaration element using parameters passed in
951 @param libClassBaseName LibraryClass element value
952 @param libClassUsage Reserved
953 @param incHdrFileName IncludeHeader element value
954 @param incHdrAttribGuid Reserved
955 @param incHdrAttribArch Reserved
956 @param incHdrAttribPath Reserved
957 @param incHdrAttribClass Reserved
958 @param incHdrAttribVer Reserved
959 @param incHdrAttribOverrideID Reserved
960 @param incHdrAttribModuleType Reserved
962 public void genSpdLibClassDeclarations(String libClassBaseName
, String instanceUsage
, String incHdrFileName
,
963 String help
, String incHdrAttribArch
, String incHdrAttribPath
,
964 String incHdrAttribClass
, String incHdrAttribVer
,
965 String incHdrAttribOverrideID
, String incHdrAttribModuleType
) {
966 if (getSpdLibClassDeclarations() == null) {
967 spdLibClassDeclarations
= psaRoot
.addNewLibraryClassDeclarations();
970 // add contents under LibraryClassDeclarations tag
972 setSpdLibClassDeclaration(libClassBaseName
, instanceUsage
, incHdrFileName
, help
, incHdrAttribArch
,
973 incHdrAttribPath
, incHdrAttribClass
, incHdrAttribVer
, incHdrAttribOverrideID
,
974 incHdrAttribModuleType
, spdLibClassDeclarations
);
978 Set library class declaration contents under parent tag
980 @param clsName LibraryClass element value
981 @param clsUsage Reserved
982 @param hdrFile IncludeHeader element value
983 @param hdrAttribGuid Reserved
984 @param hdrAttribArch Reserved
985 @param hdrAttribPath Reserved
986 @param hdrAttribClass Reserved
987 @param hdrAttribVer Reserved
988 @param hdrAttribOverID Reserved
989 @param hdrAttribModType Reserved
990 @param parent The tag under which library class declaration goes to
992 public void setSpdLibClassDeclaration(String clsName
, String clsUsage
, String hdrFile
, String help
,
993 String hdrAttribArch
, String hdrAttribPath
, String hdrAttribClass
,
994 String instanceVer
, String hdrAttribOverID
, String hdrAttribModType
,
997 setSpdLibraryClass(clsName
, hdrFile
, help
, clsUsage
, instanceVer
, hdrAttribArch
, hdrAttribModType
, parent
);
1002 Set the contents of LibraryClass under parent element
1004 @param clsName LibraryClass element value
1005 @param clsUsage Reserved
1006 @param parent The tag under which library class declaration goes to
1008 public void setSpdLibraryClass(String clsName
, String clsIncludeFile
, String help
, String clsUsage
, String instanceVer
, String hdrAttribArch
, String hdrAttribModType
, XmlObject parent
) {
1009 LibraryClassDeclarationsDocument
.LibraryClassDeclarations
.LibraryClass lc
= ((LibraryClassDeclarationsDocument
.LibraryClassDeclarations
) parent
).addNewLibraryClass();
1010 lc
.setName(clsName
);
1011 lc
.setIncludeHeader(clsIncludeFile
);
1012 lc
.setHelpText(help
);
1013 // LAH added logic so you cannot set the version unless the GUID is defined.
1015 if (clsUsage != null) {
1016 lc.setRecommendedInstanceGuid(clsUsage);
1017 if (instanceVer != null) {
1018 lc.setRecommendedInstanceVersion(instanceVer);
1022 if (hdrAttribArch
!= null) {
1023 lc
.setSupArchList(stringToList(hdrAttribArch
));
1025 if (lc
.isSetSupArchList()) {
1026 lc
.unsetSupArchList();
1030 if (hdrAttribModType
!= null) {
1031 lc
.setSupModuleList(stringToList(hdrAttribModType
));
1033 if (lc
.isSetSupModuleList()) {
1034 lc
.unsetSupModuleList();
1041 Set contents of IncludeHeader under parent element
1043 @param modType Reserved
1044 @param hdrFile IncludeHeader element value
1045 @param hdrAttribGuid Reserved
1046 @param hdrAttribArch Reserved
1047 @param hdrAttribPath Reserved
1048 @param hdrAttribClass Reserved
1049 @param hdrAttribVer Reserved
1050 @param hdrAttribOverID Reserved
1051 @param parent The tag under which library class declaration goes to
1053 public void setSpdIncludeHeader(String modType
, String hdrFile
, String hdrAttribGuid
, String hdrAttribArch
,
1054 String hdrAttribPath
, String hdrAttribClass
, String hdrAttribVer
,
1055 String hdrAttribOverID
, XmlObject parent
) {
1057 if (parent
instanceof LibraryClassDeclarationsDocument
.LibraryClassDeclarations
) {
1058 } else if (parent
instanceof PackageHeadersDocument
.PackageHeaders
) {
1059 PackageHeadersDocument
.PackageHeaders
.IncludePkgHeader ih
= null;
1060 ih
= ((PackageHeadersDocument
.PackageHeaders
) parent
).addNewIncludePkgHeader();
1061 ih
.setStringValue(hdrFile
);
1062 ih
.setModuleType(ModuleTypeDef
.Enum
.forString(modType
));
1067 if (hdrAttribGuid
!= null) {
1069 if (hdrAttribPath
!= null) {
1071 if (hdrAttribClass
!= null) {
1073 if (hdrAttribVer
!= null) {
1075 if (hdrAttribOverID
!= null) {
1081 Generate MsaFile element.
1083 @param msaFileName MsaFile element value
1084 @param archType Reserved
1086 public void genSpdMsaFiles(String msaFileName
, String moduleName
, String ver
, String guid
) {
1087 if (getSpdMsaFiles() == null) {
1088 spdMsaFiles
= psaRoot
.addNewMsaFiles();
1090 setSpdMsaFile(msaFileName
, moduleName
, ver
, guid
, spdMsaFiles
);
1095 Set MsaFile contents under parent element.
1097 @param msaFileName MsaFile element value
1098 @param parent Element under which MsaFile goes to
1100 public void setSpdMsaFile(String msaFileName
, String moduleName
, String ver
, String guid
, XmlObject parent
) {
1101 MsaFilesDocument
.MsaFiles f
= (MsaFilesDocument
.MsaFiles
)parent
;
1102 f
.addNewFilename().setStringValue(msaFileName
);
1103 // f.setFilename(msaFileName);
1104 // f.setModuleName(moduleName);
1105 // f.setModuleVersion(ver);
1106 // f.setModuleGuid(guid);
1110 Generate PackageHeader element using parameters passed in.
1112 @param ModHdrModType ModuleType attribute of IncludeHeader element
1113 @param hdrFile IncludeHeader element value
1114 @param hdrAttribGuid Reserved
1115 @param hdrAttribArch Reserved
1116 @param hdrAttribPath Reserved
1117 @param hdrAttribClass Reserved
1118 @param hdrAttribVer Reserved
1119 @param hdrAttribOverID Reserved
1121 public void genSpdModuleHeaders(String ModHdrModType
, String hdrFile
, String hdrAttribGuid
, String hdrAttribArch
,
1122 String hdrAttribPath
, String hdrAttribClass
, String hdrAttribVer
,
1123 String hdrAttribOverID
) {
1124 if (getSpdModHdrs() == null) {
1125 spdModHdrs
= psaRoot
.addNewPackageHeaders();
1129 // add IncludeHeader under PackageHeaders element
1131 setSpdIncludeHeader(ModHdrModType
, hdrFile
, hdrAttribGuid
, hdrAttribArch
, hdrAttribPath
, hdrAttribClass
,
1132 hdrAttribVer
, hdrAttribOverID
, spdModHdrs
);
1136 Generate GUID declaration element using parameters passed in.
1138 @param guidDeclEntryName Name attribute of Entry element
1139 @param guidDeclCName CName element value
1140 @param guidDeclGuid Guid element value
1141 @param guidDeclFeatureFlag Reserved
1143 public void genSpdGuidDeclarations(String guidDeclEntryName
, String guidDeclCName
, String guidDeclGuid
,
1144 String guidDeclHelp
, Vector
<String
> archList
, Vector
<String
> modTypeList
,
1145 Vector
<String
> guidTypeList
) {
1146 if (getSpdGuidDeclarations() == null) {
1147 spdGuidDeclarations
= psaRoot
.addNewGuidDeclarations();
1150 setSpdEntry(guidDeclEntryName
, guidDeclCName
, guidDeclGuid
, guidDeclHelp
, archList
, modTypeList
, guidTypeList
, spdGuidDeclarations
);
1154 Generate protocol declaration element using parameters passed in.
1156 @param protocolDeclEntryName Name attribute of Entry element
1157 @param protocolDeclCName CName element value
1158 @param protocolDeclGuid Guid element value
1159 @param protocolDeclFeatureFlag Reserved
1161 public void genSpdProtocolDeclarations(String protocolDeclEntryName
, String protocolDeclCName
,
1162 String protocolDeclGuid
, String protocolDeclFeatureFlag
,
1163 Vector
<String
> archList
, Vector
<String
> modTypeList
) {
1164 if (getSpdProtocolDeclarations() == null) {
1165 spdProtocolDeclarations
= psaRoot
.addNewProtocolDeclarations();
1168 setSpdEntry(protocolDeclEntryName
, protocolDeclCName
, protocolDeclGuid
, protocolDeclFeatureFlag
,
1169 archList
, modTypeList
, null, spdProtocolDeclarations
);
1173 Generate PPI declaration element using parameters passed in.
1175 @param ppiDeclEntryName Name attribute of Entry element
1176 @param ppiDeclCName CName element value
1177 @param ppiDeclGuid Guid element value
1178 @param ppiDeclFeatureFlag Reserved
1180 public void genSpdPpiDeclarations(String ppiDeclEntryName
, String ppiDeclCName
, String ppiDeclGuid
,
1181 String ppiDeclFeatureFlag
, Vector
<String
> archList
, Vector
<String
> modTypeList
) {
1182 if (getSpdPpiDeclarations() == null) {
1183 spdPpiDeclarations
= psaRoot
.addNewPpiDeclarations();
1186 setSpdEntry(ppiDeclEntryName
, ppiDeclCName
, ppiDeclGuid
, ppiDeclFeatureFlag
, archList
, modTypeList
, null, spdPpiDeclarations
);
1190 Set Entry contents using parameters passed in
1192 @param entryName Name attribute of Entry element
1193 @param cName CName element value
1194 @param guid Guid element value
1195 @param featureFlag Reserved
1196 @param parent The tag under which Entry element goes to
1198 public void setSpdEntry(String entryName
, String cName
, String guid
, String help
,
1199 Vector
<String
> archList
, Vector
<String
> modTypeList
,
1200 Vector
<String
> guidTypeList
, XmlObject parent
) {
1202 if (parent
instanceof GuidDeclarationsDocument
.GuidDeclarations
) {
1203 GuidDeclarationsDocument
.GuidDeclarations
.Entry e
= ((GuidDeclarations
) parent
).addNewEntry();
1204 e
.setName(entryName
);
1206 e
.setGuidValue(guid
);
1207 e
.setHelpText(help
);
1208 e
.setGuidTypeList(guidTypeList
);
1209 e
.setSupArchList(archList
);
1210 e
.setSupModuleList(modTypeList
);
1211 // if (guidTypeList != null && guidTypeList.size() > 0) {
1212 // e.setGuidTypeList(new ArrayList<String>(guidTypeList));
1214 // if (archList != null && archList.size() > 0){
1215 // e.setSupArchList(new ArrayList<String>(archList));
1217 // if (modTypeList != null && modTypeList.size() > 0) {
1218 // e.setSupModuleList(new ArrayList<String>(modTypeList));
1222 if (parent
instanceof ProtocolDeclarationsDocument
.ProtocolDeclarations
) {
1223 ProtocolDeclarationsDocument
.ProtocolDeclarations
.Entry pe
= ((ProtocolDeclarationsDocument
.ProtocolDeclarations
) parent
)
1225 pe
.setName(entryName
);
1227 pe
.setGuidValue(guid
);
1228 pe
.setHelpText(help
);
1229 pe
.setSupArchList(archList
);
1230 pe
.setSupModuleList(modTypeList
);
1231 // if (archList != null && archList.size() > 0){
1232 // pe.setSupArchList(new ArrayList<String>(archList));
1234 // if (modTypeList != null && modTypeList.size() > 0) {
1235 // pe.setSupModuleList(new ArrayList<String>(modTypeList));
1239 if (parent
instanceof PpiDeclarationsDocument
.PpiDeclarations
) {
1240 PpiDeclarationsDocument
.PpiDeclarations
.Entry ppe
= ((PpiDeclarationsDocument
.PpiDeclarations
) parent
)
1242 ppe
.setName(entryName
);
1243 ppe
.setCName(cName
);
1244 ppe
.setGuidValue(guid
);
1245 ppe
.setHelpText(help
);
1246 ppe
.setSupArchList(archList
);
1247 ppe
.setSupModuleList(modTypeList
);
1248 // if (archList != null && archList.size() > 0){
1249 // ppe.setSupArchList(new ArrayList<String>(archList));
1251 // if (archList != null && modTypeList.size() > 0) {
1252 // ppe.setSupModuleList(new ArrayList<String>(modTypeList));
1262 Generate Pcd definition using parameters passed in
1264 @param pcdItemTypes ItemType attribute of PcdEntry element
1265 @param cName C_Name element value
1266 @param token Token element value
1267 @param dataType DatumType element value
1268 @param skuEnable Reserved
1270 @param maxSku Reserved
1271 @param hiiEnable Reserved
1272 @param varGuid Reserved
1273 @param varName Reserved
1274 @param defaultString DefaultString element value
1276 public void genSpdPcdDefinitions(String cName
, String token
, String dataType
, String pcdItemTypes
,
1277 String spaceGuid
, String defaultString
, String help
, String archList
,
1278 String modTypeList
) {
1279 if (getSpdPcdDefinitions() == null) {
1280 spdPcdDefinitions
= psaRoot
.addNewPcdDeclarations();
1283 setSpdPcdEntry(pcdItemTypes
, cName
, token
, dataType
, spaceGuid
, help
,
1284 defaultString
, archList
, modTypeList
, spdPcdDefinitions
);
1288 Set Pcd entry contents under parent tag
1290 @param pcdItemTypes ItemType attribute of PcdEntry element
1291 @param cName C_Name element value
1292 @param token Token element value
1293 @param dataType DatumType element value
1294 @param spaceGuid Reserved
1295 @param help Reserved
1296 @param defaultString DefaultString element value
1297 @param parent Tag under which PcdEntry goes to
1299 public void setSpdPcdEntry(String pcdItemTypes
, String cName
, String token
, String dataType
, String spaceGuid
, String help
,
1300 String defaultString
, String archList
, String modTypeList
, XmlObject parent
) {
1302 PcdDeclarationsDocument
.PcdDeclarations
.PcdEntry pe
= ((PcdDeclarationsDocument
.PcdDeclarations
) parent
).addNewPcdEntry();
1304 //ToDo: maybe multiple types in, need parse pcdItemTypes.
1305 String usage
[] = pcdItemTypes
.split("( )+");
1306 List
<String
> l
= new ArrayList
<String
>();
1307 for (int i
= 0; i
< usage
.length
; ++i
) {
1310 pe
.setValidUsage(l
);
1313 pe
.setDatumType(PcdDataTypes
.Enum
.forString(dataType
));
1314 pe
.setDefaultValue(defaultString
);
1315 pe
.setTokenSpaceGuidCName(spaceGuid
);
1316 pe
.setHelpText(help
);
1317 if (archList
!= null){
1318 pe
.setSupArchList(stringToList(archList
));
1320 if (pe
.isSetSupArchList()) {
1321 pe
.unsetSupArchList();
1324 if (modTypeList
!= null){
1325 pe
.setSupModuleList(stringToList(modTypeList
));
1327 if (pe
.isSetSupModuleList()) {
1328 pe
.unsetSupModuleList();
1334 Get PpiDeclarations element
1336 @return PpiDeclarationsDocument.PpiDeclarations
1338 public PpiDeclarationsDocument
.PpiDeclarations
getSpdPpiDeclarations() {
1339 if (spdPpiDeclarations
== null) {
1340 spdPpiDeclarations
= psaRoot
.getPpiDeclarations();
1342 return spdPpiDeclarations
;
1346 Get ProtocolDeclarations element
1348 @return ProtocolDeclarationsDocument.ProtocolDeclarations
1350 public ProtocolDeclarationsDocument
.ProtocolDeclarations
getSpdProtocolDeclarations() {
1351 if (spdProtocolDeclarations
== null) {
1352 spdProtocolDeclarations
= psaRoot
.getProtocolDeclarations();
1354 return spdProtocolDeclarations
;
1358 Get GuidDeclarations element
1360 @return GuidDeclarationsDocument.GuidDeclarations
1362 public GuidDeclarationsDocument
.GuidDeclarations
getSpdGuidDeclarations() {
1363 if (spdGuidDeclarations
== null) {
1364 spdGuidDeclarations
= psaRoot
.getGuidDeclarations();
1366 return spdGuidDeclarations
;
1370 Get PcdDefinitions element
1372 @return PcdDefinitionsDocument.PcdDefinitions
1374 public PcdDeclarationsDocument
.PcdDeclarations
getSpdPcdDefinitions() {
1375 if (spdPcdDefinitions
== null) {
1376 spdPcdDefinitions
= psaRoot
.getPcdDeclarations();
1378 return spdPcdDefinitions
;
1382 Get PackageHeaders element
1384 @return PackageHeadersDocument.PackageHeaders
1386 public PackageHeadersDocument
.PackageHeaders
getSpdModHdrs() {
1387 if (spdModHdrs
== null) {
1388 spdModHdrs
= psaRoot
.getPackageHeaders();
1394 Get MsaFiles element
1396 @return MsaFilesDocument.MsaFiles
1398 public MsaFilesDocument
.MsaFiles
getSpdMsaFiles() {
1399 if (spdMsaFiles
== null) {
1400 spdMsaFiles
= psaRoot
.getMsaFiles();
1406 Get LibraryClassDeclarations element
1408 @return LibraryClassDeclarationsDocument.LibraryClassDeclarations
1410 public LibraryClassDeclarationsDocument
.LibraryClassDeclarations
getSpdLibClassDeclarations() {
1411 if (spdLibClassDeclarations
== null) {
1412 spdLibClassDeclarations
= psaRoot
.getLibraryClassDeclarations();
1414 return spdLibClassDeclarations
;
1417 public PackageDefinitionsDocument
.PackageDefinitions
getSpdPkgDefs() {
1418 if (spdPkgDefs
== null) {
1419 spdPkgDefs
= psaRoot
.addNewPackageDefinitions();
1424 Get SpdHeader element
1426 @return SpdHeaderDocument.SpdHeader
1428 public SpdHeaderDocument
.SpdHeader
getSpdHdr() {
1429 if (spdHdr
== null) {
1430 spdHdr
= psaRoot
.addNewSpdHeader();
1436 Set value to Guid element
1438 @param guid The value set to Guid element
1440 public void setSpdHdrGuidValue(String guid
) {
1441 getSpdHdr().setGuidValue(guid
);
1445 Get Version element under SpdHdr
1449 public String
getSpdHdrVer() {
1450 return getSpdHdr().getVersion();
1454 Set value to Version element
1456 @param ver The value set to Version element
1458 public void setSpdHdrVer(String ver
) {
1459 getSpdHdr().setVersion(ver
);
1462 public String
getSpdHdrAbs(){
1463 return getSpdHdr().getAbstract();
1468 Set value to Abstract element
1470 @param abs The value set to Abstract element
1472 public void setSpdHdrAbs(String abs
) {
1474 getSpdHdr().setAbstract(abs
);
1477 public String
getSpdHdrDescription(){
1478 return getSpdHdr().getDescription();
1481 Set value to Description element
1483 @param des The value set to Description element
1485 public void setSpdHdrDescription(String des
) {
1486 getSpdHdr().setDescription(des
);
1489 public String
getSpdHdrCopyright(){
1490 return getSpdHdr().getCopyright();
1493 Set value to Copyright element
1495 @param cpRit The value set to Copyright element
1497 public void setSpdHdrCopyright(String cpRit
) {
1499 getSpdHdr().setCopyright(cpRit
);
1503 Get License element under SpdHdr
1507 public String
getSpdHdrLicense() {
1508 if (getSpdHdr().getLicense() != null) {
1509 return getSpdHdr().getLicense().getStringValue();
1515 Set value to License element
1517 @param license The value set to License element
1519 public void setSpdHdrLicense(String license
) {
1520 if (getSpdHdr().getLicense() == null){
1521 getSpdHdr().addNewLicense().setStringValue(license
);
1524 getSpdHdr().getLicense().setStringValue(license
);
1528 public String
getSpdHdrUrl(){
1529 if (getSpdHdr().getLicense() != null) {
1530 return getSpdHdr().getLicense().getURL();
1535 public void setSpdHdrUrl(String url
){
1536 getSpdHdr().getLicense().setURL(url
);
1540 Get PackageName element under SpdHdr
1544 public String
getSpdHdrPkgName() {
1546 return getSpdHdr().getPackageName();
1550 Set value to PackageName element
1552 @param pkgName The value set to PackageName element
1554 public void setSpdHdrPkgName(String pkgName
) {
1555 getSpdHdr().setPackageName(pkgName
);
1558 public String
getSpdHdrGuidValue(){
1559 return getSpdHdr().getGuidValue();
1565 @return SpecificationDocument.Specification
1567 public String
getSpdHdrSpec() {
1568 return "FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052";
1569 // return getSpdHdr().getSpecification();
1577 public void setSpdHdrSpec(String spec
) {
1578 spec
= "FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052";
1579 getSpdHdr().setSpecification(spec
);
1583 public String
getSpdPkgDefsRdOnly(){
1584 return getSpdPkgDefs().getReadOnly() + "";
1587 Set value to ReadOnly element
1589 @param rdOnly The value set to ReadOnly element
1591 public void setSpdPkgDefsRdOnly(String rdOnly
) {
1593 getSpdPkgDefs().setReadOnly(new Boolean(rdOnly
));
1596 public String
getSpdPkgDefsRePkg(){
1597 return getSpdPkgDefs().getRePackage() + "";
1600 Set value to RePackage element
1602 @param rePkg The value set to RePackage element
1604 public void setSpdPkgDefsRePkg(String rePkg
) {
1606 getSpdPkgDefs().setRePackage(new Boolean(rePkg
));
1610 Set value to URL element
1612 @param url The value set to URL element
1614 // public void setSpdHdrURL(String url) {
1615 // getSpdHdr().setURL(url);
1623 public File
getFile() {
1630 @param file File with xml format
1632 public void setFile(File file
) {
1636 private List
<String
> stringToList(String s
){
1637 if (s
== null || s
.length() == 0) {
1640 Vector
<String
> al
= new Vector
<String
>();
1641 String
[] sArray
= s
.split(" ");
1642 for(int i
= 0; i
< sArray
.length
; ++i
){
1648 private String
listToString(List l
) {
1653 ListIterator li
= l
.listIterator();
1654 while(li
.hasNext()) {