Projekt

Obecné

Profil

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

    
3
import java.util.*;
4

    
5
/**
6
 * Represents an instance of a non-enum, non-Class, non-ObjectStreamClass,
7
 * non-array class, including the non-transient field values, for all classes in
8
 * its hierarchy and inner classes.
9
 */
10
public class instance extends contentbase {
11
    /**
12
     * Collection of field data, organized by class description.
13
     */
14
    public Map<classdesc, Map<field, Object>> fielddata;
15

    
16
    /**
17
     * Class description for this instance.
18
     */
19
    public classdesc classdesc;
20

    
21
    /**
22
     * Constructor.
23
     */
24
    public instance() {
25
        super(contenttype.INSTANCE);
26
        this.fielddata = new HashMap<classdesc, Map<field, Object>>();
27
    }
28

    
29
    
30
    public @Override String toJson(String indentation, Map<classdesc, Map<field, Object>> fielddata, Map<String, String> formatting)
31
    {
32
        return this.classdesc.toJson(indentation, this.fielddata, formatting);
33
    }
34

    
35
    public String toString() {
36
        StringBuffer sb = new StringBuffer();
37
        sb.append(classdesc.name).append(' ').append("_h").append(jdeserialize.hex(handle))
38
            .append(" = r_").append(jdeserialize.hex(classdesc.handle)).append(";  ");
39
        //sb.append("// [instance " + jdeserialize.hex(handle) + ": " + jdeserialize.hex(classdesc.handle) + "/" + classdesc.name).append("]");
40
        return sb.toString();
41
    }
42

    
43
    /**
44
     * Object annotation data.
45
     */
46
    public Map<classdesc, List<content>> annotations;
47
}
(18-18/20)