Revize 0ad0b530
Přidáno uživatelem Jan Havlíček před asi 5 roky(ů)
project/Deserializer/bcha.json | ||
---|---|---|
2 | 2 |
class samples.ok.Simple : { |
3 | 3 |
"testDouble" : 1.0, |
4 | 4 |
"testInt" : 123, |
5 |
"intArray" : [ ], |
|
5 |
"intArray" : [ 5, 10, 15 ],
|
|
6 | 6 |
"locInnerClassInstance" : { |
7 | 7 |
class samples.ok.Inner : { |
8 | 8 |
"vnitrni" : "INNER STRING AM I" |
project/Deserializer/src/jdeserialize/arrayobj.java | ||
---|---|---|
35 | 35 |
sb.append("[ "); |
36 | 36 |
|
37 | 37 |
for (Object el : this.data) { |
38 |
if (el != null && el instanceof content) { |
|
39 |
sb.append(((content)el).toJson(indentation)); |
|
38 |
if (el != null) { |
|
39 |
if (el instanceof content) { |
|
40 |
sb.append(((content) el).toJson(indentation)); |
|
41 |
}else{ |
|
42 |
sb.append(el.toString()); |
|
43 |
} |
|
40 | 44 |
// el null! |
41 | 45 |
if (!el.equals(this.data.get(this.data.size() - 1))) { |
42 | 46 |
sb.append(", "); |
project/Deserializer/src/jdeserialize/instance.java | ||
---|---|---|
38 | 38 |
|
39 | 39 |
// ClassName |
40 | 40 |
sb.append("{\n").append(indentation).append("class ").append(classdesc.name); |
41 |
//System.out.println(sb.toString()); |
|
41 | 42 |
// extends |
42 | 43 |
if (classdesc.superclass != null) { |
43 | 44 |
sb.append(" extends ").append(classdesc.superclass.name); |
45 |
//System.out.println(sb.toString()); |
|
44 | 46 |
} |
45 | 47 |
// implements |
46 | 48 |
if (classdesc.interfaces != null) { |
... | ... | |
48 | 50 |
for (String str : classdesc.interfaces) { |
49 | 51 |
sb.append(str); |
50 | 52 |
} |
53 |
//System.out.println(sb.toString()); |
|
51 | 54 |
} |
52 | 55 |
sb.append(" : {"); // ending of first line |
56 |
//System.out.println(sb.toString()); |
|
53 | 57 |
|
54 | 58 |
for (field f : classdesc.fields) { |
55 | 59 |
// v this.fielddata najit element, jehoz key == classdesc |
... | ... | |
70 | 74 |
sb.append("\"").append(f.name).append("\""); |
71 | 75 |
sb.append(" : "); |
72 | 76 |
sb.append(val); |
77 |
//System.out.println(sb.toString()); |
|
73 | 78 |
|
74 | 79 |
if (!f.equals(classdesc.fields[classdesc.fields.length - 1])) { |
75 | 80 |
sb.append(", "); |
81 |
//System.out.println(sb.toString()); |
|
76 | 82 |
} |
77 | 83 |
} |
78 | 84 |
|
79 | 85 |
sb.append("\n").append(indentation).append("}\n}"); |
86 |
//System.out.println(sb.toString()); |
|
80 | 87 |
|
81 | 88 |
/*if (classdesc.getType() == contenttype.CLASSDESC && instance.indentedClasses.contains(classdesc.name)) {*/ |
82 | 89 |
indentation.replaceFirst("\t", ""); |
Také k dispozici: Unified diff
#re#7831 Output format non-String array repaired