public PendingModifiedValues unmarshall(StaxUnmarshallerContext context) throws Exception {
    PendingModifiedValues pendingModifiedValues = new PendingModifiedValues();
    int originalDepth = context.getCurrentDepth();
    int targetDepth = originalDepth + 1;

    if (context.isStartOfDocument()) targetDepth += 2;

    while (true) {
      XMLEvent xmlEvent = context.nextEvent();
      if (xmlEvent.isEndDocument()) return pendingModifiedValues;

      if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {
        if (context.testExpression("NumCacheNodes", targetDepth)) {
          pendingModifiedValues.setNumCacheNodes(
              IntegerStaxUnmarshaller.getInstance().unmarshall(context));
          continue;
        }
        if (context.testExpression("CacheNodeIdsToRemove/CacheNodeId", targetDepth)) {
          pendingModifiedValues
              .getCacheNodeIdsToRemove()
              .add(StringStaxUnmarshaller.getInstance().unmarshall(context));
          continue;
        }
        if (context.testExpression("EngineVersion", targetDepth)) {
          pendingModifiedValues.setEngineVersion(
              StringStaxUnmarshaller.getInstance().unmarshall(context));
          continue;
        }
      } else if (xmlEvent.isEndElement()) {
        if (context.getCurrentDepth() < originalDepth) {
          return pendingModifiedValues;
        }
      }
    }
  }
コード例 #2
0
  public NodeSnapshot unmarshall(StaxUnmarshallerContext context) throws Exception {
    NodeSnapshot nodeSnapshot = new NodeSnapshot();
    int originalDepth = context.getCurrentDepth();
    int targetDepth = originalDepth + 1;

    if (context.isStartOfDocument()) targetDepth += 3;

    while (true) {
      XMLEvent xmlEvent = context.nextEvent();
      if (xmlEvent.isEndDocument()) return nodeSnapshot;

      if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {

        if (context.testExpression("CacheClusterId", targetDepth)) {
          nodeSnapshot.setCacheClusterId(StringStaxUnmarshaller.getInstance().unmarshall(context));
          continue;
        }

        if (context.testExpression("NodeGroupId", targetDepth)) {
          nodeSnapshot.setNodeGroupId(StringStaxUnmarshaller.getInstance().unmarshall(context));
          continue;
        }

        if (context.testExpression("CacheNodeId", targetDepth)) {
          nodeSnapshot.setCacheNodeId(StringStaxUnmarshaller.getInstance().unmarshall(context));
          continue;
        }

        if (context.testExpression("NodeGroupConfiguration", targetDepth)) {
          nodeSnapshot.setNodeGroupConfiguration(
              NodeGroupConfigurationStaxUnmarshaller.getInstance().unmarshall(context));
          continue;
        }

        if (context.testExpression("CacheSize", targetDepth)) {
          nodeSnapshot.setCacheSize(StringStaxUnmarshaller.getInstance().unmarshall(context));
          continue;
        }

        if (context.testExpression("CacheNodeCreateTime", targetDepth)) {
          nodeSnapshot.setCacheNodeCreateTime(
              DateStaxUnmarshaller.getInstance().unmarshall(context));
          continue;
        }

        if (context.testExpression("SnapshotCreateTime", targetDepth)) {
          nodeSnapshot.setSnapshotCreateTime(
              DateStaxUnmarshaller.getInstance().unmarshall(context));
          continue;
        }
      } else if (xmlEvent.isEndElement()) {
        if (context.getCurrentDepth() < originalDepth) {
          return nodeSnapshot;
        }
      }
    }
  }
  public DescribeCacheParameterGroupsResult unmarshall(StaxUnmarshallerContext context)
      throws Exception {
    DescribeCacheParameterGroupsResult describeCacheParameterGroupsResult =
        new DescribeCacheParameterGroupsResult();
    int originalDepth = context.getCurrentDepth();
    int targetDepth = originalDepth + 1;

    if (context.isStartOfDocument()) targetDepth += 2;

    while (true) {
      XMLEvent xmlEvent = context.nextEvent();
      if (xmlEvent.isEndDocument()) return describeCacheParameterGroupsResult;

      if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {
        if (context.testExpression("Marker", targetDepth)) {
          describeCacheParameterGroupsResult.setMarker(
              StringStaxUnmarshaller.getInstance().unmarshall(context));
          continue;
        }
        if (context.testExpression("CacheParameterGroups/CacheParameterGroup", targetDepth)) {
          describeCacheParameterGroupsResult
              .getCacheParameterGroups()
              .add(CacheParameterGroupStaxUnmarshaller.getInstance().unmarshall(context));
          continue;
        }
      } else if (xmlEvent.isEndElement()) {
        if (context.getCurrentDepth() < originalDepth) {
          return describeCacheParameterGroupsResult;
        }
      }
    }
  }
  public ModifyCacheParameterGroupResult unmarshall(StaxUnmarshallerContext context)
      throws Exception {
    ModifyCacheParameterGroupResult modifyCacheParameterGroupResult =
        new ModifyCacheParameterGroupResult();
    int originalDepth = context.getCurrentDepth();
    int targetDepth = originalDepth + 1;

    if (context.isStartOfDocument()) targetDepth += 2;

    while (true) {
      XMLEvent xmlEvent = context.nextEvent();
      if (xmlEvent.isEndDocument()) return modifyCacheParameterGroupResult;

      if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {

        if (context.testExpression("CacheParameterGroupName", targetDepth)) {
          modifyCacheParameterGroupResult.setCacheParameterGroupName(
              StringStaxUnmarshaller.getInstance().unmarshall(context));
          continue;
        }
      } else if (xmlEvent.isEndElement()) {
        if (context.getCurrentDepth() < originalDepth) {
          return modifyCacheParameterGroupResult;
        }
      }
    }
  }
  public CacheParameterGroupStatus unmarshall(StaxUnmarshallerContext context) throws Exception {
    CacheParameterGroupStatus cacheParameterGroupStatus = new CacheParameterGroupStatus();
    int originalDepth = context.getCurrentDepth();
    int targetDepth = originalDepth + 1;

    if (context.isStartOfDocument()) targetDepth += 1;

    while (true) {
      XMLEvent xmlEvent = context.nextEvent();
      if (xmlEvent.isEndDocument()) return cacheParameterGroupStatus;

      if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {

        if (context.testExpression("CacheParameterGroupName", targetDepth)) {
          cacheParameterGroupStatus.setCacheParameterGroupName(
              StringStaxUnmarshaller.getInstance().unmarshall(context));
          continue;
        }

        if (context.testExpression("ParameterApplyStatus", targetDepth)) {
          cacheParameterGroupStatus.setParameterApplyStatus(
              StringStaxUnmarshaller.getInstance().unmarshall(context));
          continue;
        }

        if (context.testExpression("CacheNodeIdsToReboot", targetDepth)) {
          cacheParameterGroupStatus.withCacheNodeIdsToReboot(new ArrayList<String>());
          continue;
        }

        if (context.testExpression("CacheNodeIdsToReboot/CacheNodeId", targetDepth)) {
          cacheParameterGroupStatus.withCacheNodeIdsToReboot(
              StringStaxUnmarshaller.getInstance().unmarshall(context));
          continue;
        }

      } else if (xmlEvent.isEndElement()) {
        if (context.getCurrentDepth() < originalDepth) {
          return cacheParameterGroupStatus;
        }
      }
    }
  }
コード例 #6
0
  public NodeGroup unmarshall(StaxUnmarshallerContext context) throws Exception {
    NodeGroup nodeGroup = new NodeGroup();
    int originalDepth = context.getCurrentDepth();
    int targetDepth = originalDepth + 1;

    if (context.isStartOfDocument()) targetDepth += 1;

    while (true) {
      XMLEvent xmlEvent = context.nextEvent();
      if (xmlEvent.isEndDocument()) return nodeGroup;

      if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {

        if (context.testExpression("NodeGroupId", targetDepth)) {
          nodeGroup.setNodeGroupId(StringStaxUnmarshaller.getInstance().unmarshall(context));
          continue;
        }

        if (context.testExpression("Status", targetDepth)) {
          nodeGroup.setStatus(StringStaxUnmarshaller.getInstance().unmarshall(context));
          continue;
        }

        if (context.testExpression("PrimaryEndpoint", targetDepth)) {
          nodeGroup.setPrimaryEndpoint(EndpointStaxUnmarshaller.getInstance().unmarshall(context));
          continue;
        }

        if (context.testExpression("NodeGroupMembers/NodeGroupMember", targetDepth)) {
          nodeGroup.withNodeGroupMembers(
              NodeGroupMemberStaxUnmarshaller.getInstance().unmarshall(context));
          continue;
        }

      } else if (xmlEvent.isEndElement()) {
        if (context.getCurrentDepth() < originalDepth) {
          return nodeGroup;
        }
      }
    }
  }