Class ResourceRichText


  • @Model(adaptables=org.apache.sling.api.SlingHttpServletRequest.class)
    public class ResourceRichText
    extends java.lang.Object
    Generic resource-based model for rendering formatted rich text.

    Optional use parameters when referencing model from Sightly template:

    • propertyName: Property name in which the text is stored in the resource
    • isRichText: Set to false if text to format is plain text.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      @Nullable java.lang.String getMarkup()
      Returns the formatted text as XHTML markup.
      boolean isValid()
      Returns true if rich text is present and valid.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ResourceRichText

        public ResourceRichText()
    • Method Detail

      • isValid

        public boolean isValid()
        Returns true if rich text is present and valid.
        Returns:
        Rich text is valid
      • getMarkup

        @Nullable
        public @Nullable java.lang.String getMarkup()
        Returns the formatted text as XHTML markup.
        Returns:
        Rich text markup