39 |
package java.io; |
package java.io; |
40 |
|
|
41 |
/** |
/** |
42 |
* What does this interface really do? |
* This class allows an object to validate that it is valid after |
43 |
|
* deserialization has run completely for it and all dependent objects. |
44 |
|
* This allows an object to determine if it is invalid even if all |
45 |
|
* state data was correctly deserialized from the stream. It can also |
46 |
|
* be used to perform re-initialization type activities on an object |
47 |
|
* after it has been completely deserialized. |
48 |
|
* |
49 |
|
* Since this method functions as a type of callback, it must be |
50 |
|
* registered through <code>ObjectInputStream.registerValidation</code> |
51 |
|
* in order to be invoked. This is typically done in the |
52 |
|
* <code>readObject</code> method. |
53 |
* |
* |
54 |
* @author Aaron M. Renn (arenn@urbanophile.com) |
* @author Aaron M. Renn (arenn@urbanophile.com) |
55 |
|
* |
56 |
|
* @see ObjectInputStream#registerValidation |
57 |
*/ |
*/ |
58 |
public interface ObjectInputValidation |
public interface ObjectInputValidation |
59 |
{ |
{ |
|
|
|
60 |
/** |
/** |
61 |
* This method is called to validate an object. If the object is invalid |
* This method is called to validate an object after serialization |
62 |
* an exception is thrown. |
* is complete. If the object is invalid an exception is thrown. |
63 |
* |
* |
64 |
* @exception InvalidObjectException If the object is invalid |
* @exception InvalidObjectException If the object is invalid |
65 |
*/ |
*/ |