Class TemplateEngine.Block

  • Enclosing class:
    TemplateEngine

    static final class TemplateEngine.Block
    extends java.lang.Object
    Abstract the source fragments, verbatim or immediate typed text blocks.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String body
      The actual content.
      private int line
      The block start line info.
      private TemplateEngine.BlockType type
      The type of block, verbatim or directive.
    • Constructor Summary

      Constructors 
      Constructor Description
      Block​(TemplateEngine.BlockType theType, int theLine, java.lang.String theBlock)
      Creates a new block.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) java.lang.String getBody()  
      (package private) int getLine()  
      (package private) TemplateEngine.BlockType getType()  
      protected void toString​(java.lang.StringBuilder strb, java.lang.String prefix)
      Appends this block string representation to a builder.
      • Methods inherited from class java.lang.Object

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

      • line

        private final int line
        The block start line info.
      • body

        private final java.lang.String body
        The actual content.
    • Constructor Detail

      • Block

        Block​(TemplateEngine.BlockType theType,
              int theLine,
              java.lang.String theBlock)
        Creates a new block.
        Parameters:
        theType - the block type
        theLine - the line number
        theBlock - the content
    • Method Detail

      • getBody

        java.lang.String getBody()
        Returns:
        body
      • getLine

        int getLine()
        Returns:
        line
      • toString

        protected void toString​(java.lang.StringBuilder strb,
                                java.lang.String prefix)
        Appends this block string representation to a builder.
        Parameters:
        strb - the string builder to append to
        prefix - the line prefix (immediate or deferred)