diff --git a/src/JsonInspector/Node.java b/src/JsonInspector/Node.java index 8c71554..7f89e64 100644 --- a/src/JsonInspector/Node.java +++ b/src/JsonInspector/Node.java @@ -1,5 +1,6 @@ package JsonInspector; +import java.awt.*; import java.util.ArrayList; @@ -44,6 +45,39 @@ public class Node { } + public boolean isObject() { + return type == Type.OBJECT; + } + + + public boolean isArray() { + return type == Type.ARRAY; + } + + + public boolean isElement() { + return type == Type.ELEMENT; + } + + + public boolean isPair() { + return type == Type.PAIR; + } + + + public boolean isArrayObjectElement() { + boolean array = type == Type.ARRAY; + boolean object = type == Type.OBJECT; + boolean element = type == Type.ELEMENT; + + if (array || object || element) { + return true; + } + + return false; + } + + @Override public String toString() { String string = name + " : "; diff --git a/src/JsonInspector/Parameters.java b/src/JsonInspector/Parameters.java index 786e7a1..0f07e10 100644 --- a/src/JsonInspector/Parameters.java +++ b/src/JsonInspector/Parameters.java @@ -6,6 +6,8 @@ public class Parameters { public static final Font FILE_FONT = new Font(Font.SANS_SERIF, Font.PLAIN, 18); public static final String IHM_INDENTATION = " "; public static final String CONSOLE_INDENTATION = " "; + public static final String ARRAY_CLOSING = "...]"; + public static final String OBJECT_ELEMENT_CLOSING = "...}"; public static final Color IHM_COLOR = new Color(70, 70, 70); public static final Color KEY_COLOR = new Color(70, 189, 204);