org.springframework.extensions.webscripts
Class ArgReplaceMethod

java.lang.Object
  extended by org.springframework.extensions.webscripts.ArgReplaceMethod
All Implemented Interfaces:
freemarker.template.TemplateMethodModel, freemarker.template.TemplateMethodModelEx, freemarker.template.TemplateModel

public final class ArgReplaceMethod
extends Object
implements freemarker.template.TemplateMethodModelEx

Custom FreeMarker Template language method.

Given a URL string and N named/value pairs, replace each URL argument with respective name/value pair (if name matches existing URL argument), or add name/value pair to URL (if name does not match existing URL argument).

Usage: argreplace(url.args, "skipCount", cursor.nextPage, ...) Example: argreplace("?a=0&b=2", "a", 1, "c", 3) returns "?a=1&b=2&c=3"

Author:
davidc

Field Summary
 
Fields inherited from interface freemarker.template.TemplateModel
NOTHING
 
Constructor Summary
ArgReplaceMethod()
           
 
Method Summary
 Object exec(List args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArgReplaceMethod

public ArgReplaceMethod()
Method Detail

exec

public Object exec(List args)
            throws freemarker.template.TemplateModelException
Specified by:
exec in interface freemarker.template.TemplateMethodModel
Throws:
freemarker.template.TemplateModelException
See Also:
TemplateMethodModel.exec(java.util.List)


Copyright © 2009 SpringSource, Inc. All Rights Reserved.