Object tempObject;
//3--The descriptor is multivalued
if (fieldDesc.isMultivalued()) {
//-- check size
FieldValidator validator = fieldDesc.getValidator();
if (validator != null) {
if (validator.getMaxOccurs() < 0) {
result = true;
}
else {
// count current objects and add 1
tempObject = fieldDesc.getHandler().getValue(object);
int current = Array.getLength(tempObject);
int newTotal = current + 1;
result = (newTotal <= validator.getMaxOccurs());
}
}
else {
//-- not created by source generator...assume unbounded
result = true;