1 package org
.tianocore
.frameworkwizard
.platform
.ui
.id
;
5 import org
.tianocore
.frameworkwizard
.platform
.ui
.global
.WorkspaceProfile
;
7 public class ModuleIdentification
extends Identification
{
9 private PackageIdentification packageId
;
13 private String moduleType
;
15 private boolean isLibrary
= false;
17 public boolean isLibrary() {
21 public void setLibrary(boolean isLibrary
) {
22 this.isLibrary
= isLibrary
;
25 public File
getMsaFile() throws Exception
{
30 public String
getModuleRelativePath() throws Exception
{
32 return msaFile
.getParent().substring(packageId
.getPackageDir().length() + 1);
35 private void prepareMsaFile()throws Exception
{
36 if (msaFile
== null) {
37 msaFile
= WorkspaceProfile
.getModuleFile(this);
40 public void setMsaFile(File msaFile
) {
41 this.msaFile
= msaFile
;
44 public ModuleIdentification(String name
, String guid
, String version
){
45 super(name
, guid
, version
);
48 public ModuleIdentification(String name
, String guid
, String version
, PackageIdentification packageId
){
49 super(name
, guid
, version
);
50 this.packageId
= packageId
;
53 public boolean equals(Object obj
) {
54 if (obj
instanceof ModuleIdentification
) {
55 ModuleIdentification id
= (ModuleIdentification
)obj
;
56 if (guid
.equals(id
.getGuid()) && packageId
.equals(id
.getPackage())) {
57 if (version
== null || id
.version
== null) {
58 updateName(name
, id
.name
);
61 else if (version
.trim().equalsIgnoreCase("") || id
.version
.trim().equalsIgnoreCase("")){
62 updateName(name
, id
.name
);
65 else if (version
.equalsIgnoreCase(id
.version
)) {
66 updateName(name
, id
.name
);
73 return super.equals(obj
);
77 public String
toString(){
78 if (version
== null || version
.trim().equalsIgnoreCase("")) {
79 return "Module [" + name
+ "] in " + packageId
;
82 return "Module [" + name
+ " " + version
+ "] in " + packageId
;
86 public void setPackage(PackageIdentification packageId
) {
87 this.packageId
= packageId
;
90 public PackageIdentification
getPackage() {
94 public String
getModuleType() {
98 public void setModuleType(String moduleType
) {
99 this.moduleType
= moduleType
;