commit 4d741e6dbfe3842358ccf97ae4611d4f0f864f52
Author: @havlijan17 <havlijan@students.zcu.cz>
Date:   Tue May 5 19:42:28 2020 +0200

    re #7893 Constants + repeating lines + html tag pairs in comments

diff --git a/project/Deserializer/src/jdeserialize/arrayobj.java b/project/Deserializer/src/jdeserialize/arrayobj.java
index 22a48a6..34045db 100644
--- a/project/Deserializer/src/jdeserialize/arrayobj.java
+++ b/project/Deserializer/src/jdeserialize/arrayobj.java
@@ -44,18 +44,18 @@ public class arrayobj extends contentbase {
             if (el != null) {
                 if (el instanceof content) {
                     if(!bracketInserted){
-                        sb.append("\n").append(indentation).append("[ \n");
+                        sb.append(NEW_LINE).append(indentation).append("[ " + NEW_LINE);
                         bracketInserted = true;
-                        indentation += "\t";
+                        indentation += INDENT;
                     }
                     sb.append(((content) el).toJson(indentation, fielddata, false));
 
                     if (!isLast) {
-                        sb.append(",\n");
+                        sb.append("," + NEW_LINE);
                     }
                     else{
-                        indentation = indentation.replaceFirst("\t", "");
-                        sb.append("\n").append(indentation).append("]");
+                        indentation = indentation.replaceFirst(INDENT, "");
+                        sb.append(NEW_LINE).append(indentation).append("]");
                         bracketInserted = false;
                     }
                 }else{
diff --git a/project/Deserializer/src/jdeserialize/classdesc.java b/project/Deserializer/src/jdeserialize/classdesc.java
index f2b2629..0df9981 100644
--- a/project/Deserializer/src/jdeserialize/classdesc.java
+++ b/project/Deserializer/src/jdeserialize/classdesc.java
@@ -252,8 +252,8 @@ public class classdesc extends contentbase {
             sb.append(indentation);
         }
 
-        sb.append("{\n");
-        indentation += "\t";
+        sb.append("{" + NEW_LINE);
+        indentation += INDENT;
 
         sb.append(indentation).append("class ").append(this.name);
 
@@ -261,7 +261,7 @@ public class classdesc extends contentbase {
         this.interfacesToJson(sb, this.interfaces);
 
         sb.append(" : {"); // ending of first line
-        indentation += "\t";
+        indentation += INDENT;
 
         //iterating through fields and converts them into json string
         for (field locField : this.fields) {
@@ -277,7 +277,7 @@ public class classdesc extends contentbase {
                 fieldJsonValue = locVal.toString();
             }
 
-            String locString = "\n" + indentation + "\"" + locField.name + "\"" + " : " + fieldJsonValue;
+            String locString = NEW_LINE + indentation + "\"" + locField.name + "\"" + " : " + fieldJsonValue;
             sb.append(locString);
 
             if (!locField.equals(this.fields[this.fields.length - 1])) {
@@ -285,23 +285,33 @@ public class classdesc extends contentbase {
             }
         }
 
-        indentation = indentation.replaceFirst("\t", "");
-        sb.append("\n").append(indentation).append("}");
+        closingJsonSeq(sb, indentation);
 
         //recursively call toJson for superclass if presented
         if (this.superclass != null) {
-            indentation = indentation.replaceFirst("\t", "");
-            sb.append("\n").append(indentation).append("}");
-            sb.append("," + "\n");
+            sb.append("," + NEW_LINE);
             sb.append(this.superclass.toJson(indentation, fielddata, false));
-        } else {
-            indentation = indentation.replaceFirst("\t", "");
-            sb.append("\n").append(indentation).append("}");
-        }
+        } 
 
         return sb.toString();
     }
 
+    /**
+     * Removes the indentation, inserts new line and closing curly brackets in sb
+     * Does this sequence twice for closing the classdesc toJson
+     * 
+     * @param sb            StringBuffer where the closing sequence will be appended
+     * @param indentation   Indentation to be changed
+     */
+    private void closingJsonSeq(StringBuffer sb, String indentation)
+    {
+        indentation = indentation.replaceFirst(INDENT, "");
+        sb.append(NEW_LINE).append(indentation).append("}");
+
+        indentation = indentation.replaceFirst(INDENT, "");
+        sb.append(NEW_LINE).append(indentation).append("}");
+    }
+
     /**
      * Appends the extends clausule to the input StringBuffer.
      * Only if superclass presented
diff --git a/project/Deserializer/src/jdeserialize/content.java b/project/Deserializer/src/jdeserialize/content.java
index 1e51ef4..e917161 100644
--- a/project/Deserializer/src/jdeserialize/content.java
+++ b/project/Deserializer/src/jdeserialize/content.java
@@ -1,6 +1,5 @@
 package jdeserialize;
 
-import java.util.HashMap;
 import java.util.Map;
 
 /**
@@ -16,6 +15,10 @@ import java.util.Map;
  * </p>
  */
 public interface content {
+    //constants for toJson methods
+    public static final String INDENT = "\t";
+    public static final String NEW_LINE = "\n";
+
     /**
      * @return the type of instance represented by this object.
      */
@@ -73,13 +76,16 @@ public interface content {
      * <p>
      * Analogy for toString method; however, outputs its string in json formatting.
      * Returns the exact json representation of object with indentation.
-     * 
+     * </p>
      * <p>
      * Inherited by multiple classes via contentbase, often calls itself for another object
-     * 
+     * </p>
      * @param indentation   starting indentation for json output
      * @param fielddata     used when calling this method for inner instances 
-     *                      so the instance has info about its variables
+     *                      so the instance has info about its variables. 
+     *                      Instance info is saved in another content space than
+     *                      info about its field variables, so it must be provided by parameter
+     *                      to inner instances
      * @param child         tells that the instance is child of another because of indentation
      * @return              The string in json format representing this instance
      */
