*
*/
protected void validateInsert(QName qname, int currentSize, Element[] values)
throws BaseFault
{
ResourcePropertiesSchema schema = getSchema();
//
// make sure that adding value.length instances will not put us
// above the maximum (if any)
//
int max = schema.getMaxOccurs(qname);
int total = currentSize + values.length;
if (!_schema.isMaxUnbounded(qname) && total > max)
{
Object[] filler = { qname, new Integer(max), new Integer(total) };
throw new SchemaValidationFault(_MESSAGES.get("AboveMaximumPotential", filler));
}
//
// are we trying to set to null when we shouldn't be?
//
boolean isNillable = schema.isNillable(qname);
for (int n = 0; n < values.length; ++n)
{
if (!isNillable && !values[n].hasChildNodes())
{