Examples of SerializationIndex


Examples of com.google.collide.dtogen.shared.SerializationIndex

    for (Method method : dtoInterface.getMethods()) {
      if (method.getName().equals("getType")) {
        continue;
      }

      SerializationIndex serializationIndex = method.getAnnotation(SerializationIndex.class);
      Preconditions.checkNotNull(serializationIndex,
          "Serialization index is not specified for %s in %s",
          method.getName(), dtoInterface.getSimpleName());

      // "53" is the number of bits in JS integer.
      // This restriction will allow to add simple bit-field
      // "serialization-skipping-list" in the future.
      int index = serializationIndex.value();
      Preconditions.checkState(index > 0 && index <= 53,
          "Serialization index out of range [1..53] for %s in %s",
          method.getName(), dtoInterface.getSimpleName());

      Preconditions.checkState(!methodsMap.containsKey(index),
View Full Code Here

Examples of com.google.collide.dtogen.shared.SerializationIndex

      }
      String methodName = method.getName();
      String fieldName = getFieldName(methodName);
      String fieldSelector;
      if (isCompactJson()) {
        SerializationIndex serializationIndex = Preconditions.checkNotNull(
            method.getAnnotation(SerializationIndex.class));
        fieldSelector = String.valueOf(serializationIndex.value() - 1);
      } else {
        fieldSelector = "\"" + getFieldName(methodName) + "\"";
      }
      String returnTypeName =
          method.getGenericReturnType().toString().replace('$', '.').replace("class ", "")
View Full Code Here

Examples of com.google.collide.dtogen.shared.SerializationIndex

      Method method, final StringBuilder builder) {
    final String fieldName = getFieldName(method.getName());
    final String fieldNameIn = fieldName + "In";
    final String fieldNameOut = fieldName + "Out";
    final String baseIndentation = "        ";
    SerializationIndex serializationIndex = Preconditions.checkNotNull(
        method.getAnnotation(SerializationIndex.class));
    int index = serializationIndex.value() - 1;

    builder.append("\n");
    builder.append("      if (").append(index).append(" < json.size()) {\n");
    List<Type> expandedTypes = expandType(method.getGenericReturnType());
    builder.append("        JsonElement ").append(fieldNameIn).append(" = json.get(")
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.