if (null == schema)
return;
// !!! below we are checking stuff that is supposed to be already checked by prov.xsd (e.g. many null check) !!!
SchemaValidationEnum valType = schema.getType();
if (null == valType)
throw new IllegalArgumentException(ERROR_PREFIX + "missing validation type");
List<ResourceItem> resList = schema.getResourcesList();
/* this below is checked by a "XML Validation Error"
if (null == resList || resList.size() < 1)
throw new IllegalArgumentException(ERROR_PREFIX + "expecting at least one resource");
*/
int coutMain = 0;
int countRule = 1;
Set<String> ruleNameSet = new HashSet<String>();
for (ResourceItem resourceItem : resList) {
String resourceName = resourceItem.getName();
if (null == resourceName)
throw new IllegalArgumentException(ERROR_PREFIX + "missing resource name for rule nb:" + countRule);
if (!resourceName.endsWith(valType.value())) {
// OAPEEE-145
throw new IllegalArgumentException(ERROR_PREFIX + "rule:'" + resourceName + "' should have extension:" + valType.value());
}
if (ruleNameSet.contains(resourceName)) {
// OAPEEE-146
throw new IllegalArgumentException(ERROR_PREFIX + "more than one rule named:" + resourceName);
}