@Test(expected = SerializationException.class) public void testRegisterAdditional() throws Exception { MyMockClassSerializerDuplicatedId duplicatedSerializer = new MyMockClassSerializerDuplicatedId(); try { serializationManager.registerAdditional(duplicatedSerializer); MyMockClass a = new MyMockClass(2.3, "mama"); MyGeneric<MyMockClass> gen = new MyGeneric<MyMockClass>(12, a); ByteArrayOutputStream b = new ByteArrayOutputStream(); try (SerializationOutput output = new BinarySerializationOutput(b)) { serializationManager.serialize(gen, output); } byte[] bytes = b.toByteArray(); try (BinarySerializationInput input = new BinarySerializationInput(new ByteArrayInputStream(bytes))) { MyGeneric<MyMockClass> deserialized = serializationManager.deserialize(input); assertEquals(gen, deserialized); } } finally { serializationManager.unregister(duplicatedSerializer); } }
public <T> void registerAdditional(ObjectSerializer<T> serializer) throws SerializationException { registerDeserializer(serializer); }
SerializationManager { public <T> void registerAdditional(ObjectSerializer<T> serializer) throws SerializationException { registerDeserializer(serializer); } }
SerializationManager { public <T> void registerAdditional(ObjectSerializer<T> serializer) throws SerializationException { registerDeserializer(serializer); } protected  SerializationManager(); protected  SerializationManager(Iterable<ObjectSerializer<?>> serializers); }
SerializationManager { public <T> void registerAdditional(ObjectSerializer<T> serializer) throws SerializationException { registerDeserializer(serializer); } protected  SerializationManager(); protected  SerializationManager(Iterable<ObjectSerializer<?>> serializers); void register(ObjectSerializer<T> serializer); void registerAdditional(ObjectSerializer<T> serializer); void registerOverride(ObjectSerializer<T> serializer); void unregister(ObjectSerializer<T> serializer); void serialize(T object, SerializationOutput output); void serializeStream(Iterable<T> object, SerializationOutput output); void serializeWrapExceptions(T object, File file); void serialize(T object, File file); @SuppressWarnings("unchecked") T deserialize(SerializationInput input); Sequence<T> deserializeStream(final SerializationInput input); T deserializeWrapExceptions(File file); T deserialize(File file); T deserialize(InputStream stream); SerializationInput getAppropriateSerializationInput(File file); static SerializationManager createDefault(); }
SerializationManager { public <T> void registerAdditional(ObjectSerializer<T> serializer) throws SerializationException { registerDeserializer(serializer); } protected  SerializationManager(); protected  SerializationManager(Iterable<ObjectSerializer<?>> serializers); void register(ObjectSerializer<T> serializer); void registerAdditional(ObjectSerializer<T> serializer); void registerOverride(ObjectSerializer<T> serializer); void unregister(ObjectSerializer<T> serializer); void serialize(T object, SerializationOutput output); void serializeStream(Iterable<T> object, SerializationOutput output); void serializeWrapExceptions(T object, File file); void serialize(T object, File file); @SuppressWarnings("unchecked") T deserialize(SerializationInput input); Sequence<T> deserializeStream(final SerializationInput input); T deserializeWrapExceptions(File file); T deserialize(File file); T deserialize(InputStream stream); SerializationInput getAppropriateSerializationInput(File file); static SerializationManager createDefault();  }