org.apache.wicket.core.util.io
Class SerializableChecker
java.lang.Object
java.io.OutputStream
java.io.ObjectOutputStream
org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream
org.apache.wicket.core.util.io.SerializableChecker
- All Implemented Interfaces:
- Closeable, DataOutput, Flushable, ObjectOutput, ObjectStreamConstants
public class SerializableChecker
- extends CheckingObjectOutputStream
Utility class that analyzes objects for non-serializable nodes. Construct, then call
ObjectOutputStream.writeObject(Object)
with the object you want to check. When a non-serializable object is
found, a ObjectCheckException
is thrown with a message that shows the trace up
to the not-serializable object. The exception is thrown for the first non-serializable instance
it encounters, so multiple problems will not be shown.
- Author:
- eelcohillenius, Al Maw
Fields inherited from interface java.io.ObjectStreamConstants |
baseWireHandle, PROTOCOL_VERSION_1, PROTOCOL_VERSION_2, SC_BLOCK_DATA, SC_ENUM, SC_EXTERNALIZABLE, SC_SERIALIZABLE, SC_WRITE_METHOD, STREAM_MAGIC, STREAM_VERSION, SUBCLASS_IMPLEMENTATION_PERMISSION, SUBSTITUTION_PERMISSION, TC_ARRAY, TC_BASE, TC_BLOCKDATA, TC_BLOCKDATALONG, TC_CLASS, TC_CLASSDESC, TC_ENDBLOCKDATA, TC_ENUM, TC_EXCEPTION, TC_LONGSTRING, TC_MAX, TC_NULL, TC_OBJECT, TC_PROXYCLASSDESC, TC_REFERENCE, TC_RESET, TC_STRING |
Method Summary |
static boolean |
isAvailable()
Deprecated. Use ObjectChecker#isAvailable() instead |
Methods inherited from class java.io.ObjectOutputStream |
annotateClass, annotateProxyClass, defaultWriteObject, drain, enableReplaceObject, flush, putFields, replaceObject, useProtocolVersion, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeClassDescriptor, writeDouble, writeFields, writeFloat, writeInt, writeLong, writeObject, writeShort, writeStreamHeader, writeUnshared, writeUTF |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SerializableChecker
public SerializableChecker(NotSerializableException exception)
throws IOException
- Constructor.
- Parameters:
exception
- exception that should be set as the cause when throwing a new exception
- Throws:
IOException
SerializableChecker
public SerializableChecker(OutputStream outputStream,
NotSerializableException exception)
throws IOException
- Constructor.
- Parameters:
exception
- exception that should be set as the cause when throwing a new exceptionoutputStream
- the output stream where the serialized object will be written upon successful check
- Throws:
IOException
isAvailable
@Deprecated
public static boolean isAvailable()
- Deprecated. Use ObjectChecker#isAvailable() instead
- Delegate to preserve binary compatibility.
- Returns:
true
if the checker can be used
Copyright © 2006–2013 Apache Software Foundation. All rights reserved.