All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.morher.ui.connect.html.HtmlApplicationUtils Maven / Gradle / Ivy

There is a newer version: 0.8
Show newest version
package net.morher.ui.connect.html;

import com.gargoylesoftware.htmlunit.html.HtmlElement;
import net.morher.ui.connect.api.ApplicationUtils;
import net.morher.ui.connect.api.element.Element;

public class HtmlApplicationUtils {

    public static HtmlElement getHtmlElement(Element element) {
        Object htmlElement = ApplicationUtils.getHtmlElement(element);
        if (htmlElement instanceof HtmlElementContext) {
            return ((HtmlElementContext) htmlElement).getElement();
        }
        throw new IllegalArgumentException("Not an HtmlElement");
    }

    public static String getHtml(Element element) {
        HtmlElement htmlElement = getHtmlElement(element);
        return htmlElement.asXml();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy