diff options
Diffstat (limited to 'src/main/model/html/TextNode.java')
-rw-r--r-- | src/main/model/html/TextNode.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main/model/html/TextNode.java b/src/main/model/html/TextNode.java index f6d3ce1..2e89326 100644 --- a/src/main/model/html/TextNode.java +++ b/src/main/model/html/TextNode.java @@ -1,11 +1,13 @@ package model.html; import model.util.Node; +import org.json.JSONObject; +import persistance.JsonAble; /** * This TextNode class represents raw text, with no nested tags. */ -public class TextNode implements Node { +public class TextNode implements Node, JsonAble { private String text = ""; /** @@ -24,4 +26,9 @@ public class TextNode implements Node { public String getData() { return getText(); } + + @Override + public JSONObject serialize() { + return new JSONObject(this); + } } |