if (ReflectUtils.isArrayOrCollection(pd.getType())) { // collection/array
// TODO RDFList support here
int pSize = rsc.listProperties(pd.getRDFObject()).toSet().size();
int minCard = pd.getMinCardinality();
if (pSize < minCard) { // not satisfy min cardinality.
throw new RequiredPropertyException(format(
"At least {0} \"{1}\" must be set.", minCard, pd
.getRDFObject()));
}
} else { // single type
if (pd.isRequired() // required but not...
&& !rsc.hasProperty(pd.getRDFObject())) {
throw new RequiredPropertyException(format(
"{0}({1}) is required.", pd.getPropertyField()
.getName(), pd.getRDFObject()));
}
}
}