net.morher.ui.connect.html.HtmlApplicationUtils Maven / Gradle / Ivy
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