1
|
package jdeserialize;
|
2
|
|
3
|
/**
|
4
|
* <p>
|
5
|
* Generic interface for all data that may be read from the stream (except null).
|
6
|
* </p>
|
7
|
*
|
8
|
* <p>
|
9
|
* A successful read of the stream will result in a series of content instances or null
|
10
|
* references. For details on specific metadata, see documentation on implementing
|
11
|
* classes/subinterfaces.
|
12
|
* </p>
|
13
|
*/
|
14
|
public interface content {
|
15
|
/**
|
16
|
* @return the type of instance represented by this object.
|
17
|
*/
|
18
|
public contenttype getType();
|
19
|
|
20
|
/**
|
21
|
* <p>
|
22
|
* Get the numeric handle by which this object was referred to in the object stream.
|
23
|
* These handles are used internally by Object{Output,Input}Stream as a mechanism to
|
24
|
* avoid costly duplication.
|
25
|
* </p>
|
26
|
*
|
27
|
* <p>
|
28
|
* CAUTION: they are *not* necessarily unique across all objects in a given stream!
|
29
|
* If an exception was thrown during serialization (which is most likely to happen
|
30
|
* during a serialized objct's writeObject() implementation), then the stream resets
|
31
|
* before and after the exception is serialized.
|
32
|
* </p>
|
33
|
*
|
34
|
* @return the handle assigned in the stream
|
35
|
*/
|
36
|
public int getHandle();
|
37
|
|
38
|
/**
|
39
|
* Performs extra object-specific validity checks.
|
40
|
*
|
41
|
* @throws ValidityException if the object's state is invalid
|
42
|
*/
|
43
|
public void validate() throws ValidityException;
|
44
|
|
45
|
/**
|
46
|
* <p>
|
47
|
* Tells whether or not this object is an exception that was caught during
|
48
|
* serialization.
|
49
|
* </p>
|
50
|
*
|
51
|
* <p>
|
52
|
* <b>Note</b>: Not every Throwable or Exception in the stream will have this flag set to
|
53
|
* true; only those which were thrown <i>during serialization</i> will
|
54
|
* </p>
|
55
|
*
|
56
|
* @return true iff the object was an exception thrown during serialization
|
57
|
*/
|
58
|
public boolean isExceptionObject();
|
59
|
|
60
|
/**
|
61
|
* Sets the flag that tells whether or not this object is an exception that was caught
|
62
|
* during serialization.
|
63
|
*
|
64
|
* @param value the new value to use
|
65
|
*/
|
66
|
public void setIsExceptionObject(boolean value);
|
67
|
}
|
68
|
|