com.vaadin.util.
Class SerializerHelper
java.lang.Object
com.vaadin.util.SerializerHelper
- extends Object
public class 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 | |
---|---|
SerializerHelper()
|
Method Summary | |
---|---|
static Class<?> |
readClass(ObjectInputStream in)
Deserializes a class reference serialized by writeClass(ObjectOutputStream, Class) . |
static Class<?>[] |
readClassArray(ObjectInputStream in)
Deserializes a class references serialized by writeClassArray(ObjectOutputStream, Class[]) . |
static Class<?> |
resolveClass(String className)
Resolves the class given by className . |
static void |
writeClass(ObjectOutputStream out,
Class<?> cls)
Serializes the class reference so readClass(ObjectInputStream)
can deserialize it. |
static void |
writeClassArray(ObjectOutputStream out,
Class<?>[] classes)
Serializes the class references so readClassArray(ObjectInputStream) can deserialize it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
SerializerHelper
public SerializerHelper()
Method Detail |
---|
writeClass
public static void writeClass(ObjectOutputStream out,
Class<?> cls)
throws IOException
- Parameters:
out
- TheObjectOutputStream
to serialize to.cls
- A class or null.- Throws:
IOException
- Rethrows any IOExceptions from the ObjectOutputStream
Serializes the class reference so readClass(ObjectInputStream)
can deserialize it. Supports null class references.
writeClassArray
public static void writeClassArray(ObjectOutputStream out,
Class<?>[] classes)
throws IOException
- Parameters:
out
- TheObjectOutputStream
to serialize to.classes
- An array containing class references or null.- Throws:
IOException
- Rethrows any IOExceptions from the ObjectOutputStream
Serializes the class references so
readClassArray(ObjectInputStream)
can deserialize it. Supports
null class arrays.
readClassArray
public static Class<?>[] readClassArray(ObjectInputStream in)
throws ClassNotFoundException,
IOException
- 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
Deserializes a class references serialized by
writeClassArray(ObjectOutputStream, Class[])
. Supports null
class arrays.
resolveClass
public static Class<?> resolveClass(String className)
throws ClassNotFoundException
- Parameters:
className
- The fully qualified class name.- Returns:
- A
Class
reference. - Throws:
ClassNotFoundException
- If the class could not be resolved.
Resolves the class given by className
.
readClass
public static Class<?> readClass(ObjectInputStream in)
throws IOException,
ClassNotFoundException
- 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
Deserializes a class reference serialized by
writeClass(ObjectOutputStream, Class)
. Supports null class
references.