org.jaxen.function
Class BooleanFunction

java.lang.Object
  extended by org.jaxen.function.BooleanFunction
All Implemented Interfaces:
Function

public class BooleanFunction
extends Object
implements Function

4.3 boolean boolean(object)

The boolean function converts its argument to a boolean as follows:

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

Constructor Summary
BooleanFunction()
          Create a new BooleanFunction object.
 
Method Summary
 Object call(Context context, List args)
          Convert the argument to a Boolean
static Boolean evaluate(Object obj, Navigator nav)
          Convert the argument obj to a Boolean according to the following rules:
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BooleanFunction

public BooleanFunction()
Create a new BooleanFunction object.

Method Detail

call

public Object call(Context context,
                   List args)
            throws FunctionCallException
Convert the argument to a Boolean

Specified by:
call in interface Function
Parameters:
context - the context at the point in the expression when the function is called
args - a list with exactly one item which will be converted to a Boolean
Returns:
the result of evaluating the function; Boolean.TRUE or Boolean.FALSE
Throws:
FunctionCallException - if args has more or less than one item

evaluate

public static Boolean evaluate(Object obj,
                               Navigator nav)

Convert the argument obj to a Boolean according to the following rules:

Parameters:
obj - the object to convert to a boolean
nav - ignored
Returns:
Boolean.TRUE or Boolean.FALSE


Copyright © 2001-2008 Codehaus. All Rights Reserved.