org.firebirdsql.jdbc
Class FBEscapedFunctionHelper

java.lang.Object
  extended by org.firebirdsql.jdbc.FBEscapedFunctionHelper

public class FBEscapedFunctionHelper
extends java.lang.Object

Helper class for escaped functions.

Author:
Roman Rokytskyy

Constructor Summary
FBEscapedFunctionHelper()
           
 
Method Summary
static java.lang.String _char(java.lang.String[] params)
          Produce a function call for the char UDF function.
static java.lang.String abs(java.lang.String[] params)
          Produce a function call for the abs UDF function.
static java.lang.String acos(java.lang.String[] params)
          Produce a function call for the acos UDF function.
static java.lang.String ascii(java.lang.String[] params)
          Produce a function call for the ascii UDF function.
static java.lang.String asin(java.lang.String[] params)
          Produce a function call for the asin UDF function.
static java.lang.String atan(java.lang.String[] params)
          Produce a function call for the atan UDF function.
static java.lang.String atan2(java.lang.String[] params)
          Produce a function call for the atan2 UDF function.
static java.lang.String ceiling(java.lang.String[] params)
          Produce a function call for the ceiling UDF function.
static java.lang.String convertTemplate(java.lang.String functionCall, int mode)
          Convert escaped function call using function template.
static java.lang.String cos(java.lang.String[] params)
          Produce a function call for the cos UDF function.
static java.lang.String cot(java.lang.String[] params)
          Produce a function call for the cot UDF function.
static java.lang.String floor(java.lang.String[] params)
          Produce a function call for the floor UDF function.
static java.lang.String lcase(java.lang.String[] params)
          Produce a function call for the lcase UDF function.
static java.lang.String length(java.lang.String[] params)
          Produce a function call for the length UDF function.
static java.lang.String log(java.lang.String[] params)
          Produce a function call for the log UDF function.
static java.lang.String log10(java.lang.String[] params)
          Produce a function call for the log10 UDF function.
static java.lang.String ltrim(java.lang.String[] params)
          Produce a function call for the ltrim UDF function.
static java.lang.String mod(java.lang.String[] params)
          Produce a function call for the mod UDF function.
static java.util.List parseArguments(java.lang.String functionCall)
          Extract function arguments from the function call.
static java.lang.String parseFunction(java.lang.String functionCall)
          Extract function name from the function call.
static java.lang.String pi(java.lang.String[] params)
          Produce a function call for the pi UDF function.
static java.lang.String rand(java.lang.String[] params)
          Produce a function call for the rand UDF function.
static java.lang.String rtrim(java.lang.String[] params)
          Produce a function call for the rtrim UDF function.
static java.lang.String sign(java.lang.String[] params)
          Produce a function call for the sign UDF function.
static java.lang.String sin(java.lang.String[] params)
          Produce a function call for the sin UDF function.
static java.lang.String sqrt(java.lang.String[] params)
          Produce a function call for the sqrt UDF function.
static java.lang.String tan(java.lang.String[] params)
          Produce a function call for the tan UDF function.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FBEscapedFunctionHelper

public FBEscapedFunctionHelper()
Method Detail

parseFunction

public static java.lang.String parseFunction(java.lang.String functionCall)
                                      throws FBSQLParseException
Extract function name from the function call.

Parameters:
functionCall - escaped function call.
Returns:
name of the function.
Throws:
FBSQLParseException - if parse error occurs.

parseArguments

public static java.util.List parseArguments(java.lang.String functionCall)
                                     throws FBSQLParseException
Extract function arguments from the function call. This method parses escaped function call string and extracts function parameters from it.

Parameters:
functionCall - escaped function call.
Returns:
list of parameters of the function.
Throws:
FBSQLParseException - if parse error occurs.

convertTemplate

public static java.lang.String convertTemplate(java.lang.String functionCall,
                                               int mode)
                                        throws FBSQLParseException
Convert escaped function call using function template.

Parameters:
functionCall - escaped function call.
Returns:
server-side representation of the function call or null if no template found.
Throws:
FBSQLParseException - if escaped function call has incorrect syntax.

abs

public static java.lang.String abs(java.lang.String[] params)
                            throws FBSQLParseException
Produce a function call for the abs UDF function. The syntax of the abs function is {fn abs(number)}.

Parameters:
params - The parameters to be used in the call
Throws:
FBSQLParseException - if there is an error with the parameters

acos

public static java.lang.String acos(java.lang.String[] params)
                             throws FBSQLParseException
Produce a function call for the acos UDF function. The syntax of the acos function is {fn acos(float)}.

Parameters:
params - The parameters to be used in the call
Throws:
FBSQLParseException - if there is an error with the parameters

asin

public static java.lang.String asin(java.lang.String[] params)
                             throws FBSQLParseException
Produce a function call for the asin UDF function. The syntax of the asin function is {fn asin(float)}.

Parameters:
params - The parameters to be used in the call
Throws:
FBSQLParseException - if there is an error with the parameters

atan

public static java.lang.String atan(java.lang.String[] params)
                             throws FBSQLParseException
Produce a function call for the atan UDF function. The syntax of the atan function is {fn atan(float)}.

Parameters:
params - The parameters to be used in the call
Throws:
FBSQLParseException - if there is an error with the parameters

atan2

public static java.lang.String atan2(java.lang.String[] params)
                              throws FBSQLParseException
Produce a function call for the atan2 UDF function. The syntax of the atan2 function is {fn atan2(float1, float2)}.

Parameters:
params - The parameters to be used in the call
Throws:
FBSQLParseException - if there is an error with the parameters

ceiling

public static java.lang.String ceiling(java.lang.String[] params)
                                throws FBSQLParseException
Produce a function call for the ceiling UDF function. The syntax of the ceiling function is {fn ceiling(number)}.

Parameters:
params - The parameters to be used in the call
Throws:
FBSQLParseException - if there is an error with the parameters

cos

public static java.lang.String cos(java.lang.String[] params)
                            throws FBSQLParseException
Produce a function call for the cos UDF function. The syntax of the cos function is {fn cos(float)}.

Parameters:
params - The parameters to be used in the call
Throws:
FBSQLParseException - if there is an error with the parameters

cot

public static java.lang.String cot(java.lang.String[] params)
                            throws FBSQLParseException
Produce a function call for the cot UDF function. The syntax of the cot function is {fn cot(float)}.

Parameters:
params - The parameters to be used in the call
Throws:
FBSQLParseException - if there is an error with the parameters

floor

public static java.lang.String floor(java.lang.String[] params)
                              throws FBSQLParseException
Produce a function call for the floor UDF function. The syntax of the floor function is {fn floor(number)}.

Parameters:
params - The parameters to be used in the call
Throws:
FBSQLParseException - if there is an error with the parameters

log

public static java.lang.String log(java.lang.String[] params)
                            throws FBSQLParseException
Produce a function call for the log UDF function. The syntax of the log function is {fn log(number)}.

Parameters:
params - The parameters to be used in the call
Throws:
FBSQLParseException - if there is an error with the parameters

log10

public static java.lang.String log10(java.lang.String[] params)
                              throws FBSQLParseException
Produce a function call for the log10 UDF function. The syntax of the log10 function is {fn log10(number)}.

Parameters:
params - The parameters to be used in the call
Throws:
FBSQLParseException - if there is an error with the parameters

mod

public static java.lang.String mod(java.lang.String[] params)
                            throws FBSQLParseException
Produce a function call for the mod UDF function. The syntax of the mod function is {fn mod(integer1, integer2)}.

Parameters:
params - The parameters to be used in the call
Throws:
FBSQLParseException - if there is an error with the parameters

pi

public static java.lang.String pi(java.lang.String[] params)
                           throws FBSQLParseException
Produce a function call for the pi UDF function. The syntax of the pi function is {fn pi()}.

Parameters:
params - The parameters to be used in the call
Throws:
FBSQLParseException - if there is an error with the parameters

rand

public static java.lang.String rand(java.lang.String[] params)
                             throws FBSQLParseException
Produce a function call for the rand UDF function. The syntax for the rand function is {fn rand()}.

Parameters:
params - The parameters to be used in the call
Throws:
FBSQLParseException - if there is an error with the parameters

sign

public static java.lang.String sign(java.lang.String[] params)
                             throws FBSQLParseException
Produce a function call for the sign UDF function. The syntax for the sign function is {fn sign(number)}.

Parameters:
params - The parameters to be used in the call
Throws:
FBSQLParseException - if there is an error with the parameters

sin

public static java.lang.String sin(java.lang.String[] params)
                            throws FBSQLParseException
Produce a function call for the sin UDF function. The syntax for the sin function is {fn sin(float)}.

Parameters:
params - The parameters to be used in the call
Throws:
FBSQLParseException - if there is an error with the parameters

sqrt

public static java.lang.String sqrt(java.lang.String[] params)
                             throws FBSQLParseException
Produce a function call for the sqrt UDF function. The syntax for the sqrt function is {fn sqrt(number)}.

Parameters:
params - The parameters to be used in the call
Throws:
FBSQLParseException - if there is an error with the parameters

tan

public static java.lang.String tan(java.lang.String[] params)
                            throws FBSQLParseException
Produce a function call for the tan UDF function. The syntax for the tan function is {fn tan(float)}.

Parameters:
params - The parameters to be used in the call
Throws:
FBSQLParseException - if there is an error with the parameters

ascii

public static java.lang.String ascii(java.lang.String[] params)
                              throws FBSQLParseException
Produce a function call for the ascii UDF function. The syntax of the ascii function is {fn ascii(string)}

Parameters:
params - The parameters to be used in the call
Throws:
FBSQLParseException - if there is an error with the parameters

_char

public static java.lang.String _char(java.lang.String[] params)
                              throws FBSQLParseException
Produce a function call for the char UDF function. The syntax of the char function is {fn char(integer)}.

Parameters:
params - The parameters to be used in the call
Throws:
FBSQLParseException - if there is an error with the parameters

lcase

public static java.lang.String lcase(java.lang.String[] params)
                              throws FBSQLParseException
Produce a function call for the lcase UDF function. The syntax of the lcase function is {fn lcase(string)}

Parameters:
params - The parameters to be used in the call
Throws:
FBSQLParseException - if there is an error with the parameters

length

public static java.lang.String length(java.lang.String[] params)
                               throws FBSQLParseException
Produce a function call for the length UDF function. The syntax of the length function is {fn length(string)}.

Parameters:
params - The parameters to be used in the call
Throws:
FBSQLParseException - if there is an error with the parameters

ltrim

public static java.lang.String ltrim(java.lang.String[] params)
                              throws FBSQLParseException
Produce a function call for the ltrim UDF function. The syntax of the ltrim function is {fn ltrim(string)}.

Parameters:
params - The parameters to be used in the call
Throws:
FBSQLParseException - if there is an error with the parameters

rtrim

public static java.lang.String rtrim(java.lang.String[] params)
                              throws FBSQLParseException
Produce a function call for the rtrim UDF function. The syntax of the rtrim function is {fn rtrim(string)}.

Parameters:
params - The parameters to be used in the call
Throws:
FBSQLParseException - if there is an error with the parameters


Copyright © 2001-2019 Jaybird (Firebird JDBC/JCA) team. All rights reserved.