no.sesat.search.view.velocity
Class XPathDirective
java.lang.Object
org.apache.velocity.runtime.directive.Directive
no.sesat.search.view.velocity.AbstractDirective
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:
- optional variable to assign result to
- the expression
- org.w3c.dom.Node to apply expression to (default is value of "document" from cxt)
| Fields inherited from class org.apache.velocity.runtime.directive.Directive |
rsvc |
| Fields inherited from interface org.apache.velocity.runtime.directive.DirectiveConstants |
BLOCK, LINE |
|
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 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 |
XPathDirective
public XPathDirective()
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:
- optional target variable
- the expression
- optional if target variable was not supplied org.w3c.dom.Node to apply expression to (default is value of
"document" from cxt)
- 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.