Class Stop
java.lang.Object
org.apache.velocity.runtime.directive.Directive
org.apache.velocity.runtime.directive.Stop
- All Implemented Interfaces:
Cloneable
,DirectiveConstants
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.
-
Field Summary
Fields inherited from interface org.apache.velocity.runtime.directive.DirectiveConstants
BLOCK, LINE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Called by the parser to check the argument typesgetName()
Return name of this directive.int
getType()
Return type of this directive.void
init
(RuntimeServices rs, InternalContextAdapter context, Node node) How this directive is to be initialized.boolean
Since there is no processing of content, there is never a need for an internal scope.boolean
render
(InternalContextAdapter context, Writer writer, Node node) How this directive is to be renderedMethods inherited from class org.apache.velocity.runtime.directive.Directive
getColumn, getLine, getScopeName, getTemplate, getTemplateName, makeScope, postRender, preRender, setLocation, setLocation
-
Constructor Details
-
Stop
public Stop()
-
-
Method Details
-
getName
Return name of this directive. -
getType
public int getType()Return 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 classDirective
- Returns:
- true if there will be a scope control injected into the context when rendering this directive.
-
init
Description copied from class:Directive
How this directive is to be initialized. -
render
Description copied from class:Directive
How this directive is to be rendered -
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 classDirective
- Parameters:
argtypes
- type, Array of argument types of each argument to the directive for example StandardParserTreeConstants.JJTWORDt
- token of directivetemplateName
- the name of the template this directive is referenced in.- Throws:
ParseException
-