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, boolean child)
|
31
|
{
|
32
|
//basically, for representing the 'instance' instance, its classdesc is just enough
|
33
|
return this.classdesc.toJson(indentation, this.fielddata, child);
|
34
|
}
|
35
|
|
36
|
public String toString() {
|
37
|
StringBuffer sb = new StringBuffer();
|
38
|
sb.append(classdesc.name).append(' ').append("_h").append(jdeserialize.hex(handle))
|
39
|
.append(" = r_").append(jdeserialize.hex(classdesc.handle)).append("; ");
|
40
|
//sb.append("// [instance " + jdeserialize.hex(handle) + ": " + jdeserialize.hex(classdesc.handle) + "/" + classdesc.name).append("]");
|
41
|
return sb.toString();
|
42
|
}
|
43
|
|
44
|
/**
|
45
|
* Object annotation data.
|
46
|
*/
|
47
|
public Map<classdesc, List<content>> annotations;
|
48
|
}
|