first step for MsaOwner in ModuleInfo
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1595 6f19259b-4bc3-4df7-8a09-765794883524
diff --git a/Tools/Source/MigrationTools/org/tianocore/migration/ModuleInfo.java b/Tools/Source/MigrationTools/org/tianocore/migration/ModuleInfo.java
index 0799bf5..01aa129 100644
--- a/Tools/Source/MigrationTools/org/tianocore/migration/ModuleInfo.java
+++ b/Tools/Source/MigrationTools/org/tianocore/migration/ModuleInfo.java
@@ -15,6 +15,8 @@
import java.io.*;
import java.util.*;
+import org.tianocore.ModuleSurfaceAreaDocument;
+
/*
Class ModuleInfo is built for scanning the source files, it contains all the needed
information and all the temporary data.
@@ -28,6 +30,9 @@
public final String modulepath;
public final String temppath;
+ private MsaOwner msaowner = new MsaWriter(this);
+ public ModuleSurfaceAreaDocument msadoc = ModuleSurfaceAreaDocument.Factory.newInstance();
+
public String modulename = null;
public String guidvalue = null;
public String moduletype = null;
diff --git a/Tools/Source/MigrationTools/org/tianocore/migration/MsaOwner.java b/Tools/Source/MigrationTools/org/tianocore/migration/MsaOwner.java
new file mode 100644
index 0000000..4cc133e
--- /dev/null
+++ b/Tools/Source/MigrationTools/org/tianocore/migration/MsaOwner.java
@@ -0,0 +1,5 @@
+package org.tianocore.migration;
+
+public interface MsaOwner {
+ public void addSourceFiles(String filename, int arch);
+}
diff --git a/Tools/Source/MigrationTools/org/tianocore/migration/MsaWriter.java b/Tools/Source/MigrationTools/org/tianocore/migration/MsaWriter.java
index 7db15dc..15fafe3 100644
--- a/Tools/Source/MigrationTools/org/tianocore/migration/MsaWriter.java
+++ b/Tools/Source/MigrationTools/org/tianocore/migration/MsaWriter.java
@@ -19,14 +19,14 @@
import org.tianocore.SupportedArchitectures.Enum;
import org.apache.xmlbeans.*;
-public class MsaWriter {
- MsaWriter(ModuleInfo moduleinfo) {
- mi = moduleinfo;
- }
-
+public class MsaWriter implements MsaOwner {
+ MsaWriter(ModuleInfo moduleinfo) {
+ mi = moduleinfo;
+ msadoc = mi.msadoc;
+ }
+
private ModuleInfo mi;
-
- private ModuleSurfaceAreaDocument msadoc = ModuleSurfaceAreaDocument.Factory.newInstance();
+ private ModuleSurfaceAreaDocument msadoc;
private ModuleSurfaceAreaDocument.ModuleSurfaceArea msa = msadoc.addNewModuleSurfaceArea();
private MsaHeaderDocument.MsaHeader msaheader = msa.addNewMsaHeader();
@@ -207,6 +207,14 @@
bw.close();
}
+ //---------------------------MsaOwner---------------------------------//
+
+ public void addSourceFiles(String filename, int arch) {
+
+ }
+
+ //---------------------------MsaOwner---------------------------------//
+
public static final void parse(String msafile) throws Exception {
ModuleSurfaceAreaDocument msadoc = ModuleSurfaceAreaDocument.Factory.parse(msafile);
flush("c:\\temp.msa", msadoc);