@ProviderType public final class RichTextUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
addParsedText(org.jdom2.Element parent,
String text)
Parses XHTML text string, and adds to parsed content to the given parent element.
|
static void |
addParsedText(org.jdom2.Element parent,
String text,
boolean xhtmlEntities)
Parses XHTML text string, and adds to parsed content to the given parent element.
|
static boolean |
isEmpty(String text)
Check if the given formatted text block is empty.
|
static boolean |
isEmpty(String text,
int treshold)
Check if the given formatted text block is empty.
|
static org.jdom2.Element |
parseText(String text)
Parses XHTML text string.
|
static org.jdom2.Element |
parseText(String text,
boolean xhtmlEntities)
Parses XHTML text string.
|
static void |
rewriteContent(org.jdom2.Element parent,
RewriteContentHandler rewriteContentHandler)
Rewrites all children/sub-tree of the given parent element.
|
public static boolean isEmpty(String text)
text - XHTML text string (root element not needed)public static boolean isEmpty(String text, int treshold)
text - XHTML text string (root element not needed)treshold - Treshold value - only strings with less than this number of characters are checked.public static void addParsedText(org.jdom2.Element parent,
String text)
throws org.jdom2.JDOMException
parent - Parent element to add parsed content totext - XHTML text string (root element not needed)org.jdom2.JDOMException - Is thrown if the text could not be parsed as XHTMLpublic static void addParsedText(org.jdom2.Element parent,
String text,
boolean xhtmlEntities)
throws org.jdom2.JDOMException
parent - Parent element to add parsed content totext - XHTML text string (root element not needed)xhtmlEntities - If set to true, Resolving of XHtml entities in XHtml fragment is supported.org.jdom2.JDOMException - Is thrown if the text could not be parsed as XHTMLpublic static org.jdom2.Element parseText(String text) throws org.jdom2.JDOMException
text - XHTML text string (root element not needed)org.jdom2.JDOMException - Is thrown if the text could not be parsed as XHTMLpublic static org.jdom2.Element parseText(String text, boolean xhtmlEntities) throws org.jdom2.JDOMException
text - XHTML text string (root element not needed)xhtmlEntities - If set to true, Resolving of XHtml entities in XHtml fragment is supported.org.jdom2.JDOMException - Is thrown if the text could not be parsed as XHTMLpublic static void rewriteContent(org.jdom2.Element parent,
RewriteContentHandler rewriteContentHandler)
parent - Parent elementrewriteContentHandler - Rewrite content handlerCopyright © 2014–2017 wcm.io. All rights reserved.