Skip to content

Commit

Permalink
Merge pull request #85 from csun-cpointe/#83-add-package-prop-validat…
Browse files Browse the repository at this point in the history
…ion-to-namespacedmadamodel

#83 add the package property validation to the NamespacedMetamodelEle…
  • Loading branch information
d-ryan-ashcraft authored Jan 23, 2025
2 parents 587d532 + 7e4a7fb commit dd0a5af
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 dd0a5af

Please sign in to comment.