2.17.2: 2011-06-17

net.sf.basedb.util.jep.convert
Class IfConverter

java.lang.Object
  extended by net.sf.basedb.util.jep.convert.AbstractJepConversionFunction<Node>
      extended by net.sf.basedb.util.jep.convert.IfConverter
All Implemented Interfaces:
JepConversionFunction<Node>

public class IfConverter
extends AbstractJepConversionFunction<Node>

Convert If function to a Query API Expression.

Version:
2.4
Author:
nicklas
Last modified
$Date: 2008-09-11 22:08:14 +0200 (Thu, 11 Sep 2008) $

Constructor Summary
IfConverter()
           
 
Method Summary
 String getDescription()
          Get a short description of the function or operator
 String getName()
          Get the name of the function or the symbol of the operator
 boolean isFunction()
          If this converter is a built-in function.
 Expression toExpression(Node node)
          Convert to expression by calling Expressions.caseWhen(Expression, net.sf.basedb.core.query.WhenStatement[]).
 
Methods inherited from class net.sf.basedb.util.jep.convert.AbstractJepConversionFunction
isOperator, toRestriction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IfConverter

public IfConverter()
Method Detail

isFunction

public boolean isFunction()
Description copied from interface: JepConversionFunction
If this converter is a built-in function. Built-in functions are automatically put in the enumeration return by Jep.getFunctions().

Specified by:
isFunction in interface JepConversionFunction<Node>
Overrides:
isFunction in class AbstractJepConversionFunction<Node>
Returns:
Always FALSE

getName

public String getName()
Description copied from interface: JepConversionFunction
Get the name of the function or the symbol of the operator

Specified by:
getName in interface JepConversionFunction<Node>
Overrides:
getName in class AbstractJepConversionFunction<Node>
Returns:
The string 'if'

getDescription

public String getDescription()
Description copied from interface: JepConversionFunction
Get a short description of the function or operator

Specified by:
getDescription in interface JepConversionFunction<Node>
Overrides:
getDescription in class AbstractJepConversionFunction<Node>
Returns:
Always null

toExpression

public Expression toExpression(Node node)
Convert to expression by calling Expressions.caseWhen(Expression, net.sf.basedb.core.query.WhenStatement[]).

Specified by:
toExpression in interface JepConversionFunction<Node>
Overrides:
toExpression in class AbstractJepConversionFunction<Node>
Parameters:
node - The object to convert
Returns:
An expression or null

2.17.2: 2011-06-17