if (isUnsupportedPath(oakPath) && !restrictionProperties.isEmpty()) {
throw new AccessControlException("Restrictions not supported with 'null' path.");
}
for (Map.Entry<String, PropertyState> entry : restrictionProperties.entrySet()) {
String restrName = entry.getKey();
RestrictionDefinition def = supported.get(restrName);
if (def == null) {
throw new AccessControlException("Unsupported restriction: " + restrName);
}
int type = entry.getValue().getType().tag();
if (type != def.getRequiredType()) {
throw new AccessControlException("Invalid restriction type '" + PropertyType.nameFromValue(type) + "'. Expected " + PropertyType.nameFromValue(def.getRequiredType()));
}
}
for (RestrictionDefinition def : supported.values()) {
if (def.isMandatory() && !restrictionProperties.containsKey(def.getName())) {
throw new AccessControlException("Mandatory restriction " + def.getName() + " is missing.");
}
}
}