/** Checks that the occurrences of the corresponding node in the parent conforms to the specialised node's occurrences * * @param parentNode * @param ccobj * @param errors */ private void checkSpecialisedOccurrencesCompatiblity(CObject parentNode, CObject ccobj, List<ValidationError> errors) { if (! parentNode.getOccurrences().isUpperUnbounded() && ( ccobj.getOccurrences().isUpperUnbounded() || parentNode.getOccurrences().getUpper().compareTo( ccobj.getOccurrences().getUpper()) <0)) { errors.add(new ValidationError (ErrorType.VSONCO, null, getIntervalFormalString(ccobj.getOccurrences()), ccobj.path(), getIntervalFormalString(parentNode.getOccurrences()), parentNode.path())); } }
private static void setCardinalities(PathableVO pathableVO, CObject constrainedObj) { pathableVO.setLowerCardinality(constrainedObj.getOccurrences().getLower()); pathableVO.setUpperCardinality(constrainedObj.getOccurrences().getUpper()); }
protected void printCObjectElements(CObject cobj, Element out) { // we always need the upper case with underscore notation for the rm type name printString("rm_type_name", getUpperCaseWithUnderscoreFromCamelCase(cobj.getRmTypeName()), out); printOccurrences(cobj.getOccurrences(), out); printString("node_id", cobj.getNodeId(), out); }
Interval<Integer> occurrences = cobj.getOccurrences();
for (CObject cobj : cmattr.getChildren()) { minOcc += cobj.getOccurrences().getLower(); if (cobj.getOccurrences().isUpperUnbounded()) { isOccUpperUnbounded = true; } else { maxOcc += cobj.getOccurrences().getUpper();
Interval<Integer> occurrences = cobj.getOccurrences();
Interval<Integer> occurrences = cobj.getOccurrences();
Interval<Integer> occu = cobj.getOccurrences(); if (occu != null && occu.isUpperIncluded() && occu.getUpper() > 1) { ((CMultipleAttribute) cattr).getCardinality().getInterval(); if (!cardinalityInterval.isUpperUnbounded() && (cobj.getOccurrences().isUpperUnbounded() || cardinalityInterval.getUpper().compareTo( cobj.getOccurrences().getUpper()) < 0)) { error = new ValidationError(ErrorType.VACMC, "CONTAIN", rmInspector.toUnderscoreSeparated(cobj.getClass().getSimpleName()).toUpperCase(), cobj.getNodeId(), getIntervalFormalString(cardinalityInterval), getIntervalFormalString(cobj.getOccurrences()), cattr.path());
void applyRule(Archetype archetype, Statement rule) throws FlatteningException { log.debug("apply rule [" + rule + "] on archetype: " + archetype.getArchetypeId().toString()); String path = rule.getPath(); ArchetypeConstraint constraint = archetype.node(rule.getPath()); if (constraint == null) { throw new FlatteningException("no constraint on path: " + path + " of " + archetype.getArchetypeId()); } constraint = applyNameConstraint(archetype, constraint, rule.getName(), path); applyOccurrencesConstraints(archetype, constraint, rule); applyDefaultValueConstraint(constraint, rule.getDefault()); applyHideOnFormConstraint(constraint, rule.getHideOnForm()); applyAnnotationConstraint(constraint, rule.getAnnotation()); applyValueConstraint(archetype, constraint, rule); archetype.updatePathNodeMap((CObject) constraint); if (constraint != null) { log.debug("newly set Occurrences: " + ((CObject) constraint).getOccurrences()); } }
if (!c1.getOccurrences().equals(c2.getOccurrences())) { return false;