Skip to content

Commit

Permalink
#83 add the package property validation to the NamespacedMetamodelEle…
Browse files Browse the repository at this point in the history
…ment class
  • Loading branch information
csun-cpointe committed Jan 23, 2025
1 parent 587d532 commit 7e4a7fb
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.Objects;

import org.apache.commons.lang3.StringUtils;
import org.technologybrewery.fermenter.mda.element.ValidatedElement;

import com.fasterxml.jackson.annotation.JsonInclude;
Expand Down Expand Up @@ -81,4 +82,12 @@ public String toString() {
return MoreObjects.toStringHelper(this).add(PACKAGE, getPackage()).add(NAME, name).toString();
}

@Override
public void validate() {
super.validate();
if (StringUtils.isBlank(getPackage())) {
messageTracker.addErrorMessage("Package is a required attribute!");
}
}

}

0 comments on commit 7e4a7fb

Please sign in to comment.