public final class DOM4JUtils extends Object
Element,
QName| Modifier and Type | Method and Description |
|---|---|
static void |
addAriaAttribute(org.dom4j.Element element,
String name,
String value)
Add ARIA attribute to an existing DOM element.
|
static void |
addAttribute(org.dom4j.Element element,
String name,
String value)
Add attribute to an existing DOM element.
|
static void |
addDataAttribute(org.dom4j.Element element,
String name,
String value)
Add data attribute to an existing DOM element.
|
static void |
addGlyphiconText(org.dom4j.Element element,
String glyphicon,
String text)
Add glyphicon and text to an existing DOM element.
|
static void |
addText(org.dom4j.Element element,
String text)
Add text to an existing DOM element.
|
static void |
addTooltip(org.dom4j.Element element,
String title)
Add tooltip to DOM element.
|
static org.dom4j.Element |
generateDivElement(String htmlClass)
Generate HTML "div" DOM element.
|
static org.dom4j.Element |
generateDivElement(String htmlClass,
AccessibilityRoles role)
Generate HTML "div" DOM element.
|
static org.dom4j.Element |
generateElement(String name,
String htmlClass,
String text)
Generate DOM element.
|
static org.dom4j.Element |
generateElement(String name,
String htmlClass,
String text,
String glyphicon,
AccessibilityRoles role)
Generate DOM element.
|
static org.dom4j.Element |
generateLinkElement(String href,
String target,
String onclick,
String htmlClass,
String text)
Generate HTML "a" link DOM element.
|
static org.dom4j.Element |
generateLinkElement(String href,
String target,
String onclick,
String htmlClass,
String text,
String glyphicon)
Generate HTML "a" link DOM element.
|
static org.dom4j.Element |
generateLinkElement(String href,
String target,
String onclick,
String htmlClass,
String text,
String glyphicon,
AccessibilityRoles role)
Generate HTML "a" link DOM element.
|
static String |
write(org.dom4j.Element element)
Write HTML content.
|
static void |
write(Writer writer,
org.dom4j.Element element)
Write HTML content in provided writer.
|
static String |
writeCompact(org.dom4j.Element element)
Write compact HTML content.
|
public static org.dom4j.Element generateElement(String name, String htmlClass, String text, String glyphicon, AccessibilityRoles role)
name - DOM element namehtmlClass - HTML class, may be nulltext - DOM element inner text, may be nullglyphicon - glyphicon name, may be nullrole - accessibility role, may be nullpublic static org.dom4j.Element generateElement(String name, String htmlClass, String text)
name - DOM element namehtmlClass - HTML class, may be nulltext - DOM element inner text, may be nullpublic static org.dom4j.Element generateDivElement(String htmlClass, AccessibilityRoles role)
htmlClass - HTML class, may be nullrole - accessibility role, may be nullpublic static org.dom4j.Element generateDivElement(String htmlClass)
htmlClass - HTML class, may be nullpublic static org.dom4j.Element generateLinkElement(String href, String target, String onclick, String htmlClass, String text, String glyphicon, AccessibilityRoles role)
href - link URLtarget - link target, may be nullonclick - link onclick action, may be nullhtmlClass - HTML class, may be nulltext - link inner textglyphicon - glyphicon name, may be nullrole - accessibility role, may be nullpublic static org.dom4j.Element generateLinkElement(String href, String target, String onclick, String htmlClass, String text, String glyphicon)
href - link URLtarget - link target, may be nullonclick - link onclick action, may be nullhtmlClass - HTML class, may be nulltext - link inner textglyphicon - glyphicon name, may be nullpublic static org.dom4j.Element generateLinkElement(String href, String target, String onclick, String htmlClass, String text)
href - link URLtarget - link target, may be nullonclick - link onclick action, may be nullhtmlClass - HTML class, may be nulltext - link inner textpublic static void addAttribute(org.dom4j.Element element,
String name,
String value)
element - DOM elementname - attribute namevalue - attribute valuepublic static void addDataAttribute(org.dom4j.Element element,
String name,
String value)
element - DOM elementname - data attribute namevalue - data attribute valuepublic static void addAriaAttribute(org.dom4j.Element element,
String name,
String value)
element - DOM elementname - ARIA attribute namevalue - ARIA attribute valuepublic static void addText(org.dom4j.Element element,
String text)
element - DOM elementtext - element inner textpublic static void addGlyphiconText(org.dom4j.Element element,
String glyphicon,
String text)
element - DOM elementglyphicon - glyphicon name, may be nulltext - DOM element inner textpublic static void addTooltip(org.dom4j.Element element,
String title)
element - DOM elementtitle - tooltip titlepublic static String write(org.dom4j.Element element)
element - DOM elementpublic static String writeCompact(org.dom4j.Element element)
element - DOM elementpublic static void write(Writer writer, org.dom4j.Element element)
writer - writerelement - DOM elementCopyright © 2021. All rights reserved.