Package com.google.gwt.user.client.rpc

Examples of com.google.gwt.user.client.rpc.SerializationException


      }

      return instance;

    } catch (ClassNotFoundException e) {
      throw new SerializationException(e);

    } catch (InstantiationException e) {
      throw new SerializationException(e);

    } catch (IllegalAccessException e) {
      throw new SerializationException(e);

    } catch (IllegalArgumentException e) {
      throw new SerializationException(e);

    } catch (InvocationTargetException e) {
      throw new SerializationException(e);

    } catch (NoSuchMethodException e) {
      throw new SerializationException(e);
    }
  }
View Full Code Here


        StringBuilder buf = new StringBuilder();
        int pos = 0;
        while (idx >= 0) {
          buf.append(str.substring(pos, idx));
          if (++idx == str.length()) {
            throw new SerializationException("Unmatched backslash: \""
                + str + "\"");
          }
          char ch = str.charAt(idx);
          pos = idx + 1;
          switch (ch) {
            case '0':
              buf.append('\u0000');
              break;
            case '!':
              buf.append(RPC_SEPARATOR_CHAR);
              break;
            case '\\':
              buf.append(ch);
              break;
            case 'u':
              try {
                ch = (char) Integer.parseInt(str.substring(idx + 1, idx + 5), 16);
              } catch (NumberFormatException e) {
                throw new SerializationException(
                    "Invalid Unicode escape sequence in \"" + str + "\"");
              }
              buf.append(ch);
              pos += 4;
              break;
            default:
              throw new SerializationException("Unexpected escape character "
                  + ch + " after backslash: \"" + str + "\"");
          }
          idx = str.indexOf('\\', pos);
        }
        buf.append(str.substring(pos));
        str = buf.toString();
      }
      buffer.add(str);
    }

    if (buffer.size() != buffer.getExpectedSize()) {
      throw new SerializationException("Expected " + buffer.getExpectedSize()
          + " string table elements; received " + buffer.size());
    }

    stringTable = buffer.toArray(new String[buffer.getExpectedSize()]);
  }
View Full Code Here

  private String extract() throws SerializationException {
    try {
      return tokenList.get(tokenListIndex++);
    } catch (IndexOutOfBoundsException e) {
      throw new SerializationException("Too few tokens in RPC request", e);
    }
  }
View Full Code Here

  private void validateTypeVersions(Class<?> instanceClass,
      SerializedInstanceReference serializedInstRef)
      throws SerializationException {
    String clientTypeSignature = serializedInstRef.getSignature();
    if (clientTypeSignature.length() == 0) {
      throw new SerializationException("Missing type signature for "
          + instanceClass.getName());
    }

    String serverTypeSignature = SerializabilityUtil.getSerializationSignature(instanceClass);

    if (!clientTypeSignature.equals(serverTypeSignature)) {
      throw new SerializationException("Invalid type signature for "
          + instanceClass.getName());
    }
  }
View Full Code Here

   * @see com.google.gwt.user.server.rpc.SerializationPolicy#validateDeserialize(java.lang.String)
   */
  @Override
  public void validateDeserialize(Class<?> clazz) throws SerializationException {
    if (!isInstantiable(clazz)) {
      throw new SerializationException(
          "Type '"
              + clazz.getName()
              + "' was not assignable to '"
              + IsSerializable.class.getName()
              + "' and did not have a custom field serializer.  For security purposes, this type will not be deserialized.");
View Full Code Here

   * @see com.google.gwt.user.server.rpc.SerializationPolicy#validateSerialize(java.lang.String)
   */
  @Override
  public void validateSerialize(Class<?> clazz) throws SerializationException {
    if (!isInstantiable(clazz)) {
      throw new SerializationException(
          "Type '"
              + clazz.getName()
              + "' was not assignable to '"
              + IsSerializable.class.getName()
              + "' and did not have a custom field serializer.  For security purposes, this type will not be serialized.");
View Full Code Here

    try {
      accessOrderField = LinkedHashMap.class.getDeclaredField("accessOrder");
      accessOrderField.setAccessible(true);
      return ((Boolean) accessOrderField.get(instance)).booleanValue();
    } catch (SecurityException e) {
      throw new SerializationException("Can't get accessOrder field", e);
    } catch (NoSuchFieldException e) {
      throw new SerializationException("Can't get accessOrder field", e);
    } catch (IllegalArgumentException e) {
      throw new SerializationException("Can't get accessOrder field", e);
    } catch (IllegalAccessException e) {
      throw new SerializationException("Can't get accessOrder field", e);
    }
  }
View Full Code Here

   */
  public void write(int integer) throws SerializationException {
    try {
      bodyString += Integer.toString(integer) + RPC_SEPARATOR_CHAR;
    } catch (Exception e) {
      throw new SerializationException(e);
    }
  }
View Full Code Here

    }
    try {
      writeStringFromTable(generateSerializedClassString(Integer.class));
      bodyString += integer.toString() + RPC_SEPARATOR_CHAR;
    } catch (Exception e) {
      throw new SerializationException(e);
    }
  }
View Full Code Here

      Class<?> clazz = object.getClass();
      writeStringFromTable(generateSerializedClassString(clazz));

      writeClass(object, clazz);
    } catch (Exception e) {
      throw new SerializationException(e);
    }
  }
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.rpc.SerializationException

Copyright © 2018 www.massapicom. 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.