Class RenderUnit

  • All Implemented Interfaces:
    Record<RenderUnit>

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

      Nested Classes 
      Modifier and Type Class Description
      protected static class  RenderUnit.FluentMap  
    • Constructor Summary

      Constructors 
      Constructor Description
      RenderUnit()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addSubTemplate​(java.lang.String name, RenderUnit renderUnit)  
      protected void callUnit​(java.io.PrintWriter out, RenderContext renderContext, java.lang.Object templateObj, java.lang.Object argsObj)  
      RenderUnit getProperty​(java.lang.String name)
      Gets the value of a specified property.
      java.util.Set<java.lang.String> getPropertyNames()
      Gets the set of names for this record's properties.
      protected RenderUnit.FluentMap obj()  
      protected abstract void render​(java.io.PrintWriter out, javax.script.Bindings bindings, javax.script.Bindings arguments, RenderContext renderContext)  
      void render​(java.io.PrintWriter out, RenderContext renderContext, javax.script.Bindings arguments)
      Render the main script template
      • Methods inherited from class java.lang.Object

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

      • RenderUnit

        public RenderUnit()
    • Method Detail

      • render

        public final void render​(java.io.PrintWriter out,
                                 RenderContext renderContext,
                                 javax.script.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​(java.lang.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 java.util.Set<java.lang.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​(java.io.PrintWriter out,
                                       javax.script.Bindings bindings,
                                       javax.script.Bindings arguments,
                                       RenderContext renderContext)
      • callUnit

        protected void callUnit​(java.io.PrintWriter out,
                                RenderContext renderContext,
                                java.lang.Object templateObj,
                                java.lang.Object argsObj)
      • addSubTemplate

        protected final void addSubTemplate​(java.lang.String name,
                                            RenderUnit renderUnit)