ContentModel nested = bounded.getContentModel();
int minimum = bounded.getMinimum();
int maximum = bounded.getMaximum();
// Get the validator for the nested content.
ContentValidator nestedValidator = processReferencedValidator(nested);
if (nestedValidator == null) {
return;
}
if (minimum == 0 && maximum == 1) {
// optional
contentValidator = prototypeFactory.createBoundedContentValidator(
nestedValidator, minimum, maximum);
} else if (minimum == 0 && maximum == Integer.MAX_VALUE) {
// unlimited
// If the elementValidator requires per element state then we need
// to wrap it in a repeating validator but otherwise we can just
// return it as is.
if (nestedValidator.requiresPerElementState()) {
contentValidator =
prototypeFactory.createBoundedContentValidator(
nestedValidator, minimum, maximum);
} else {
contentValidator =