code: public Policy createPolicyFromJsonString(String jsonString) {
          if (jsonString == null) {
              throw new IllegalArgumentException("JSON string cannot be null");
          }
  
          JsonNode policyNode;
          JsonNode idNode;
          JsonNode statementsNode;
          Policy policy = new Policy();
          List<Statement> statements = new LinkedList<Statement>();
  
          try {
              policyNode = Jackson.jsonNodeOf(jsonString);
  
              idNode = policyNode.get(JsonDocumentFields.POLICY_ID);
              if (isNotNull(idNode)) {
                  policy.setId(idNode.asText());
              }
  
              statementsNode = policyNode.get(JsonDocumentFields.STATEMENT);
              if (isNotNull(statementsNode)) {
                  if (statementsNode.isObject()) {
                      statements.add(statementOf(statementsNode));
                  } else if (statementsNode.isArray()) {
                      for (JsonNode statementNode : statementsNode) {
                          statements.add(statementOf(statementNode));
                      }
                  }
              }
  
          } catch (Exception e) {
              String message = "Unable to generate policy object fron JSON string "
                      + e.getMessage();
              throw new IllegalArgumentException(message, e);
          }
          policy.setStatements(statements);
          return policy;
      }
docs: Converts the specified JSON string to an AWS policy object.
  
  For more information see, @see
  http://docs.aws.amazon.com/AWSSdkDocsJava/latest
  /DeveloperGuide/java-dg-access-control.html
  
  @param jsonString
  the specified JSON string representation of this AWS access
  control policy.
  
  @return An AWS policy object.
  
  @throws IllegalArgumentException
  If the specified JSON string is null or invalid and cannot be
  converted to an AWS policy object.