aboutsummaryrefslogtreecommitdiff
path: root/src/main/model/html/ElementNode.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/model/html/ElementNode.java')
-rw-r--r--src/main/model/html/ElementNode.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main/model/html/ElementNode.java b/src/main/model/html/ElementNode.java
index 16438f9..5ff4a0f 100644
--- a/src/main/model/html/ElementNode.java
+++ b/src/main/model/html/ElementNode.java
@@ -2,6 +2,8 @@ package model.html;
import model.util.Node;
import org.javatuples.Pair;
+import org.json.JSONObject;
+import persistance.JsonAble;
import java.util.ArrayList;
import java.util.Optional;
@@ -9,7 +11,7 @@ import java.util.Optional;
/**
* This ElementNode class represents an HTML tag and nested tags.
*/
-public class ElementNode implements Node {
+public class ElementNode implements Node, JsonAble {
private String tag;
private ArrayList<Pair<String,String>> attributes;
@@ -67,4 +69,9 @@ public class ElementNode implements Node {
public String getData() {
return getTag() + " " + getAttributes().toString();
}
+
+ @Override
+ public JSONObject serialize() {
+ return new JSONObject(this);
+ }
}