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

    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("DirectoryId", targetDepth)) {
          context.nextToken();
          deleteDirectoryResult.setDirectoryId(
              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 deleteDirectoryResult;
  }
  public DirectoryVpcSettings unmarshall(JsonUnmarshallerContext context) throws Exception {
    DirectoryVpcSettings directoryVpcSettings = new DirectoryVpcSettings();

    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("VpcId", targetDepth)) {
          context.nextToken();
          directoryVpcSettings.setVpcId(StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("SubnetIds", targetDepth)) {
          context.nextToken();
          directoryVpcSettings.setSubnetIds(
              new ListUnmarshaller<String>(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 directoryVpcSettings;
  }
コード例 #3
0
  public RadiusSettings unmarshall(JsonUnmarshallerContext context) throws Exception {
    RadiusSettings radiusSettings = new RadiusSettings();

    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("RadiusServers", targetDepth)) {
          context.nextToken();
          radiusSettings.setRadiusServers(
              new ListUnmarshaller<String>(StringJsonUnmarshaller.getInstance())
                  .unmarshall(context));
        }
        if (context.testExpression("RadiusPort", targetDepth)) {
          context.nextToken();
          radiusSettings.setRadiusPort(IntegerJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("RadiusTimeout", targetDepth)) {
          context.nextToken();
          radiusSettings.setRadiusTimeout(
              IntegerJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("RadiusRetries", targetDepth)) {
          context.nextToken();
          radiusSettings.setRadiusRetries(
              IntegerJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("SharedSecret", targetDepth)) {
          context.nextToken();
          radiusSettings.setSharedSecret(StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("AuthenticationProtocol", targetDepth)) {
          context.nextToken();
          radiusSettings.setAuthenticationProtocol(
              StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("DisplayLabel", targetDepth)) {
          context.nextToken();
          radiusSettings.setDisplayLabel(StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("UseSameUsername", targetDepth)) {
          context.nextToken();
          radiusSettings.setUseSameUsername(
              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 radiusSettings;
  }