コード例 #1
0
  public CreateGrantResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    CreateGrantResult createGrantResult = new CreateGrantResult();

    int originalDepth = context.getCurrentDepth();
    String currentParentElement = context.getCurrentParentElement();
    int targetDepth = originalDepth + 1;

    JsonToken token = context.getCurrentToken();
    if (token == null) token = context.nextToken();
    if (token == VALUE_NULL) return null;

    while (true) {
      if (token == null) break;

      if (token == FIELD_NAME || token == START_OBJECT) {
        if (context.testExpression("GrantToken", targetDepth)) {
          context.nextToken();
          createGrantResult.setGrantToken(
              context.getUnmarshaller(String.class).unmarshall(context));
        }
        if (context.testExpression("GrantId", targetDepth)) {
          context.nextToken();
          createGrantResult.setGrantId(context.getUnmarshaller(String.class).unmarshall(context));
        }
      } else if (token == END_ARRAY || token == END_OBJECT) {
        if (context.getLastParsedParentElement() == null
            || context.getLastParsedParentElement().equals(currentParentElement)) {
          if (context.getCurrentDepth() <= originalDepth) break;
        }
      }
      token = context.nextToken();
    }

    return createGrantResult;
  }
コード例 #2
0
  public GrantListEntry unmarshall(JsonUnmarshallerContext context) throws Exception {
    GrantListEntry grantListEntry = new GrantListEntry();

    int originalDepth = context.getCurrentDepth();
    String currentParentElement = context.getCurrentParentElement();
    int targetDepth = originalDepth + 1;

    JsonToken token = context.getCurrentToken();
    if (token == null) token = context.nextToken();
    if (token == VALUE_NULL) return null;

    while (true) {
      if (token == null) break;

      if (token == FIELD_NAME || token == START_OBJECT) {
        if (context.testExpression("KeyId", targetDepth)) {
          context.nextToken();
          grantListEntry.setKeyId(context.getUnmarshaller(String.class).unmarshall(context));
        }
        if (context.testExpression("GrantId", targetDepth)) {
          context.nextToken();
          grantListEntry.setGrantId(context.getUnmarshaller(String.class).unmarshall(context));
        }
        if (context.testExpression("Name", targetDepth)) {
          context.nextToken();
          grantListEntry.setName(context.getUnmarshaller(String.class).unmarshall(context));
        }
        if (context.testExpression("CreationDate", targetDepth)) {
          context.nextToken();
          grantListEntry.setCreationDate(
              context.getUnmarshaller(java.util.Date.class).unmarshall(context));
        }
        if (context.testExpression("GranteePrincipal", targetDepth)) {
          context.nextToken();
          grantListEntry.setGranteePrincipal(
              context.getUnmarshaller(String.class).unmarshall(context));
        }
        if (context.testExpression("RetiringPrincipal", targetDepth)) {
          context.nextToken();
          grantListEntry.setRetiringPrincipal(
              context.getUnmarshaller(String.class).unmarshall(context));
        }
        if (context.testExpression("IssuingAccount", targetDepth)) {
          context.nextToken();
          grantListEntry.setIssuingAccount(
              context.getUnmarshaller(String.class).unmarshall(context));
        }
        if (context.testExpression("Operations", targetDepth)) {
          context.nextToken();
          grantListEntry.setOperations(
              new ListUnmarshaller<String>(context.getUnmarshaller(String.class))
                  .unmarshall(context));
        }
        if (context.testExpression("Constraints", targetDepth)) {
          context.nextToken();
          grantListEntry.setConstraints(
              GrantConstraintsJsonUnmarshaller.getInstance().unmarshall(context));
        }
      } else if (token == END_ARRAY || token == END_OBJECT) {
        if (context.getLastParsedParentElement() == null
            || context.getLastParsedParentElement().equals(currentParentElement)) {
          if (context.getCurrentDepth() <= originalDepth) break;
        }
      }
      token = context.nextToken();
    }

    return grantListEntry;
  }
コード例 #3
0
  public AliasListEntry unmarshall(JsonUnmarshallerContext context) throws Exception {
    AliasListEntry aliasListEntry = new AliasListEntry();

    int originalDepth = context.getCurrentDepth();
    String currentParentElement = context.getCurrentParentElement();
    int targetDepth = originalDepth + 1;

    JsonToken token = context.getCurrentToken();
    if (token == null) token = context.nextToken();
    if (token == VALUE_NULL) return null;

    while (true) {
      if (token == null) break;

      if (token == FIELD_NAME || token == START_OBJECT) {
        if (context.testExpression("AliasName", targetDepth)) {
          context.nextToken();
          aliasListEntry.setAliasName(context.getUnmarshaller(String.class).unmarshall(context));
        }
        if (context.testExpression("AliasArn", targetDepth)) {
          context.nextToken();
          aliasListEntry.setAliasArn(context.getUnmarshaller(String.class).unmarshall(context));
        }
        if (context.testExpression("TargetKeyId", targetDepth)) {
          context.nextToken();
          aliasListEntry.setTargetKeyId(context.getUnmarshaller(String.class).unmarshall(context));
        }
      } else if (token == END_ARRAY || token == END_OBJECT) {
        if (context.getLastParsedParentElement() == null
            || context.getLastParsedParentElement().equals(currentParentElement)) {
          if (context.getCurrentDepth() <= originalDepth) break;
        }
      }
      token = context.nextToken();
    }

    return aliasListEntry;
  }
  public ScheduleKeyDeletionResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    ScheduleKeyDeletionResult scheduleKeyDeletionResult = new ScheduleKeyDeletionResult();

    int originalDepth = context.getCurrentDepth();
    String currentParentElement = context.getCurrentParentElement();
    int targetDepth = originalDepth + 1;

    JsonToken token = context.getCurrentToken();
    if (token == null) token = context.nextToken();
    if (token == VALUE_NULL) return null;

    while (true) {
      if (token == null) break;

      if (token == FIELD_NAME || token == START_OBJECT) {
        if (context.testExpression("KeyId", targetDepth)) {
          context.nextToken();
          scheduleKeyDeletionResult.setKeyId(
              context.getUnmarshaller(String.class).unmarshall(context));
        }
        if (context.testExpression("DeletionDate", targetDepth)) {
          context.nextToken();
          scheduleKeyDeletionResult.setDeletionDate(
              context.getUnmarshaller(java.util.Date.class).unmarshall(context));
        }
      } else if (token == END_ARRAY || token == END_OBJECT) {
        if (context.getLastParsedParentElement() == null
            || context.getLastParsedParentElement().equals(currentParentElement)) {
          if (context.getCurrentDepth() <= originalDepth) break;
        }
      }
      token = context.nextToken();
    }

    return scheduleKeyDeletionResult;
  }
  public GenerateDataKeyWithoutPlaintextResult unmarshall(JsonUnmarshallerContext context)
      throws Exception {
    GenerateDataKeyWithoutPlaintextResult generateDataKeyWithoutPlaintextResult =
        new GenerateDataKeyWithoutPlaintextResult();

    int originalDepth = context.getCurrentDepth();
    String currentParentElement = context.getCurrentParentElement();
    int targetDepth = originalDepth + 1;

    JsonToken token = context.getCurrentToken();
    if (token == null) token = context.nextToken();
    if (token == VALUE_NULL) return null;

    while (true) {
      if (token == null) break;

      if (token == FIELD_NAME || token == START_OBJECT) {
        if (context.testExpression("CiphertextBlob", targetDepth)) {
          context.nextToken();
          generateDataKeyWithoutPlaintextResult.setCiphertextBlob(
              context.getUnmarshaller(java.nio.ByteBuffer.class).unmarshall(context));
        }
        if (context.testExpression("KeyId", targetDepth)) {
          context.nextToken();
          generateDataKeyWithoutPlaintextResult.setKeyId(
              context.getUnmarshaller(String.class).unmarshall(context));
        }
      } else if (token == END_ARRAY || token == END_OBJECT) {
        if (context.getLastParsedParentElement() == null
            || context.getLastParsedParentElement().equals(currentParentElement)) {
          if (context.getCurrentDepth() <= originalDepth) break;
        }
      }
      token = context.nextToken();
    }

    return generateDataKeyWithoutPlaintextResult;
  }
コード例 #6
0
  public ListKeysResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    ListKeysResult listKeysResult = new ListKeysResult();

    int originalDepth = context.getCurrentDepth();
    String currentParentElement = context.getCurrentParentElement();
    int targetDepth = originalDepth + 1;

    JsonToken token = context.getCurrentToken();
    if (token == null) token = context.nextToken();
    if (token == VALUE_NULL) return null;

    while (true) {
      if (token == null) break;

      if (token == FIELD_NAME || token == START_OBJECT) {
        if (context.testExpression("Keys", targetDepth)) {
          context.nextToken();
          listKeysResult.setKeys(
              new ListUnmarshaller<KeyListEntry>(KeyListEntryJsonUnmarshaller.getInstance())
                  .unmarshall(context));
        }
        if (context.testExpression("NextMarker", targetDepth)) {
          context.nextToken();
          listKeysResult.setNextMarker(context.getUnmarshaller(String.class).unmarshall(context));
        }
        if (context.testExpression("Truncated", targetDepth)) {
          context.nextToken();
          listKeysResult.setTruncated(context.getUnmarshaller(Boolean.class).unmarshall(context));
        }
      } else if (token == END_ARRAY || token == END_OBJECT) {
        if (context.getLastParsedParentElement() == null
            || context.getLastParsedParentElement().equals(currentParentElement)) {
          if (context.getCurrentDepth() <= originalDepth) break;
        }
      }
      token = context.nextToken();
    }

    return listKeysResult;
  }