commit 961cd43a75df7bb976b2bda461629ab0dc5fa4f9
Author: Michal Horký <horkmi@students.zcu.cz>
Date:   Mon Apr 6 00:43:49 2020 +0200

    #7794
    
    Rozpoznávání polí, úprava JSON

diff --git a/demo_mh/Deserializer.jar b/demo_mh/Deserializer.jar
new file mode 100644
index 0000000..b620ca8
Binary files /dev/null and b/demo_mh/Deserializer.jar differ
diff --git a/demo_mh/Deserializer/.classpath b/demo_mh/Deserializer/.classpath
index 8a18d82..2b9d098 100644
--- a/demo_mh/Deserializer/.classpath
+++ b/demo_mh/Deserializer/.classpath
@@ -2,6 +2,8 @@
 <classpath>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
 	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="lib" path="libs/json-simple-1.1.1.jar"/>
+	<classpathentry kind="lib" path="D:/Michal/University/1/LS/ASWI/semestralky/Deserializer/aswi2020horky/demo_mh/Deserializer/libs/jackson-core-asl-1.9.13.jar"/>
+	<classpathentry kind="lib" path="D:/Michal/University/1/LS/ASWI/semestralky/Deserializer/aswi2020horky/demo_mh/Deserializer/libs/jackson-mapper-asl-1.9.13.jar"/>
+	<classpathentry kind="lib" path="D:/Michal/University/1/LS/ASWI/semestralky/Deserializer/aswi2020horky/demo_mh/Deserializer/libs/jdeserialize-1.2.jar"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
diff --git a/demo_mh/Deserializer/Deserializer.iml b/demo_mh/Deserializer/Deserializer.iml
deleted file mode 100644
index 4c26c69..0000000
--- a/demo_mh/Deserializer/Deserializer.iml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module type="JAVA_MODULE" version="4">
-  <component name="EclipseModuleManager">
-    <libelement value="jar://$MODULE_DIR$/libs/json-simple-1.1.1.jar!/" />
-    <src_description expected_position="1">
-      <src_folder value="file://$MODULE_DIR$/src" expected_position="1" />
-    </src_description>
-  </component>
-  <component name="NewModuleRootManager">
-    <output url="file://$MODULE_DIR$/bin" />
-    <exclude-output />
-    <content url="file://$MODULE_DIR$">
-      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
-    </content>
-    <orderEntry type="inheritedJdk" />
-    <orderEntry type="sourceFolder" forTests="false" />
-    <orderEntry type="module-library">
-      <library name="json-simple-1.1.1.jar">
-        <CLASSES>
-          <root url="jar://$MODULE_DIR$/libs/json-simple-1.1.1.jar!/" />
-        </CLASSES>
-        <JAVADOC />
-        <SOURCES />
-      </library>
-    </orderEntry>
-  </component>
-</module>
\ No newline at end of file
diff --git a/demo_mh/Deserializer/data b/demo_mh/Deserializer/data
new file mode 100644
index 0000000..a9b4704
Binary files /dev/null and b/demo_mh/Deserializer/data differ
diff --git a/demo_mh/Deserializer/data.out b/demo_mh/Deserializer/data.out
index 9cbc9b2..dca90de 100644
Binary files a/demo_mh/Deserializer/data.out and b/demo_mh/Deserializer/data.out differ
diff --git a/demo_mh/Deserializer/data2 b/demo_mh/Deserializer/data2
new file mode 100644
index 0000000..67e2784
Binary files /dev/null and b/demo_mh/Deserializer/data2 differ
diff --git a/demo_mh/Deserializer/libs/Licenses b/demo_mh/Deserializer/libs/Licenses
index 3ab7778..ae08f3f 100644
--- a/demo_mh/Deserializer/libs/Licenses
+++ b/demo_mh/Deserializer/libs/Licenses
@@ -1,3 +1,29 @@
-JSON Simple
-	https://code.google.com/archive/p/json-simple/
-	Apache License 2.0
\ No newline at end of file
+
+JACKSON JSON
+
+This copy of Jackson JSON processor streaming parser/generator is licensed under the
+Apache (Software) License, version 2.0 ("the License").
+See the License for details about distribution rights, and the
+specific rights regarding derivate works.
+
+You may obtain a copy of the License at:
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+************************************************************
+
+JDESERIALIZE
+
+https://code.google.com/archive/p/jdeserialize/
+https://opensource.org/licenses/BSD-3-Clause
+Copyright <YEAR> <COPYRIGHT HOLDER>
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
diff --git a/demo_mh/Deserializer/libs/jackson-core-asl-1.9.13.jar b/demo_mh/Deserializer/libs/jackson-core-asl-1.9.13.jar
new file mode 100644
index 0000000..bb4fe1d
Binary files /dev/null and b/demo_mh/Deserializer/libs/jackson-core-asl-1.9.13.jar differ
diff --git a/demo_mh/Deserializer/libs/jackson-mapper-asl-1.9.13.jar b/demo_mh/Deserializer/libs/jackson-mapper-asl-1.9.13.jar
new file mode 100644
index 0000000..0f2073f
Binary files /dev/null and b/demo_mh/Deserializer/libs/jackson-mapper-asl-1.9.13.jar differ
diff --git a/demo_mh/Deserializer/libs/jdeserialize-1.2.jar b/demo_mh/Deserializer/libs/jdeserialize-1.2.jar
new file mode 100644
index 0000000..1040c97
Binary files /dev/null and b/demo_mh/Deserializer/libs/jdeserialize-1.2.jar differ
diff --git a/demo_mh/Deserializer/libs/json-simple-1.1.1.jar b/demo_mh/Deserializer/libs/json-simple-1.1.1.jar
deleted file mode 100644
index 66347a6..0000000
Binary files a/demo_mh/Deserializer/libs/json-simple-1.1.1.jar and /dev/null differ
diff --git a/demo_mh/Deserializer/results.json b/demo_mh/Deserializer/results.json
index 0afb557..9ab7d02 100644
--- a/demo_mh/Deserializer/results.json
+++ b/demo_mh/Deserializer/results.json
@@ -1 +1,19 @@
-{"parent":{"variables":{"str":"ABCD","abc":true,"y":59.87},"name":"class serialize.Parent","interface":"java.io.Serializable"},"variables":{"x":10.0,"variable":{"variables":{"array":"NON_IMPLEMENTED"},"name":"class serialize.Contain","interface":"java.io.Serializable"},"numberX":7},"name":"class serialize.Example","interface":"java.io.Serializable"}
\ No newline at end of file
+{
+  "class serialize.Example extends serialize.Example implements java.io.Serializable" : {
+    "numberX" : "7",
+    "x" : "10.0",
+    "variable" : {
+      "class serialize.Contain implements java.io.Serializable" : {
+        "array" : "[W, X, Y, Z]",
+        "array2" : "NOT_IMPLEMENTED"
+      }
+    },
+    "parent" : {
+      "class serialize.Parent implements java.io.Serializable" : {
+        "abc" : "true",
+        "y" : "59.87",
+        "str" : "ABCD"
+      }
+    }
+  }
+}
\ No newline at end of file
diff --git a/demo_mh/Deserializer/simple.json b/demo_mh/Deserializer/simple.json
new file mode 100644
index 0000000..10f8ca3
Binary files /dev/null and b/demo_mh/Deserializer/simple.json differ
diff --git a/demo_mh/Deserializer/src/deserialize/ClassDescription.java b/demo_mh/Deserializer/src/deserialize/ClassDescription.java
index c467ea6..1c276b1 100644
--- a/demo_mh/Deserializer/src/deserialize/ClassDescription.java
+++ b/demo_mh/Deserializer/src/deserialize/ClassDescription.java
@@ -3,7 +3,9 @@ package deserialize;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.json.simple.JSONObject;
+import org.codehaus.jackson.JsonNode;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.codehaus.jackson.node.ObjectNode;
 
 public class ClassDescription {
 
@@ -15,7 +17,8 @@ public class ClassDescription {
 	byte flags;
 	boolean isClass; // or enum
 	
-	private List<ClassDescription> parents = new ArrayList<ClassDescription>();
+	// Class is in the first place, parents are in the other positions.
+	private List<ClassDescription> instances = new ArrayList<ClassDescription>();
 	private int actParentIndex = -1;
 	
 	private List<Variable> variables = new ArrayList<Variable>();
@@ -23,8 +26,8 @@ public class ClassDescription {
 	
 	
 	
-	public List<ClassDescription> getParents() {
-		return parents;
+	public List<ClassDescription> getInstances() {
+		return instances;
 	}
 	
 	public List<Variable> getVariables() {
@@ -42,13 +45,13 @@ public class ClassDescription {
 	}
 	
 	public void addParent(ClassDescription parent) {
-		parents.add(parent);
+		instances.add(parent);
 		actParentIndex++;
 	}
 	
 	public Variable getActVariable() {
 		for (; actParentIndex >= 0; actParentIndex--) {
-			Variable var = parents.get(actParentIndex).nextVariable();
+			Variable var = instances.get(actParentIndex).nextVariable();
 			if (var != null) {
 				return var;
 			}
@@ -60,41 +63,43 @@ public class ClassDescription {
 		this.variables = variables;
 	}
 	
-	@SuppressWarnings("unchecked")
-	public JSONObject getJSONObject() {
+	public JsonNode getJsonNode() {
 		int actIndex = ++actParentIndex;
-		JSONObject obj = new JSONObject();
 		
-		JSONObject vars = new JSONObject();
+		ObjectMapper mapper = new ObjectMapper();
+		
+		JsonNode childNode = mapper.createObjectNode();
 		for (int j = 0; j < variables.size(); j++) {
-			variables.get(j).putToJSON(vars);
+			variables.get(j).putToJson((ObjectNode) childNode);
 		}
-		obj.put("variables", vars);
-		
-		String i = "";
-		if (flags == SC_SERIALIZABLE) {
-			i = "java.io.Serializable";
-		} else if (flags == SC_EXTERNALIZABLE) {
-			i = "java.io.Externalizable";
+		if ((actIndex + 1) < instances.size()) {
+			((ObjectNode) childNode).put("parent", instances.get(actIndex + 1).getJsonNode());
 		}
-		obj.put("interface", i);
-		
+
 		String name;
 		if (isClass) {
 			name = "class";
 		} else {
 			name = "enum";
 		}
+		
 		name += " " + className;
-		obj.put("name", name);
 		
-		if ((actIndex + 1) < parents.size()) {
-			obj.put("parent", parents.get(actIndex + 1).getJSONObject());
+		if (actIndex < instances.size()) {
+			name += " extends " + instances.get(actIndex).className;
 		}
 		
-		return obj;
+		if (flags == SC_SERIALIZABLE) {
+			name += " implements java.io.Serializable";
+		} else if (flags == SC_EXTERNALIZABLE) {
+			name += " implements java.io.Externalizable";
+		}
+		
+		JsonNode rootNode = mapper.createObjectNode();
+		((ObjectNode) rootNode).put(name, childNode);
+		return rootNode;
 	}
-	
+
 	@Override
 	public String toString() {
 		actParentIndex++;
@@ -108,8 +113,8 @@ public class ClassDescription {
 		
 		retValue += " " + className;
 		
-		if ((actParentIndex + 1) < parents.size()) {
-			retValue += " extends " + parents.get(actParentIndex + 1).className;
+		if ((actParentIndex + 1) < instances.size()) {
+			retValue += " extends " + instances.get(actParentIndex + 1).className;
 		}
 		
 		if (flags == SC_SERIALIZABLE) {
@@ -127,8 +132,8 @@ public class ClassDescription {
 		}
 		retValue += "\n}\n";
 		
-		if ((actParentIndex + 1) < parents.size()) {
-			retValue += parents.get(actParentIndex + 1).toString();
+		if ((actParentIndex + 1) < instances.size()) {
+			retValue += instances.get(actParentIndex + 1).toString();
 		}
 		
 		return retValue;
diff --git a/demo_mh/Deserializer/src/deserialize/Deserializer.java b/demo_mh/Deserializer/src/deserialize/Deserializer.java
index c45ee20..b78441f 100644
--- a/demo_mh/Deserializer/src/deserialize/Deserializer.java
+++ b/demo_mh/Deserializer/src/deserialize/Deserializer.java
@@ -35,7 +35,7 @@ public class Deserializer extends Application {
 	@Override
 	public void init() throws Exception {
 		super.init();
-		testing = true;
+		testing = false;
 	}
 	
 	@Override
diff --git a/demo_mh/Deserializer/src/deserialize/Grammar.java b/demo_mh/Deserializer/src/deserialize/Grammar.java
index 11a526a..ab09a35 100644
--- a/demo_mh/Deserializer/src/deserialize/Grammar.java
+++ b/demo_mh/Deserializer/src/deserialize/Grammar.java
@@ -1,11 +1,10 @@
 package deserialize;
 
-import java.nio.ByteBuffer;
 import java.util.ArrayList;
-import java.util.HashMap;
+import java.util.Arrays;
 import java.util.List;
 
-import org.json.simple.JSONObject;
+import org.codehaus.jackson.JsonNode;
 
 /**
  * https://docs.oracle.com/javase/7/docs/platform/serialization/spec/protocol.html
@@ -43,11 +42,11 @@ public class Grammar {
 		reader = new ByteReader(buffer);
 	}
 	
-	
+
 	List<ClassDescription> classes = new ArrayList<ClassDescription>();
 	ClassDescription actClass = null;
 	
-	public JSONObject process() {
+	public JsonNode process() {
 		System.out.println("Kontrola hlavicky souboru: " + (reader.readShort() == STREAM_MAGIC && reader.readShort() == STREAM_VERSION));
 		
 		while (!reader.end()) {
@@ -59,7 +58,7 @@ public class Grammar {
 			}
 		}
 		
-		return classes.get(0).getJSONObject();
+		return classes.get(0).getJsonNode();
 		// System.out.println(classes.get(0).toString());
 	}
 	
@@ -114,15 +113,15 @@ public class Grammar {
 				}
 				break;
 			case TC_ARRAY: {
-					System.out.println("X3");
 					ClassDescription desc = (ClassDescription) object();
+					System.out.println("X3 " /*+ desc*/);
 					// TODO int size = readInt();
 					retValue = desc; // TODO + "[" + size + "]";
 				}
 				break;
 			case TC_STRING: {
-					System.out.println("X4");
 					String str = reader.readUtf();
+					System.out.println("X4 " + str);
 					retValue = str;
 				}
 				break;
@@ -166,9 +165,8 @@ public class Grammar {
 					System.out.println("X8");
 					int count = reader.readInt();
 					String name = reader.readUtf();
-					retValue = name + "[" + +count + "]";
+					retValue = name + "[" + count + "]";
 					// TODO object(null); classDesc();
-					
 				}
 				break;
 			case TC_NULL: {
@@ -199,12 +197,28 @@ public class Grammar {
 							object(); // END BLOK
 							object(); // NULL
 							
-							int count = reader.readInt();
-							System.out.println("------------- VELIKOST POLE = " + count);
-							for (int i = 0; i < count; i++) {
-								System.out.println("------------- HODNOTA = " + reader.readChar());
+							String dataType = desccc.className.substring(1);
+							
+							Object array[] = new Object[reader.readInt()];
+							for (int i = 0; i < array.length; i++) {
+								Object element = null;
+								switch (dataType.charAt(0)) {
+								case 'B': element = reader.readByte(); break;
+								case 'C': element = reader.readChar(); break;
+								case 'D': element = reader.readDouble(); break;
+								case 'F': element = reader.readFloat(); break;
+								case 'I': element = reader.readInt(); break;
+								case 'J': element = reader.readLong(); break;
+								case 'S': element = reader.readShort(); break;
+								case 'Z': element = reader.readBoolean(); break;
+								case '[': object(); break; // TODO
+								case 'L': element = object(); break;
+								}
+								array[i] = element;
 							}
-							//actVar.setValue(readByte());
+							
+							System.out.println(Arrays.toString(array));
+							actVar.setValue(array);
 							break;
 						case 'L': actVar.setValue(object()); break;
 						}
@@ -213,6 +227,10 @@ public class Grammar {
 				break;
 			case TC_REFERENCE: {
 					System.out.println("---REFERENCE---");
+					int ref = reader.readInt();
+					System.out.println(String.format("%X", ref));
+					int num = reader.readInt();
+					System.out.println(String.format("%X", num));
 					// TODO (ClassDesc) TC_REFERENCE (int)handle ?!?
 					retValue = null;
 				}
@@ -220,8 +238,8 @@ public class Grammar {
 				
 				
 			case TC_EXCEPTION: {
-					// TODO (Throwable)object(null);
-					retValue = "(Throwable)";
+					// (Throwable)object;
+					retValue = (Throwable) object();
 				}
 				break;
 			case TC_RESET: {
@@ -233,15 +251,23 @@ public class Grammar {
 			case TC_BLOCKDATA: {
 					System.out.println("X13");
 					char size = reader.readUnsignedByte();
+					byte[] data = new byte[size];
+					for (int i = 0; i < size; i++) {
+						data[i] = reader.readByte();
+					}
 					// (unsigned byte)<size> (byte)[size];
-					retValue = "byte [" + (int) size + "]";
+					retValue = data;
 				}
 				break;
 			case TC_BLOCKDATALONG: {
 					System.out.println("X14");
 					int size = reader.readInt();
+					byte[] data = new byte[size];
+					for (int i = 0; i < size; i++) {
+						data[i] = reader.readByte();
+					}
 					// (int)<size> (byte)[size];
-					retValue = "byte [" + size + "]";
+					retValue = data;
 				}
 				break;
 			case TC_ENDBLOCKDATA: {
diff --git a/demo_mh/Deserializer/src/deserialize/ToJSON.java b/demo_mh/Deserializer/src/deserialize/ToJSON.java
index 95621e7..f85ada8 100644
--- a/demo_mh/Deserializer/src/deserialize/ToJSON.java
+++ b/demo_mh/Deserializer/src/deserialize/ToJSON.java
@@ -11,7 +11,8 @@ import java.io.ObjectInputStream;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipFile;
 
-import org.json.simple.JSONObject;
+import org.codehaus.jackson.JsonNode;
+import org.codehaus.jackson.map.ObjectMapper;
 
 public class ToJSON extends Thread {
 	
@@ -44,7 +45,7 @@ public class ToJSON extends Thread {
 		System.out.println("Spoustim univerzalni deserializer.");
 		
 		Grammar g = new Grammar(buffer);
-		JSONObject results = g.process();
+		JsonNode results = g.process();
 		
 		save(results);
 		
@@ -117,11 +118,12 @@ public class ToJSON extends Thread {
 	    return array;
 	}
 	
-	private void save(JSONObject obj) {
+	private void save(JsonNode node) {
         try {
             FileWriter fw = new FileWriter(output);
             BufferedWriter bw = new BufferedWriter(fw);
-            bw.write(obj.toJSONString());
+            String jsonString = (new ObjectMapper()).writerWithDefaultPrettyPrinter().writeValueAsString(node);
+            bw.write(jsonString);
             bw.flush();
             bw.close();
             Report.info("JSON", null, "Ulo�en� souboru prob�hlo v po��dku.");
@@ -130,5 +132,5 @@ public class ToJSON extends Thread {
             Report.info("JSON", null, "P�i ukl�d�n� souboru nastala chyba.");
         }
 	}
-	
+
 }
diff --git a/demo_mh/Deserializer/src/deserialize/Variable.java b/demo_mh/Deserializer/src/deserialize/Variable.java
index 9413bc3..f512906 100644
--- a/demo_mh/Deserializer/src/deserialize/Variable.java
+++ b/demo_mh/Deserializer/src/deserialize/Variable.java
@@ -1,6 +1,8 @@
 package deserialize;
 
-import org.json.simple.JSONObject;
+import java.util.Arrays;
+
+import org.codehaus.jackson.node.ObjectNode;
 
 public class Variable {
 	
@@ -8,6 +10,7 @@ public class Variable {
 	private String variable;
 	private String typeName;
 	private Object value = null;
+	private Object array[] = null;
 	
 	public Variable(char type, String variable, String typeName) {
 		this.type = type;
@@ -34,24 +37,29 @@ public class Variable {
 	}
 	
 	public boolean isValueSet() {
-		return value != null;
+		return value != null || array != null;
 	}
 	
 	public void setValue(Object value) {
 		this.value = value;
 	}
 	
-	@SuppressWarnings("unchecked")
-	public void putToJSON(JSONObject obj) {
-		if (value != null) {
-			if (value.getClass().toString().equals(ClassDescription.class.toString())) {
+	public void setValue(Object array[]) {
+		this.array = array;
+	}
+	
+	public void putToJson(ObjectNode node) {
+		if (value != null || array != null) {
+			if (value != null && value.getClass().toString().equals(ClassDescription.class.toString())) {
 				ClassDescription desc = (ClassDescription) value;
-				obj.put(variable, desc.getJSONObject());
-			} else {
-				obj.put(variable, value);
+				node.put(variable, desc.getJsonNode());
+			} else if (value != null) {
+				node.put(variable, value.toString());
+			} else if (array != null) {
+				node.put(variable, Arrays.toString(array));
 			}
 		} else {
-			obj.put(variable, "NON_IMPLEMENTED");
+			node.put(variable, "NOT_IMPLEMENTED");
 		}
 	}
 	
@@ -72,8 +80,10 @@ public class Variable {
 			if (value.getClass().toString().equals(ClassDescription.class.toString())) {
 				ClassDescription desc = (ClassDescription) value;
 				result += desc.toString();
-			} else {
+			} else if (value != null) {
 				result += value;
+			} else if (array != null) {
+				result += Arrays.toString(array);
 			}
 		}
 		
diff --git a/demo_mh/Deserializer/src/serialize/Contain.java b/demo_mh/Deserializer/src/serialize/Contain.java
index b2fe51a..cd62e8e 100644
--- a/demo_mh/Deserializer/src/serialize/Contain.java
+++ b/demo_mh/Deserializer/src/serialize/Contain.java
@@ -7,6 +7,6 @@ public class Contain implements Serializable {
 	private static final long serialVersionUID = 1L;
 	
 	char array[] = new char[] {'W', 'X', 'Y', 'Z'};
-	// float realNum = 15.6f;
+	String array2[] = new String[] { "AbC", "dEfGhI", "xyz", "jKlMnOpQ"};
 	
 }
diff --git a/demo_mh/Deserializer/src/serialize/Parent.java b/demo_mh/Deserializer/src/serialize/Parent.java
index da890b4..64e3e7d 100644
--- a/demo_mh/Deserializer/src/serialize/Parent.java
+++ b/demo_mh/Deserializer/src/serialize/Parent.java
@@ -9,5 +9,6 @@ public class Parent implements Serializable {
 	String str = "ABCD";
 	boolean abc = true;
 	double y = 59.87;
+	// TODO Contain c[] = new Contain[] {new Contain(), new Contain(), new Contain()};
 	
 }
diff --git a/demo_mh/example.json b/demo_mh/example.json
new file mode 100644
index 0000000..9ab7d02
--- /dev/null
+++ b/demo_mh/example.json
@@ -0,0 +1,19 @@
+{
+  "class serialize.Example extends serialize.Example implements java.io.Serializable" : {
+    "numberX" : "7",
+    "x" : "10.0",
+    "variable" : {
+      "class serialize.Contain implements java.io.Serializable" : {
+        "array" : "[W, X, Y, Z]",
+        "array2" : "NOT_IMPLEMENTED"
+      }
+    },
+    "parent" : {
+      "class serialize.Parent implements java.io.Serializable" : {
+        "abc" : "true",
+        "y" : "59.87",
+        "str" : "ABCD"
+      }
+    }
+  }
+}
\ No newline at end of file
diff --git a/demo_mh/example.out b/demo_mh/example.out
new file mode 100644
index 0000000..dca90de
Binary files /dev/null and b/demo_mh/example.out differ
