Package com.vaadin.featurepack.util
Class SerializerHelper
java.lang.Object
com.vaadin.featurepack.util.SerializerHelper
Helper class for performing serialization. Most of the methods are here are
workarounds for problems in Google App Engine. Used internally by Vaadin and
should not be used by application developers. Subject to change at any time.
- Since:
- 6.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Class<?> Deserializes a class reference serialized bywriteClass(ObjectOutputStream, Class).static Class<?>[]Deserializes a class references serialized bywriteClassArray(ObjectOutputStream, Class[]).static Class<?> resolveClass(String className) Resolves the class given byclassName.static voidwriteClass(ObjectOutputStream out, Class<?> cls) Serializes the class reference soreadClass(ObjectInputStream)can deserialize it.static voidwriteClassArray(ObjectOutputStream out, Class<?>[] classes) Serializes the class references soreadClassArray(ObjectInputStream)can deserialize it.
-
Constructor Details
-
SerializerHelper
public SerializerHelper()
-
-
Method Details
-
writeClass
Serializes the class reference soreadClass(ObjectInputStream)can deserialize it. Supports null class references.- Parameters:
out- TheObjectOutputStreamto serialize to.cls- A class or null.- Throws:
IOException- Rethrows any IOExceptions from the ObjectOutputStream
-
writeClassArray
Serializes the class references soreadClassArray(ObjectInputStream)can deserialize it. Supports null class arrays.- Parameters:
out- TheObjectOutputStreamto serialize to.classes- An array containing class references or null.- Throws:
IOException- Rethrows any IOExceptions from the ObjectOutputStream
-
readClassArray
public static Class<?>[] readClassArray(ObjectInputStream in) throws ClassNotFoundException, IOException Deserializes a class references serialized bywriteClassArray(ObjectOutputStream, Class[]). Supports null class arrays.- Parameters:
in-ObjectInputStreamto read from.- Returns:
- Class array with the class references or null.
- Throws:
ClassNotFoundException- If one of the classes could not be resolved.IOException- Rethrows IOExceptions from the ObjectInputStream
-
resolveClass
Resolves the class given byclassName.- Parameters:
className- The fully qualified class name.- Returns:
- A
Classreference. - Throws:
ClassNotFoundException- If the class could not be resolved.
-
readClass
Deserializes a class reference serialized bywriteClass(ObjectOutputStream, Class). Supports null class references.- Parameters:
in-ObjectInputStreamto read from.- Returns:
- Class reference to the resolved class
- Throws:
ClassNotFoundException- If the class could not be resolved.IOException- Rethrows IOExceptions from the ObjectInputStream
-