org.apache.wicket.util.io
Class ClassStreamHandler

java.lang.Object
  extended by org.apache.wicket.util.io.ClassStreamHandler

public final class ClassStreamHandler
extends Object

TODO DOC ME! NOTE: this class uses Sun-specific features: we use Unsafe because we need to set the final fields, and we use ReflectionFactory to be able to find constructors appropriate for serialization.

Author:
jcompagner

Field Summary
static byte ARRAY
           
static int CLASS
           
static byte CLASS_DEF
           
static byte HANDLE
           
static byte NULL
           
static byte PRIMITIVE_ARRAY
           
 
Method Summary
 Object createObject()
           
 short getClassId()
           
 Class<?> getStreamClass()
           
 boolean invokeReadMethod(WicketObjectInputStream wois, Object obj)
           
 boolean invokeWriteMethod(WicketObjectOutputStream woos, Object obj)
           
 Object readArray(WicketObjectInputStream wois)
           
 void readFields(WicketObjectInputStream wois, Object object)
           
 Object readResolve(Object o)
           
 void writeArray(Object obj, WicketObjectOutputStream wois)
           
 void writeFields(WicketObjectOutputStream woos, Object obj)
           
 Object writeReplace(Object o)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HANDLE

public static final byte HANDLE
See Also:
Constant Field Values

NULL

public static final byte NULL
See Also:
Constant Field Values

CLASS_DEF

public static final byte CLASS_DEF
See Also:
Constant Field Values

ARRAY

public static final byte ARRAY
See Also:
Constant Field Values

PRIMITIVE_ARRAY

public static final byte PRIMITIVE_ARRAY
See Also:
Constant Field Values

CLASS

public static final int CLASS
See Also:
Constant Field Values
Method Detail

getStreamClass

public Class<?> getStreamClass()
Returns:
stream class

getClassId

public short getClassId()
Returns:
class id

createObject

public Object createObject()
                    throws IllegalArgumentException,
                           InstantiationException,
                           IllegalAccessException,
                           InvocationTargetException
Returns:
new instance of class
Throws:
InvocationTargetException
IllegalAccessException
InstantiationException
IllegalArgumentException

writeFields

public void writeFields(WicketObjectOutputStream woos,
                        Object obj)
                 throws WicketSerializeableException
Parameters:
woos -
obj -
Throws:
WicketSerializeableException

readFields

public void readFields(WicketObjectInputStream wois,
                       Object object)
                throws WicketSerializeableException
Parameters:
wois -
object -
Throws:
WicketSerializeableException

writeArray

public void writeArray(Object obj,
                       WicketObjectOutputStream wois)
                throws IOException
Parameters:
obj -
wois -
Throws:
IOException

readArray

public Object readArray(WicketObjectInputStream wois)
                 throws IOException
Parameters:
wois -
Returns:
array
Throws:
IOException

invokeWriteMethod

public boolean invokeWriteMethod(WicketObjectOutputStream woos,
                                 Object obj)
Parameters:
woos -
obj -
Returns:
true if method was invoked, false otherwise
Throws:
InvocationTargetException
IllegalAccessException
IllegalArgumentException

invokeReadMethod

public boolean invokeReadMethod(WicketObjectInputStream wois,
                                Object obj)
Parameters:
wois -
obj -
Returns:
if read method was invoked

writeReplace

public Object writeReplace(Object o)
                    throws NotSerializableException
Parameters:
o -
Returns:
replacement object
Throws:
NotSerializableException

readResolve

public Object readResolve(Object o)
                   throws NotSerializableException
Parameters:
o -
Returns:
resolved object
Throws:
NotSerializableException


Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.