Revize 4bf1dab0
Přidáno uživatelem Jan Havlíček před asi 5 roky(ů)
demo_jh/Deserializer_tests/src/app/App.java | ||
---|---|---|
21 | 21 |
public static void main(String[] args) throws Exception { |
22 | 22 |
App app = new App(); |
23 | 23 |
|
24 |
app.standartSerializationDeserialization(); |
|
25 |
|
|
24 |
app.standartSerializationDeserialization(); |
|
25 |
String res = app.objectToJSON(new samples.ok.Simple()); |
|
26 |
System.out.println(res); |
|
26 | 27 |
|
27 | 28 |
//test with calling the name of original jd project |
28 | 29 |
//app.jdCallMain(); |
demo_jh/Deserializer_tests/src/samples/ok/Simple.java | ||
---|---|---|
10 | 10 |
HIGH |
11 | 11 |
} |
12 | 12 |
|
13 |
private static final long serialVersionUID = 1L;
|
|
13 |
public static final long serialVersionUID = 1L;
|
|
14 | 14 |
|
15 |
private String pozdrav = "AHOJ";
|
|
16 |
private int testInt = 123;
|
|
17 |
private double testDouble = 1.00;
|
|
18 |
private int[] intArray = new int[3];
|
|
19 |
private String[] stringArray = new String[3];
|
|
15 |
public String pozdrav = "AHOJ";
|
|
16 |
public int testInt = 123;
|
|
17 |
public double testDouble = 1.00;
|
|
18 |
public int[] intArray = new int[3];
|
|
19 |
public String[] stringArray = new String[3];
|
|
20 | 20 |
|
21 |
private Level localEnum = Level.LOW;
|
|
21 |
public Level localEnum = Level.LOW;
|
|
22 | 22 |
|
23 | 23 |
public Simple() |
24 | 24 |
{ |
project/Deserializer/bcha.json | ||
---|---|---|
3 | 3 |
"testDouble" : "1.0", |
4 | 4 |
"testInt" : "123", |
5 | 5 |
"intArray" : "[5,10,15]", |
6 |
"localEnum" : "LOW", |
|
6 | 7 |
"pozdrav" : "AHOJ", |
7 | 8 |
"stringArray" : "[A,B,C]" |
8 | 9 |
} |
project/Deserializer/src/Deserializer.java | ||
---|---|---|
159 | 159 |
}); |
160 | 160 |
|
161 | 161 |
//tests |
162 |
Converter thread = new Converter(this, new File("simple.out"), new File("bcha.json"));
|
|
162 |
Converter thread = new Converter(this, new File("Deserializer/simple.out"), new File("Deserializer/bcha.json"));
|
|
163 | 163 |
thread.start(); |
164 | 164 |
} |
165 | 165 |
|
project/Deserializer/src/jdeserialize/enumobj.java | ||
---|---|---|
32 | 32 |
this.value = so; |
33 | 33 |
} |
34 | 34 |
public String toString() { |
35 |
return "[enum " + jdeserialize.hex(handle) + ": " + value.value + "]";
|
|
35 |
return this.value.value;
|
|
36 | 36 |
} |
37 | 37 |
} |
Také k dispozici: Unified diff
#7830 enum format OK