Projekt

Obecné

Profil

Stáhnout (2.15 KB) Statistiky
| Větev: | Tag: | Revize:
1
package jdeserialize;
2

    
3
import java.util.Map;
4

    
5
/**
6
 * <p>
7
 * Generic interface for all data that may be read from the stream (except
8
 * null).
9
 * </p>
10
 *
11
 * <p>
12
 * A successful read of the stream will result in a series of content instances
13
 * or null references. For details on specific metadata, see documentation on
14
 * implementing classes/subinterfaces.
15
 * </p>
16
 */
17
public interface content {
18
    /**
19
     * @return the type of instance represented by this object.
20
     */
21
    public contenttype getType();
22

    
23
    /**
24
     * <p>
25
     * Get the numeric handle by which this object was referred to in the object stream.
26
     * These handles are used internally by Object{Output,Input}Stream as a mechanism to
27
     * avoid costly duplication.
28
     * </p>
29
     *
30
     * <p>
31
     * CAUTION: they are *not* necessarily unique across all objects in a given stream!
32
     * If an exception was thrown during serialization (which is most likely to happen
33
     * during a serialized objct's writeObject() implementation), then the stream resets
34
     * before and after the exception is serialized.  
35
     * </p>
36
     *
37
     * @return the handle assigned in the stream
38
     */
39
    public int getHandle();
40

    
41
    /**
42
     * Performs extra object-specific validity checks.  
43
     *
44
     * @throws ValidityException if the object's state is invalid
45
     */
46
    public void validate() throws ValidityException;
47

    
48
    /**
49
     * <p>
50
     * Tells whether or not this object is an exception that was caught during
51
     * serialization.  
52
     * </p>
53
     *
54
     * <p>
55
     * <b>Note</b>:  Not every Throwable or Exception in the stream will have this flag set to
56
     * true; only those which were thrown <i>during serialization</i> will
57
     * </p>
58
     * 
59
     * @return true iff the object was an exception thrown during serialization
60
     */
61
    public boolean isExceptionObject();
62

    
63
    /**
64
     * Sets the flag that tells whether or not this object is an exception that was caught
65
     * during serialization.
66
     *
67
     * @param value the new value to use
68
     */
69
    public void setIsExceptionObject(boolean value);
70

    
71
    public String toJson(String indentation, Map<classdesc, Map<field, Object>> fielddata);
72
}
73

    
(11-11/20)