|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jfree.report.util.SerializerHelper
The SerializeHelper is used to make implementing custom serialization handlers easier. Handlers for certain object types need to be added to this helper before this implementation is usable.
Constructor Summary | |
protected |
SerializerHelper()
Creates a new SerializerHelper. |
Method Summary | |
protected org.jfree.xml.factory.objects.ClassComparator |
getComparator()
Returns the class comparator instance used to find correct super classes. |
static SerializerHelper |
getInstance()
Returns or creates a new SerializerHelper. |
protected java.util.HashMap |
getMethods()
Returns the collection of all registered serialize methods. |
protected SerializeMethod |
getSerializer(java.lang.Class c)
Looks up the SerializeMethod for the given class or null if there is no SerializeMethod for the given class. |
protected SerializeMethod |
getSuperClassObjectDescription(java.lang.Class d,
SerializeMethod knownSuperClass)
Looks up the SerializeMethod for the given class or null if there is no SerializeMethod for the given class. |
java.lang.Object |
readObject(java.io.ObjectInputStream in)
Reads the object from the object input stream. |
void |
registerMethod(SerializeMethod method)
Registers a new SerializeMethod with this SerializerHelper. |
protected static void |
setInstance(SerializerHelper helper)
This method can be used to replace the singleton instance of this helper. |
void |
unregisterMethod(SerializeMethod method)
Deregisters a new SerializeMethod with this SerializerHelper. |
void |
writeObject(java.lang.Object o,
java.io.ObjectOutputStream out)
Writes a serializable object description to the given object output stream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected SerializerHelper()
Method Detail |
public static SerializerHelper getInstance()
protected static void setInstance(SerializerHelper helper)
helper
- the new instance of the serialize helper.public void registerMethod(SerializeMethod method)
method
- the method that should be registered.public void unregisterMethod(SerializeMethod method)
method
- the method that should be deregistered.protected java.util.HashMap getMethods()
protected org.jfree.xml.factory.objects.ClassComparator getComparator()
protected SerializeMethod getSerializer(java.lang.Class c)
c
- the class for which we want to lookup a serialize method.
protected SerializeMethod getSuperClassObjectDescription(java.lang.Class d, SerializeMethod knownSuperClass)
d
- the class for which we want to lookup a serialize method.knownSuperClass
- the known super class, if any or null.
public void writeObject(java.lang.Object o, java.io.ObjectOutputStream out) throws java.io.IOException
o
- the to be serialized object.out
- the outputstream that should receive the object.
java.io.IOException
- if an I/O error occured.public java.lang.Object readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException
Make sure, that you use the same configuration (library and class versions, registered methods in the SerializerHelper) for reading as you used for writing.
in
- the object input stream from where to read the serialized data.
java.io.IOException
- if reading the stream failed.
java.lang.ClassNotFoundException
- if serialized object class cannot be found.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |