Projekt

Obecné

Profil

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

    
3
import java.util.HashMap;
4
import java.util.Map;
5

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

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

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

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

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

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

    
(11-11/20)