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