org.jaxen.function
Class StringFunction

java.lang.Object
  extended byorg.jaxen.function.StringFunction
All Implemented Interfaces:
Function

public class StringFunction
extends java.lang.Object
implements Function

4.2 string string(object)

The string function converts an object to a string as follows:

If the argument is omitted, it defaults to a node-set with the context node as its only member.

Author:
bob mcwhirter (bob @ werken.com)
See Also:
Section 4.2 of the XPath Specification

Constructor Summary
StringFunction()
          Create a new StringFunction object.
 
Method Summary
 java.lang.Object call(Context context, java.util.List args)
          Returns the string-value of args.get(0) or of the context node if ,code>args is empty.
static java.lang.String evaluate(java.lang.Object obj, Navigator nav)
          Returns the string-value of obj.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringFunction

public StringFunction()
Create a new StringFunction object.

Method Detail

call

public java.lang.Object call(Context context,
                             java.util.List args)
                      throws FunctionCallException
Returns the string-value of args.get(0) or of the context node if ,code>args is empty.

Specified by:
call in interface Function
Parameters:
context - the context at the point in the expression where the function is called
args - list with zero or one element
Returns:
a String
Throws:
FunctionCallException - if args has more than one item

evaluate

public static java.lang.String evaluate(java.lang.Object obj,
                                        Navigator nav)
Returns the string-value of obj.

Parameters:
obj - the object whose string-value is calculated
nav - the navigator used to calculate the string-value
Returns:
a String. May be empty but is never null.


Copyright © 2001-2005 Codehaus. All Rights Reserved.