1 package org
.tianocore
.migration
;
3 import org
.tianocore
.*;
5 public class MsaOwner
{
6 public static final String COPYRIGHT
= "Copyright (c) 2006, Intel Corporation";
7 public static final String VERSION
= "1.0";
8 public static final String ABSTRACT
= "Component name for module ";
9 public static final String DESCRIPTION
= "FIX ME!";
10 public static final String LICENSE
= "All rights reserved.\n" +
11 " This software and associated documentation (if any) is furnished\n" +
12 " under a license and may only be used or copied in accordance\n" +
13 " with the terms of the license. Except as permitted by such\n" +
14 " license, no part of this software or documentation may be\n" +
15 " reproduced, stored in a retrieval system, or transmitted in any\n" +
16 " form or by any means without the express written consent of\n" +
17 " Intel Corporation.";
18 public static final String SPECIFICATION
= "FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052";
20 private ModuleSurfaceAreaDocument msadoc
= ModuleSurfaceAreaDocument
.Factory
.newInstance();
22 private ModuleSurfaceAreaDocument
.ModuleSurfaceArea msa
= null;
23 private MsaHeaderDocument
.MsaHeader msaheader
= null;
24 private LicenseDocument
.License license
= null;
25 private ModuleDefinitionsDocument
.ModuleDefinitions md
= null;
26 private SourceFilesDocument
.SourceFiles sourcefiles
= null; //found local .h files are not written
27 private GuidsDocument
.Guids guids
= null;
28 private ProtocolsDocument
.Protocols protocols
= null;
29 private PPIsDocument
.PPIs ppis
= null;
30 private PackageDependenciesDocument
.PackageDependencies pd
= null;
31 private LibraryClassDefinitionsDocument
.LibraryClassDefinitions libclassdefs
= null;
32 private ExternsDocument
.Externs externs
= null;
34 //-----------------------------msaheader-------------------------------------//
35 public final boolean addSpecification (String specification
) {
36 if (msaheader
.getSpecification() == null) {
37 if (specification
== null) {
38 msaheader
.setSpecification(SPECIFICATION
);
40 msaheader
.setSpecification(specification
);
44 MigrationTool
.ui
.println ("Warning: Duplicate Specification");
49 public final boolean addLicense (String licensecontent
) {
50 if (msaheader
.getLicense() == null) {
51 license
= msaheader
.addNewLicense();
52 if (licensecontent
== null) {
53 license
.setStringValue(LICENSE
);
55 license
.setStringValue(licensecontent
);
59 MigrationTool
.ui
.println ("Warning: Duplicate License");
64 public final boolean addDescription (String description
) {
65 if (msaheader
.getDescription() == null) {
66 if (description
== null) {
67 msaheader
.setDescription(DESCRIPTION
);
69 msaheader
.setDescription(description
);
73 MigrationTool
.ui
.println ("Warning: Duplicate Description");
78 public final boolean addAbstract (String abs
) {
79 if (msaheader
.getAbstract() == null) {
81 msaheader
.setAbstract(ABSTRACT
+ msaheader
.getModuleName());
83 msaheader
.setVersion(abs
);
87 MigrationTool
.ui
.println ("Warning: Duplicate Abstract");
92 public final boolean addVersion (String version
) {
93 if (msaheader
.getVersion() == null) {
94 if (version
== null) {
95 msaheader
.setVersion(VERSION
);
97 msaheader
.setVersion(version
);
101 MigrationTool
.ui
.println ("Warning: Duplicate Version");
106 public final boolean addCopyRight (String copyright
) {
107 if (msaheader
.getCopyright() == null) {
108 if (copyright
== null) {
109 msaheader
.setCopyright(COPYRIGHT
);
111 msaheader
.setCopyright(copyright
);
115 MigrationTool
.ui
.println ("Warning: Duplicate CopyRight");
120 public final boolean addModuleType (String moduletype
) {
121 if (msaheader
.getModuleType() == null) {
122 msaheader
.setModuleType(ModuleTypeDef
.Enum
.forString(moduletype
));
125 MigrationTool
.ui
.println ("Warning: Duplicate ModuleType");
130 public final boolean addGuidValue (String guidvalue
) {
131 if (msaheader
.getGuidValue() == null) {
132 msaheader
.setGuidValue(guidvalue
);
135 MigrationTool
.ui
.println ("Warning: Duplicate GuidValue");
140 public final boolean addModuleName (String modulename
) {
141 if (msaheader
.getModuleName() == null) {
142 msaheader
.setModuleName(modulename
);
145 MigrationTool
.ui
.println ("Warning: Duplicate ModuleName");
149 //-----------------------------msaheader-------------------------------------//
151 public final void addSourceFiles (String filename
, int arch
) {
155 private final MsaOwner
init () {
156 msa
= msadoc
.addNewModuleSurfaceArea();
157 msaheader
= msa
.addNewMsaHeader();
158 md
= msa
.addNewModuleDefinitions();
159 sourcefiles
= msa
.addNewSourceFiles();
160 pd
= msa
.addNewPackageDependencies();
161 libclassdefs
= msa
.addNewLibraryClassDefinitions();
162 externs
= msa
.addNewExterns();
166 public static final MsaOwner
initNewMsaOwner() {
167 return new MsaOwner().init();