Package io.wcm.handler.richtext
Interface RichTextHandler
-
@ProviderType public interface RichTextHandlerManages XHTML rich text fragment formatting.The interface is implemented by a Sling Model. You can adapt from
SlingHttpServletRequestorResourceto get a context-specific handler instance.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NotNull RichTextBuilderget(String text)Build formatter text from given raw text string.@NotNull RichTextBuilderget(org.apache.sling.api.resource.Resource resource)Build formatted text from content resource using default property names.booleanisEmpty(String text)Check if the given formatted text block is empty.
-
-
-
Method Detail
-
get
@NotNull @NotNull RichTextBuilder get(org.apache.sling.api.resource.Resource resource)
Build formatted text from content resource using default property names.- Parameters:
resource- Resource- Returns:
- Rich text builder
-
get
@NotNull @NotNull RichTextBuilder get(String text)
Build formatter text from given raw text string.- Parameters:
text- Raw text- Returns:
- Rich text builder
-
isEmpty
boolean isEmpty(String text)
Check if the given formatted text block is empty. A text block containing only one paragraph element and whitespaces is considered as empty. A text block with more than 20 characters (raw data) is never considered as empty.- Parameters:
text- XHTML text string (root element not needed)- Returns:
- true if text block is empty
-
-