no.sesat.search.view.velocity
Class XPathDirective

java.lang.Object
  extended by org.apache.velocity.runtime.directive.Directive
      extended by no.sesat.search.view.velocity.AbstractDirective
          extended by no.sesat.search.view.velocity.XPathDirective
All Implemented Interfaces:
Cloneable, org.apache.velocity.runtime.directive.DirectiveConstants

public final class XPathDirective
extends AbstractDirective

Evaluates xpath expression and writes the result as a string. Expects the following velocity parameters:


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
XPathDirective()
           
 
Method Summary
 String getName()
          
 int getType()
          
 void init(org.apache.velocity.runtime.RuntimeServices runtimeServices, org.apache.velocity.context.InternalContextAdapter context, org.apache.velocity.runtime.parser.node.Node node)
           
 boolean render(org.apache.velocity.context.InternalContextAdapter cxt, Writer writer, org.apache.velocity.runtime.parser.node.Node node)
          Evaluates xpath expression and writes the result as a string.
 
Methods inherited from class no.sesat.search.view.velocity.AbstractDirective
getArgument, getDataModel, getObjectArgument
 
Methods inherited from class org.apache.velocity.runtime.directive.Directive
getColumn, getLine, setLocation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XPathDirective

public XPathDirective()
Method Detail

init

public void init(org.apache.velocity.runtime.RuntimeServices runtimeServices,
                 org.apache.velocity.context.InternalContextAdapter context,
                 org.apache.velocity.runtime.parser.node.Node node)
          throws org.apache.velocity.exception.TemplateInitException
Overrides:
init in class org.apache.velocity.runtime.directive.Directive
Throws:
org.apache.velocity.exception.TemplateInitException

getName

public String getName()

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

getType

public int getType()

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

render

public boolean render(org.apache.velocity.context.InternalContextAdapter cxt,
                      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
Evaluates xpath expression and writes the result as a string. Expects the following velocity parameters:

Specified by:
render in class org.apache.velocity.runtime.directive.Directive
Parameters:
cxt - The cxt.
writer - The writer.
node - The node.
Returns:
return true on success.
Throws:
IOException
org.apache.velocity.exception.ResourceNotFoundException
org.apache.velocity.exception.ParseErrorException
org.apache.velocity.exception.MethodInvocationException


Copyright © 2005-2009 Schibsted ASA. All Rights Reserved.