org.resthub.web.springmvc.view.velocity
Class RouteDirective

java.lang.Object
  extended by org.apache.velocity.runtime.directive.Directive
      extended by org.resthub.web.springmvc.view.velocity.RouteDirective
All Implemented Interfaces:
Cloneable, org.apache.velocity.runtime.directive.DirectiveConstants

public class RouteDirective
extends org.apache.velocity.runtime.directive.Directive

#route directive for the Velocity engine. Computes an URL given a Controller.action(argName:'argValue',...) argument. Examples:

Author:
Brian Clozel
See Also:
Router

Field Summary
 
Fields inherited from class org.apache.velocity.runtime.directive.Directive
rsvc
 
Fields inherited from interface org.apache.velocity.runtime.directive.DirectiveConstants
BLOCK, LINE
 
Constructor Summary
RouteDirective()
           
 
Method Summary
 String getName()
          Name of the Velocity directive to be called from the .vm views #route
 int getType()
          This directive is a "LINE directive", meaning it has to be written on a single line.
 boolean render(org.apache.velocity.context.InternalContextAdapter context, Writer writer, org.apache.velocity.runtime.parser.node.Node node)
          Renders the directive
 
Methods inherited from class org.apache.velocity.runtime.directive.Directive
getColumn, getLine, getScopeName, getTemplateName, init, isScopeProvided, makeScope, postRender, preRender, setLocation, setLocation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RouteDirective

public RouteDirective()
Method Detail

getName

public String getName()
Name of the Velocity directive to be called from the .vm views #route

Specified by:
getName in class org.apache.velocity.runtime.directive.Directive

getType

public int getType()
This directive is a "LINE directive", meaning it has to be written on a single line.

Specified by:
getType in class org.apache.velocity.runtime.directive.Directive
Returns:
org.apache.velocity.runtime.directive.DirectiveConstants.LINE

render

public boolean render(org.apache.velocity.context.InternalContextAdapter context,
                      Writer writer,
                      org.apache.velocity.runtime.parser.node.Node node)
               throws IOException,
                      org.apache.velocity.exception.ResourceNotFoundException,
                      org.apache.velocity.exception.ParseErrorException,
                      org.apache.velocity.exception.MethodInvocationException
Renders the directive

Specified by:
render in class org.apache.velocity.runtime.directive.Directive
Parameters:
context - velocity context
writer - used for writing directive result in the view
node - body of the directive (params, content)
Returns:
true if the directive rendered ok.
Throws:
IOException
org.apache.velocity.exception.ResourceNotFoundException
org.apache.velocity.exception.ParseErrorException
org.apache.velocity.exception.MethodInvocationException


Copyright © 2010-2012. All Rights Reserved.