|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.wicket.util.lang.WicketObjects
public class WicketObjects
Object (de)serialization utilities.
Nested Class Summary | |
---|---|
static interface |
WicketObjects.IObjectSizeOfStrategy
Interface that enables users to plugin the way object sizes are calculated with Wicket. |
static class |
WicketObjects.SerializingObjectSizeOfStrategy
WicketObjects.IObjectSizeOfStrategy that works by serializing the object to an instance of
ByteCountingOutputStream , which records the number of bytes written to it. |
Method Summary | ||
---|---|---|
static Object |
byteArrayToObject(byte[] data)
De-serializes an object from a byte array. |
|
static Object |
cloneModel(Object object)
Makes a deep clone of an object by serializing and deserializing it. |
|
static Object |
cloneObject(Object object)
Makes a deep clone of an object by serializing and deserializing it. |
|
static Object |
newInstance(String className)
Creates a new instance using the current application's class resolver. |
|
static byte[] |
objectToByteArray(Object object)
Serializes an object into a byte array. |
|
static byte[] |
objectToByteArray(Object object,
String applicationName)
Serializes an object into a byte array. |
|
static
|
resolveClass(String className)
|
|
static void |
setObjectSizeOfStrategy(WicketObjects.IObjectSizeOfStrategy objectSizeOfStrategy)
Sets the strategy for determining the sizes of objects. |
|
static void |
setObjectStreamFactory(IObjectStreamFactory objectStreamFactory)
Configure this utility class to use the provided IObjectStreamFactory instance. |
|
static long |
sizeof(Serializable object)
Computes the size of an object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static <T> Class<T> resolveClass(String className)
T
- class typeclassName
- Class to resolve
ClassNotFoundException
public static Object byteArrayToObject(byte[] data)
data
- The serialized object
public static Object cloneModel(Object object)
object
- The object to clone
public static Object cloneObject(Object object)
object
- The object to clone
cloneModel(Object)
public static Object newInstance(String className)
className
- The full class name
public static byte[] objectToByteArray(Object object, String applicationName)
object
- The objectapplicationName
- The name of application - required when serialization and deserialisation happen
outside thread in which application thread local is set
public static byte[] objectToByteArray(Object object)
object
- The object
public static void setObjectSizeOfStrategy(WicketObjects.IObjectSizeOfStrategy objectSizeOfStrategy)
objectSizeOfStrategy
- the strategy. Pass null to reset to the default.public static void setObjectStreamFactory(IObjectStreamFactory objectStreamFactory)
IObjectStreamFactory
instance.
objectStreamFactory
- The factory instance to use. If you pass in null, the
default
will be set (again). Pass null to reset
to the default.public static long sizeof(Serializable object)
object
- Object to compute size of
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |