JsonNode effect = jStatement.get(JsonDocumentFields.STATEMENT_EFFECT);
if (!isNotNull(effect))
return null;
Statement statement = new Statement(Effect.valueOf(effect.asText()));
JsonNode id = jStatement.get(JsonDocumentFields.STATEMENT_ID);
if (isNotNull(id)) {
statement.setId(id.asText());
}
JsonNode actionNodes = jStatement.get(JsonDocumentFields.ACTION);
if (isNotNull(actionNodes))
statement.setActions(actionsOf(actionNodes));
JsonNode resourceNodes = jStatement.get(JsonDocumentFields.RESOURCE);
if (isNotNull(resourceNodes))
statement.setResources(resourcesOf(resourceNodes));
JsonNode conditionNodes = jStatement.get(JsonDocumentFields.CONDITION);
if (isNotNull(conditionNodes))
statement.setConditions(conditionsOf(conditionNodes));
JsonNode principalNodes = jStatement.get(JsonDocumentFields.PRINCIPAL);
if (isNotNull(principalNodes))
statement.setPrincipals(principalOf(principalNodes));
return statement;
}