Class Break
java.lang.Object
org.apache.velocity.runtime.directive.Directive
org.apache.velocity.runtime.directive.Break
- All Implemented Interfaces:
Cloneable,DirectiveConstants
Break directive used for interrupting scopes.
- Version:
- $Id$
- Author:
- Jarkko Viinamaki, Nathan Bubna
-
Field Summary
Fields inherited from interface org.apache.velocity.runtime.directive.DirectiveConstants
BLOCK, LINE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled by the parser to validate the argument typesgetName()Return name of this directive.intgetType()Return type of this directive.voidinit(RuntimeServices rs, InternalContextAdapter context, Node node) How this directive is to be initialized.booleanSince there is no processing of content, there is never a need for an internal scope.booleanrender(InternalContextAdapter context, Writer writer, Node node) This directive throws a StopCommand which signals either the nearest Scope or the specified scope to stop rendering its content.Methods inherited from class org.apache.velocity.runtime.directive.Directive
getColumn, getLine, getScopeName, getTemplate, getTemplateName, makeScope, postRender, preRender, setLocation, setLocation
-
Constructor Details
-
Break
public Break()
-
-
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:
isScopeProvidedin classDirective- Returns:
- true if there will be a scope control injected into the context when rendering this directive.
-
init
Description copied from class:DirectiveHow this directive is to be initialized. -
render
This directive throws a StopCommand which signals either the nearest Scope or the specified scope to stop rendering its content. -
checkArgs
public void checkArgs(ArrayList<Integer> argtypes, Token t, String templateName) throws ParseException Called by the parser to validate the argument types- Overrides:
checkArgsin 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
-