java.lang.Object
org.apache.velocity.runtime.directive.Directive
org.apache.velocity.runtime.directive.Stop
All Implemented Interfaces:
Cloneable, DirectiveConstants

public class Stop extends Directive
This class implements the #stop directive which allows a user to stop the merging and rendering process. The #stop directive will accept a single message argument with info about the reason for stopping.
  • Constructor Details

    • Stop

      public Stop()
  • Method Details

    • getName

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

      public int getType()
      Return type of this directive.
      Specified by:
      getType in class Directive
      Returns:
      The type of this directive.
    • isScopeProvided

      public boolean isScopeProvided()
      Since there is no processing of content, there is never a need for an internal scope.
      Overrides:
      isScopeProvided in class Directive
      Returns:
      true if there will be a scope control injected into the context when rendering this directive.
    • init

      public void init(RuntimeServices rs, InternalContextAdapter context, Node node)
      Description copied from class: Directive
      How this directive is to be initialized.
      Overrides:
      init in class Directive
      Parameters:
      rs -
      context -
      node -
    • render

      public boolean render(InternalContextAdapter context, Writer writer, Node node)
      Description copied from class: Directive
      How this directive is to be rendered
      Specified by:
      render in class Directive
      Parameters:
      context -
      writer -
      node -
      Returns:
      True if the directive rendered successfully.
    • checkArgs

      public void checkArgs(ArrayList<Integer> argtypes, Token t, String templateName) throws ParseException
      Called by the parser to check 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