Package com.vaadin.util
Class SerializerHelper
- java.lang.Object
-
- com.vaadin.util.SerializerHelper
-
public class SerializerHelper extends Object
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 Constructor Description SerializerHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Class<?>
readClass(ObjectInputStream in)
Deserializes a class reference serialized bywriteClass(ObjectOutputStream, Class)
.static Class<?>[]
readClassArray(ObjectInputStream in)
Deserializes a class references serialized bywriteClassArray(ObjectOutputStream, Class[])
.static Class<?>
resolveClass(String className)
Resolves the class given byclassName
.static void
writeClass(ObjectOutputStream out, Class<?> cls)
Serializes the class reference soreadClass(ObjectInputStream)
can deserialize it.static void
writeClassArray(ObjectOutputStream out, Class<?>[] classes)
Serializes the class references soreadClassArray(ObjectInputStream)
can deserialize it.
-
-
-
Method Detail
-
writeClass
public static void writeClass(ObjectOutputStream out, Class<?> cls) throws IOException
Serializes the class reference soreadClass(ObjectInputStream)
can deserialize it. Supports null class references.- Parameters:
out
- TheObjectOutputStream
to serialize to.cls
- A class or null.- Throws:
IOException
- Rethrows any IOExceptions from the ObjectOutputStream
-
writeClassArray
public static void writeClassArray(ObjectOutputStream out, Class<?>[] classes) throws IOException
Serializes the class references soreadClassArray(ObjectInputStream)
can deserialize it. Supports null class arrays.- Parameters:
out
- TheObjectOutputStream
to 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
-ObjectInputStream
to 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
public static Class<?> resolveClass(String className) throws ClassNotFoundException
Resolves the class given byclassName
.- Parameters:
className
- The fully qualified class name.- Returns:
- A
Class
reference. - Throws:
ClassNotFoundException
- If the class could not be resolved.
-
readClass
public static Class<?> readClass(ObjectInputStream in) throws IOException, ClassNotFoundException
Deserializes a class reference serialized bywriteClass(ObjectOutputStream, Class)
. Supports null class references.- Parameters:
in
-ObjectInputStream
to read from.- Returns:
- Class reference to the resolved class
- Throws:
ClassNotFoundException
- If the class could not be resolved.IOException
- Rethrows IOExceptions from the ObjectInputStream
-
-