gnodet commented on code in PR #1194:
URL: https://github.com/apache/maven/pull/1194#discussion_r1253258499
##########
api/maven-api-settings/src/main/mdo/settings.mdo:
##########
@@ -535,6 +539,62 @@
<type>String</type>
</field>
</fields>
+ <codeSegments>
+ <codeSegment>
+ <version>1.0.0/1.3.0</version>
+ <code>
+ <![CDATA[
+ public boolean isActive() {
+ return (getActiveString() != null) ?
Boolean.parseBoolean(getActiveString()) : true;
+ }
+
+ public void setActive(boolean active) {
+ setActiveString(String.valueOf(active));
+ }
+
+ public int getPort() {
+ return (getPortString() != null) ? Integer.parseInt(getPortString()) :
8080;
+ }
+
+ public void setPort(int port) {
+ setPortString(String.valueOf(port));
Review Comment:
Well, I think that's because the object model is generated from the `mdo`
model. Modello does not include any kind of constraints for the values apart
from enumeration iirc. The same applies to the XSD which has no constraints at
all. I think that's why all the validation is done separately from the
parsing. This also allow enforcing/relaxing rules, depending on whether the
loaded POM is loaded from the reactor or from a dependency (therefore out of
direct control).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]