while (policyIterator.hasNext()) {
String policyAttribute = policyIterator.next();
if (!CMBPolicy.POLICY_ATTRIBUTES.contains(policyAttribute)) {
throw new CMBException(CMBErrorCodes.InvalidAttributeValue, "Invalid value for the parameter Policy");
}
}
JSONArray stmts = json.getJSONArray("Statement");
if (stmts != null) {
for (int i=0; i<stmts.length(); i++) {
Iterator<String> stmtIterator = stmts.getJSONObject(i).keys();
while (stmtIterator.hasNext()) {
String statementAttribute = stmtIterator.next();
if (!CMBPolicy.STATEMENT_ATTRIBUTES.contains(statementAttribute)) {
throw new CMBException(CMBErrorCodes.InvalidAttributeValue, "Invalid value for the parameter Policy");
}
}
}
}