Transférer les fichiers vers 'src/JsonInspector'

This commit is contained in:
Romain BESSON 2023-01-14 18:37:22 +01:00
parent c662c089db
commit 777b590f30
2 changed files with 36 additions and 0 deletions

View File

@ -1,5 +1,6 @@
package JsonInspector; package JsonInspector;
import java.awt.*;
import java.util.ArrayList; 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 @Override
public String toString() { public String toString() {
String string = name + " : "; String string = name + " : ";

View File

@ -6,6 +6,8 @@ public class Parameters {
public static final Font FILE_FONT = new Font(Font.SANS_SERIF, Font.PLAIN, 18); public static final Font FILE_FONT = new Font(Font.SANS_SERIF, Font.PLAIN, 18);
public static final String IHM_INDENTATION = " "; public static final String IHM_INDENTATION = " ";
public static final String CONSOLE_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 IHM_COLOR = new Color(70, 70, 70);
public static final Color KEY_COLOR = new Color(70, 189, 204); public static final Color KEY_COLOR = new Color(70, 189, 204);