Webiyo

This page was generated using Webiyo. See its source code and unit tests.

org/webiyo/web/HtmlText.java

package org.webiyo.web;

import org.w3c.dom.Element;
import org.webiyo.xml.Xml;
import org.webiyo.xml.XmlWriter;

import java.io.IOException;

public class HtmlText implements Renderable {

    private final Element text;

    public HtmlText(String content) throws IOException {
        this.text = Xml.parse(content).getDocumentElement();
    }


    public void render(HtmlWriter out) throws IOException {
        out.renderElement(text);
    }

    public String toXml() throws IOException {
        StringBuilder buf = new StringBuilder();
        XmlWriter out = new XmlWriter(buf);
        out.renderElement(text);
        return buf.toString();
    }
}
SourceForge