Class RenderUnit

java.lang.Object
org.apache.sling.scripting.sightly.render.RenderUnit
All Implemented Interfaces:
Record<RenderUnit>

public abstract class RenderUnit extends Object implements Record<RenderUnit>
Basic unit of rendering. This also extends the record interface. The properties for a unit are the sub-units.
  • Constructor Details

    • RenderUnit

      public RenderUnit()
  • Method Details

    • render

      public final void render(PrintWriter out, RenderContext renderContext, Bindings arguments)
      Render the main script template
      Parameters:
      out - the PrintWriter to which the commands are written
      renderContext - the rendering context
      arguments - the arguments for this unit
    • getProperty

      public RenderUnit getProperty(String name)
      Description copied from interface: Record
      Gets the value of a specified property.
      Specified by:
      getProperty in interface Record<RenderUnit>
      Parameters:
      name - the name of the property
      Returns:
      the value of the property or null if this record does not have the specified property
    • getPropertyNames

      public Set<String> getPropertyNames()
      Description copied from interface: Record
      Gets the set of names for this record's properties.
      Specified by:
      getPropertyNames in interface Record<RenderUnit>
      Returns:
      this record's properties' names
    • render

      protected abstract void render(PrintWriter out, Bindings bindings, Bindings arguments, RenderContext renderContext)
    • callUnit

      protected void callUnit(PrintWriter out, RenderContext renderContext, Object templateObj, Object argsObj)
    • obj

      protected RenderUnit.FluentMap obj()
    • addSubTemplate

      protected final void addSubTemplate(String name, RenderUnit renderUnit)