public KMSEncryptionConfig unmarshall(JsonUnmarshallerContext context) throws Exception {
    KMSEncryptionConfig kMSEncryptionConfig = new KMSEncryptionConfig();

    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("AWSKMSKeyARN", targetDepth)) {
          context.nextToken();
          kMSEncryptionConfig.setAWSKMSKeyARN(
              StringJsonUnmarshaller.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 kMSEncryptionConfig;
  }
  public ListDeliveryStreamsResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    ListDeliveryStreamsResult listDeliveryStreamsResult = new ListDeliveryStreamsResult();

    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("DeliveryStreamNames", targetDepth)) {
          context.nextToken();
          listDeliveryStreamsResult.setDeliveryStreamNames(
              new ListUnmarshaller<String>(StringJsonUnmarshaller.getInstance())
                  .unmarshall(context));
        }
        if (context.testExpression("HasMoreDeliveryStreams", targetDepth)) {
          context.nextToken();
          listDeliveryStreamsResult.setHasMoreDeliveryStreams(
              BooleanJsonUnmarshaller.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 listDeliveryStreamsResult;
  }
  public PutRecordBatchResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    PutRecordBatchResult putRecordBatchResult = new PutRecordBatchResult();

    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("FailedPutCount", targetDepth)) {
          context.nextToken();
          putRecordBatchResult.setFailedPutCount(
              context.getUnmarshaller(Integer.class).unmarshall(context));
        }
        if (context.testExpression("RequestResponses", targetDepth)) {
          context.nextToken();
          putRecordBatchResult.setRequestResponses(
              new ListUnmarshaller<PutRecordBatchResponseEntry>(
                      PutRecordBatchResponseEntryJsonUnmarshaller.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 putRecordBatchResult;
  }
コード例 #4
0
  public CopyCommand unmarshall(JsonUnmarshallerContext context) throws Exception {
    CopyCommand copyCommand = new CopyCommand();

    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("DataTableName", targetDepth)) {
          context.nextToken();
          copyCommand.setDataTableName(context.getUnmarshaller(String.class).unmarshall(context));
        }
        if (context.testExpression("DataTableColumns", targetDepth)) {
          context.nextToken();
          copyCommand.setDataTableColumns(
              context.getUnmarshaller(String.class).unmarshall(context));
        }
        if (context.testExpression("CopyOptions", targetDepth)) {
          context.nextToken();
          copyCommand.setCopyOptions(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 copyCommand;
  }
  public RedshiftDestinationUpdate unmarshall(JsonUnmarshallerContext context) throws Exception {
    RedshiftDestinationUpdate redshiftDestinationUpdate = new RedshiftDestinationUpdate();

    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("RoleARN", targetDepth)) {
          context.nextToken();
          redshiftDestinationUpdate.setRoleARN(
              StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("ClusterJDBCURL", targetDepth)) {
          context.nextToken();
          redshiftDestinationUpdate.setClusterJDBCURL(
              StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("CopyCommand", targetDepth)) {
          context.nextToken();
          redshiftDestinationUpdate.setCopyCommand(
              CopyCommandJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("Username", targetDepth)) {
          context.nextToken();
          redshiftDestinationUpdate.setUsername(
              StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("Password", targetDepth)) {
          context.nextToken();
          redshiftDestinationUpdate.setPassword(
              StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("S3Update", targetDepth)) {
          context.nextToken();
          redshiftDestinationUpdate.setS3Update(
              S3DestinationUpdateJsonUnmarshaller.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 redshiftDestinationUpdate;
  }