Class Define

  • All Implemented Interfaces:
    java.lang.Cloneable, DirectiveConstants

    public class Define
    extends Block
    Directive that puts an unrendered AST block in the context under the specified key, postponing rendering until the reference is used and rendered.
    Version:
    $Id: Define.java 686842 2008-08-18 18:29:31Z nbubna $
    Author:
    Andrew Tetlaw, Nathan Bubna
    • Constructor Detail

      • Define

        public Define()
    • Method Detail

      • getName

        public java.lang.String getName()
        Return name of this directive.
        Specified by:
        getName in class Directive
        Returns:
        The name of this directive.
      • render

        public boolean render​(InternalContextAdapter context,
                              java.io.Writer writer,
                              Node node)
        directive.render() simply makes an instance of the Block inner class and places it into the context as indicated.
        Specified by:
        render in class Directive
        Returns:
        True if the directive rendered successfully.
      • checkArgs

        public void checkArgs​(java.util.ArrayList<java.lang.Integer> argtypes,
                              Token t,
                              java.lang.String templateName)
                       throws ParseException
        Called by the parser to validate the argument types
        Overrides:
        checkArgs in class Directive
        Parameters:
        argtypes - type, Array of argument types of each argument to the directive for example StandardParserTreeConstants.JJTWORD
        t - token of directive
        templateName - the name of the template this directive is referenced in.
        Throws:
        ParseException