Class Block

  • All Implemented Interfaces:
    java.lang.Cloneable, DirectiveConstants
    Direct Known Subclasses:
    BlockMacro, Define

    public abstract class Block
    extends Directive
    Directive that puts an unrendered AST block in the context under the specified key, postponing rendering until the reference is used and rendered.
    Since:
    1.7
    Version:
    $Id: Block.java 686842 2008-08-18 18:29:31Z nbubna $
    • Field Detail

      • block

        protected Node block
      • log

        protected org.slf4j.Logger log
      • maxDepth

        protected int maxDepth
      • key

        protected java.lang.String key
    • Constructor Detail

      • Block

        public Block()
    • Method Detail

      • getType

        public int getType()
        Return type of this directive.
        Specified by:
        getType in class Directive
        Returns:
        type, DirectiveConstants.BLOCK or DirectiveConstants.LINE
      • render

        public boolean render​(InternalContextAdapter context,
                              java.io.Writer writer)
        renders block directive
        Parameters:
        context -
        writer -
        Returns:
        success status
      • id

        protected java.lang.String id​(InternalContextAdapter context)
        Creates a string identifying the source and location of the block definition, and the current template being rendered if that is different.
        Parameters:
        context -
        Returns:
        id string