♻️ Move output generation to state
[rhynodge.git] / src / main / java / net / pterodactylus / rhynodge / states / HtmlState.java
index 64ac8a5..83cd36d 100644 (file)
@@ -17,6 +17,9 @@
 
 package net.pterodactylus.rhynodge.states;
 
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
 import net.pterodactylus.rhynodge.State;
 
 import org.jsoup.nodes.Document;
@@ -51,6 +54,11 @@ public class HtmlState extends AbstractState {
        // ACCESSORS
        //
 
+       @Override
+       public boolean isEmpty() {
+               return false;
+       }
+
        /**
         * Returns the URI of the parsed document.
         *
@@ -69,6 +77,19 @@ public class HtmlState extends AbstractState {
                return document;
        }
 
+       @Nonnull
+       @Override
+       protected String plainText() {
+               //noinspection ConstantConditions
+               return htmlText();
+       }
+
+       @Nullable
+       @Override
+       protected String htmlText() {
+               return document.toString();
+       }
+
        //
        // OBJECT METHODS
        //