Package rocket.serialization.client

Examples of rocket.serialization.client.SerializationException


      final Class classs = object.getClass();
      objectOutputStream.writeObject(classs.getName());
      this.writeFields(object, classs, objectOutputStream);

    } catch (IllegalAccessException illegalAccess) {
      throw new SerializationException(illegalAccess);
    }
  }
View Full Code Here


        }
        objectOutputStream.writeObject(value);
        break;
      }
    } catch (final IllegalAccessException illegalAccessException) {
      throw new SerializationException(illegalAccessException);
    } catch (final InvocationTargetException invocationTargetException) {
      final Throwable cause = invocationTargetException.getCause();
      if (cause instanceof Error) {
        final Error error = (Error) cause;
        throw new SerializationException(error);
      }
      if (cause instanceof RuntimeException) {
        final RuntimeException runtimeException = (RuntimeException) cause;
        throw new SerializationException(runtimeException);
      }
      throw new SerializationException(cause);
    }
  }
View Full Code Here

   * generator will not override this method for abstract types, thus any
   * attempt to deserialize an abstract type will result in an exception being
   * thrown.
   */
  public Object newInstance(final String typeName, final ObjectInputStream objectInputStream) {
    throw new SerializationException("Unable to deserialize \"" + typeName + "\".");
  }
View Full Code Here

        final int lineNumber = objectInputStream.readInt();

        stackTraceElements[i] = new StackTraceElement(className, methodName, fileName, lineNumber);
      }
    } catch (final Exception caught) {
      throw new SerializationException("Unable to serialize Throwable instance, " + caught.getMessage());
    }
  }
View Full Code Here

        objectOutputStream.writeObject(element.getFileName());
        objectOutputStream.writeInt(element.getLineNumber());
      }

    } catch (final Exception caught) {
      throw new SerializationException("Unable to serialize Throwable instance, " + caught.getMessage());
    }
  }
View Full Code Here

  public Object newInstance(final String name, final ObjectInputStream objectInputStream) {
    try {
      final Class classs = Class.forName(name);
      return classs.newInstance();
    } catch (final ClassNotFoundException classNotFound) {
      throw new SerializationException("Unable to find class \"" + name + "\".", classNotFound);
    } catch (final InstantiationException noDefaultConstructor) {
      throw new SerializationException("Unable to instantiate \"" + name + "\".", noDefaultConstructor);
    } catch (final IllegalAccessException illegalAccessException) {
      throw new SerializationException("Unable to instantiate \"" + name + "\".", illegalAccessException);
    }
  }
View Full Code Here

  protected void readFields(final Object object, final Class classs, final ObjectInputStream objectInputStream) {
    try {
      this.readFields0(object, classs, objectInputStream);
    } catch (final IllegalAccessException illegalAccessException) {
      throw new SerializationException(illegalAccessException);
    }
  }
View Full Code Here

  protected Type getTypeFromAnnotation(final Field field, final int index) {
    Checker.notNull("parameter:field", field);

    final List<String> values = field.getMetadataValues(SerializationConstants.CONTAINER_TYPE);
    if (values.size() < index) {
      throw new SerializationException("Unable to locate \"" + SerializationConstants.CONTAINER_TYPE + "\" on field " + field);
    }
    final String typeName = (String) values.get(index);
    final Type type = this.getGeneratorContext().findType(typeName);
    if (null == type) {
      throw new SerializationException("Unable to find type \"" + typeName + "\" which was taken from the annotation \""
          + SerializationConstants.CONTAINER_TYPE + "\" from field: " + field);
    }
    return type;
  }
View Full Code Here

      if (value == LoggingLevel.FATAL.getValue()) {
        level = LoggingLevel.FATAL;
        break;
      }

      throw new SerializationException("Unable to unmarshal LoggingLevel instance.");
    }

    return level;
  }
View Full Code Here

  // build a different array of values.
  protected void prepare(final String stream) {
    Checker.notEmpty("parameter:stream", stream);

    if (false == stream.startsWith("[") && false == stream.endsWith("]")) {
      throw new SerializationException("Stream is not valid json.");
    }

    this.prepare0(stream.substring(1, stream.length() - 1));
  }
View Full Code Here

TOP

Related Classes of rocket.serialization.client.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.