if (instances.length < min)
{
Object[] filler = {
qname, new Integer(min), new Integer(instances.length)
};
throw new SchemaValidationFault(_MESSAGES.get("BelowMinimum", filler));
}
//
// under the max?
//
if (!maxUnbounded && instances.length > max)
{
Object[] filler = {
qname, new Integer(min), new Integer(instances.length)
};
throw new SchemaValidationFault(_MESSAGES.get("AboveMaximum", filler));
}
//
// are any instances null that shouldn't be?
//
String message = _MESSAGES.get("NotNillable", new Object[]{ qname });
if (!isNillable)
{
for (int n = 0; n < instances.length; ++n)
{
//
// check for child elements, attributes, and text, all of
// which qualify an element as "not null"
//
if (!instances[n].hasChildNodes() &&
!instances[n].hasAttributes() &&
XmlUtils.extractText(instances[n]) == null)
throw new SchemaValidationFault(message);
}
}
}
}