Examples of ParamsProperty


Examples of com.google.wave.api.JsonRpcConstant.ParamsProperty

    // Deserialize the data.
    Map<ParamsProperty, Object> properties = new HashMap<ParamsProperty, Object>();
    JsonElement data = jsonObject.get(ResponseProperty.DATA.key());
    if (data != null && data.isJsonObject()) {
      for (Entry<String, JsonElement> parameter : data.getAsJsonObject().entrySet()) {
        ParamsProperty parameterType = ParamsProperty.fromKey(parameter.getKey());
        if (parameterType == null) {
          // Skip this unknown parameter.
          continue;
        }
        Object object = null;
        if (parameterType == ParamsProperty.BLIPS) {
          object = context.deserialize(parameter.getValue(), GsonFactory.BLIP_MAP_TYPE);
        } else if (parameterType == ParamsProperty.PARTICIPANTS_ADDED ||
            parameterType == ParamsProperty.PARTICIPANTS_REMOVED) {
          object = context.deserialize(parameter.getValue(), GsonFactory.PARTICIPANT_LIST_TYPE);
        } else if (parameterType == ParamsProperty.THREADS) {
          object = context.deserialize(parameter.getValue(), GsonFactory.THREAD_MAP_TYPE);
        } else if (parameterType == ParamsProperty.WAVELET_IDS) {
          object = context.deserialize(parameter.getValue(), GsonFactory.WAVELET_ID_LIST_TYPE);
        } else if (parameterType == ParamsProperty.RAW_DELTAS) {
          object = context.deserialize(parameter.getValue(), GsonFactory.RAW_DELTAS_TYPE);
        } else {
          object = context.deserialize(parameter.getValue(), parameterType.clazz());
        }
        properties.put(parameterType, object);
      }
    }
View Full Code Here

Examples of com.google.wave.api.JsonRpcConstant.ParamsProperty

        getPropertyAsStringThenRemove(parameters, ParamsProperty.WAVE_ID),
        getPropertyAsStringThenRemove(parameters, ParamsProperty.WAVELET_ID),
        getPropertyAsStringThenRemove(parameters, ParamsProperty.BLIP_ID));

    for (Entry<String, JsonElement> parameter : parameters.entrySet()) {
      ParamsProperty parameterType = ParamsProperty.fromKey(parameter.getKey());
      if (parameterType != null) {
        Object object;
        if (parameterType == ParamsProperty.RAW_DELTAS) {
          object = ctx.deserialize(parameter.getValue(), GsonFactory.RAW_DELTAS_TYPE);
        } else {
          object = ctx.deserialize(parameter.getValue(), parameterType.clazz());
        }
        request.addParameter(Parameter.of(parameterType, object));
      }
    }
View Full Code Here

Examples of com.google.wave.api.JsonRpcConstant.ParamsProperty

      result = data.getAsJsonObject();
    }

    Map<ParamsProperty, Object> properties = new HashMap<ParamsProperty, Object>();
    for (Entry<String, JsonElement> parameter : result.entrySet()) {
      ParamsProperty parameterType = ParamsProperty.fromKey(parameter.getKey());
      Object object = null;
      if (parameterType == ParamsProperty.BLIPS) {
        Type blipMapType = new TypeToken<Map<String, BlipData>>(){}.getType();
        object = context.deserialize(parameter.getValue(), blipMapType);
      } else {
        object = context.deserialize(parameter.getValue(), parameterType.clazz());
      }
      properties.put(parameterType, object);
    }

    return JsonRpcResponse.result(id, properties);
View Full Code Here

Examples of com.google.wave.api.JsonRpcConstant.ParamsProperty

        getPropertyAsStringThenRemove(parameters, ParamsProperty.WAVE_ID),
        getPropertyAsStringThenRemove(parameters, ParamsProperty.WAVELET_ID),
        getPropertyAsStringThenRemove(parameters, ParamsProperty.BLIP_ID));

    for (Entry<String, JsonElement> parameter : parameters.entrySet()) {
      ParamsProperty parameterType = ParamsProperty.fromKey(parameter.getKey());
      Object object = ctx.deserialize(parameter.getValue(), parameterType.clazz());
      request.addParameter(Parameter.of(parameterType, object));
    }

    return request;
  }
View Full Code Here

Examples of com.google.wave.api.JsonRpcConstant.ParamsProperty

    // Deserialize the data.
    Map<ParamsProperty, Object> properties = new HashMap<ParamsProperty, Object>();
    JsonElement data = jsonObject.get(ResponseProperty.DATA.key());
    if (data != null && data.isJsonObject()) {
      for (Entry<String, JsonElement> parameter : data.getAsJsonObject().entrySet()) {
        ParamsProperty parameterType = ParamsProperty.fromKey(parameter.getKey());
        if (parameterType == null) {
          // Skip this unknown parameter.
          continue;
        }
        Object object = null;
        if (parameterType == ParamsProperty.BLIPS) {
          object = context.deserialize(parameter.getValue(), GsonFactory.BLIP_MAP_TYPE);
        } else if (parameterType == ParamsProperty.PARTICIPANTS_ADDED ||
            parameterType == ParamsProperty.PARTICIPANTS_REMOVED) {
          object = context.deserialize(parameter.getValue(), GsonFactory.PARTICIPANT_LIST_TYPE);
        } else if (parameterType == ParamsProperty.THREADS) {
          object = context.deserialize(parameter.getValue(), GsonFactory.THREAD_MAP_TYPE);
        } else {
          object = context.deserialize(parameter.getValue(), parameterType.clazz());
        }
        properties.put(parameterType, object);
      }
    }
View Full Code Here

Examples of com.google.wave.api.JsonRpcConstant.ParamsProperty

        getPropertyAsStringThenRemove(parameters, ParamsProperty.WAVE_ID),
        getPropertyAsStringThenRemove(parameters, ParamsProperty.WAVELET_ID),
        getPropertyAsStringThenRemove(parameters, ParamsProperty.BLIP_ID));

    for (Entry<String, JsonElement> parameter : parameters.entrySet()) {
      ParamsProperty parameterType = ParamsProperty.fromKey(parameter.getKey());
      if (parameterType != null) {
        Object object = ctx.deserialize(parameter.getValue(), parameterType.clazz());
        request.addParameter(Parameter.of(parameterType, object));
      }
    }

    return request;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.