Code Review
/
policy
/
engine.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Included Policy GUI Enhancements and validations
[policy/engine.git]
/
ONAP-REST
/
src
/
main
/
java
/
org
/
onap
/
policy
/
rest
/
util
/
MSModelUtils.java
diff --git
a/ONAP-REST/src/main/java/org/onap/policy/rest/util/MSModelUtils.java
b/ONAP-REST/src/main/java/org/onap/policy/rest/util/MSModelUtils.java
index
3880b35
..
e96396e
100644
(file)
--- a/
ONAP-REST/src/main/java/org/onap/policy/rest/util/MSModelUtils.java
+++ b/
ONAP-REST/src/main/java/org/onap/policy/rest/util/MSModelUtils.java
@@
-315,7
+315,11
@@
public class MSModelUtils {
if (annotation && obj instanceof EReference) {
EClass refType = ((EReference) obj).getEReferenceType();
if(!refType.toString().contains(eProxyURI)){
if (annotation && obj instanceof EReference) {
EClass refType = ((EReference) obj).getEReferenceType();
if(!refType.toString().contains(eProxyURI)){
- subAttribute.put(eStrucClassifier.getName(), refType.getName());
+ String required = ":required-false";
+ if(eStrucClassifier.getLowerBound() == 1){
+ required = ":required-true";
+ }
+ subAttribute.put(eStrucClassifier.getName(), refType.getName() + required);
}
}
}
}
}
}
@@
-390,18
+394,28
@@
public class MSModelUtils {
refAttribute.put(eStrucClassifier.getName(), refValue);
} else {
String array = arrayCheck(((EStructuralFeature) obj).getUpperBound());
refAttribute.put(eStrucClassifier.getName(), refValue);
} else {
String array = arrayCheck(((EStructuralFeature) obj).getUpperBound());
- refAttribute.put(eStrucClassifier.getName(), refType.getName() + array);
+ String required = ":required-false";
+ if(((EStructuralFeature) obj).getLowerBound() == 1){
+ required = ":required-true";
+ }
+ refAttribute.put(eStrucClassifier.getName(), refType.getName() + array + required);
}
} else if (annotation && obj instanceof EAttributeImpl){
EClassifier refType = ((EAttributeImpl) obj).getEType();
if (refType instanceof EEnumImpl){
String array = arrayCheck(((EStructuralFeature) obj).getUpperBound());
}
} else if (annotation && obj instanceof EAttributeImpl){
EClassifier refType = ((EAttributeImpl) obj).getEType();
if (refType instanceof EEnumImpl){
String array = arrayCheck(((EStructuralFeature) obj).getUpperBound());
- refAttribute.put(eStrucClassifier.getName(), refType.getName() + array); }
+ String required = ":required-false";
+ if(((EStructuralFeature) obj).getLowerBound() == 1){
+ required = ":required-true";
+ }
+ refAttribute.put(eStrucClassifier.getName(), refType.getName() + array + required);
+ }
}
}
}
}
}
}
}
}
}
}
+
return refAttribute;
}
return refAttribute;
}