*/
private Collection validateCardinalConstraint(Validatee validatee,
String elementName, String elementDtdName){
ArrayList failures = new ArrayList();
int cardinal = validatee.getElementCardinal(elementName);
CardinalConstraint constraint = getCardinalConstraint(cardinal);
switch(cardinal){
case Constants.MANDATORY_ARRAY :
case Constants.OPTIONAL_ARRAY: {
Object[] elements =
(Object [])validatee.getElements(elementName);
String name = validatee.getIndexedXPath() +
Constants.XPATH_DELIMITER + elementDtdName;
///String name = validatee.getXPath() +
///Constants.XPATH_DELIMITER + elementDtdName;
failures.addAll(constraint.match(elements, name));
break;
}
case Constants.OPTIONAL_ELEMENT : {
Object element = validatee.getElement(elementName);
break;
}
case Constants.MANDATORY_ELEMENT :
default : {
Object element = validatee.getElement(elementName);
String name = validatee.getIndexedXPath() +
Constants.XPATH_DELIMITER + elementDtdName;
///String name = validatee.getXPath() +
///Constants.XPATH_DELIMITER + elementDtdName;
failures.addAll(constraint.match(element, name));
}
break;
}
return failures;
}