Package com.enragedginger.stephenerialization

Examples of com.enragedginger.stephenerialization.StephenerializationException


   */
  public char readChar() {
    try {
      return stream.readChar();
    } catch (Exception e) {
      throw new StephenerializationException(BASIC_MSG, e);
    }
  }
View Full Code Here


   */
  public Object readObject() {
    try {
      return stream.readObject();
    } catch (Exception e) {
      throw new StephenerializationException(BASIC_MSG, e);
    }
  }
View Full Code Here

  public void stephenerialize(Object object,
      StephenerializationStream streamer) {
    final Class<?> clazz = object.getClass();
    final Stephenerializable annotation = clazz.getAnnotation(Stephenerializable.class);
    if (annotation == null) {
      throw new StephenerializationException("The class " + clazz.getName() + " cannot be Stephenerialized "
          + "because it lacks a Stephenerializable annotation.");
    } else {
      final int version = annotation.version();
      final Set<StephenerializableField> fields = fieldFactory.generateFields(clazz, version);
      streamer.writeInt(version); // write the version out to the stream
      for (StephenerializableField field : fields) {
        try {
          writeField(object, clazz, field.getField(), streamer);
        } catch (Exception e) {
          throw new StephenerializationException(ERROR_MSG, e);
        }
      }
    }
  }
View Full Code Here

        break;
      case OBJECT :
        streamer.writeObject(field.get(object));
        break;
      default :
        throw new StephenerializationException("Unsupported stephenerialization type: " + type);
    }
  }
View Full Code Here

TOP

Related Classes of com.enragedginger.stephenerialization.StephenerializationException

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.