|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.teiid.query.function.FunctionLibrary
public class FunctionLibrary
The function library is the primary way for the system to find out what functions are available, resolve function signatures, and invoke system and user-defined functions.
Field Summary | |
---|---|
static String |
CAST
|
static String |
COALESCE
|
static String |
COMMAND_PAYLOAD
|
static String |
CONCAT
|
static String |
CONCAT_OPERATOR
|
static String |
CONCAT2
|
static String |
CONTEXT
|
static String |
CONVERT
|
static String |
DECODEINTEGER
|
static String |
DECODESTRING
|
static String |
ENV
|
static String |
FORMATDATE
|
static String |
FORMATTIME
|
static String |
FROM_UNIXTIME
|
static String |
IFNULL
|
static String |
LOOKUP
|
static String |
NULLIF
|
static String |
NVL
|
static String |
PARSEDATE
|
static String |
PARSETIME
|
static String |
ROWLIMIT
|
static String |
ROWLIMITEXCEPTION
|
static String |
SESSION_ID
|
static String |
SPACE
|
static String |
SUBSTRING
|
static String |
TIMESTAMPADD
|
static String |
USER
|
Constructor Summary | |
---|---|
FunctionLibrary(FunctionTree systemFuncs,
FunctionTree... userFuncs)
Construct the function library. |
Method Summary | |
---|---|
FunctionDescriptor |
copyFunctionChangeReturnType(FunctionDescriptor fd,
Class<?> returnType)
Return a copy of the given FunctionDescriptor with the sepcified return type. |
FunctionDescriptor[] |
determineNecessaryConversions(String name,
Class<?> returnType,
Class<?>[] types,
boolean hasUnknownType)
Get the conversions that are needed to call the named function with arguments of the given type. |
FunctionDescriptor |
findFunction(String name,
Class<?>[] types)
Find a function descriptor given a name and the types of the arguments. |
FunctionForm |
findFunctionForm(String name,
int numArgs)
Find function form based on function name and # of arguments. |
FunctionDescriptor |
findTypedConversionFunction(Class<?> sourceType,
Class<?> targetType)
Find conversion function and set return type to proper type. |
List<String> |
getFunctionCategories()
Get all function categories, sorted in alphabetical order |
List<FunctionForm> |
getFunctionForms(String category)
Get all function forms in a category, sorted by name, then # of args, then names of args. |
static boolean |
isConvert(Function function)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String CONVERT
public static final String CAST
public static final String LOOKUP
public static final String USER
public static final String ENV
public static final String SESSION_ID
public static final String CONTEXT
public static final String ROWLIMIT
public static final String ROWLIMITEXCEPTION
public static final String DECODESTRING
public static final String DECODEINTEGER
public static final String COMMAND_PAYLOAD
public static final String CONCAT
public static final String CONCAT2
public static final String CONCAT_OPERATOR
public static final String SUBSTRING
public static final String NVL
public static final String IFNULL
public static final String FROM_UNIXTIME
public static final String TIMESTAMPADD
public static final String PARSETIME
public static final String PARSEDATE
public static final String FORMATTIME
public static final String FORMATDATE
public static final String NULLIF
public static final String COALESCE
public static final String SPACE
Constructor Detail |
---|
public FunctionLibrary(FunctionTree systemFuncs, FunctionTree... userFuncs)
Method Detail |
---|
public List<String> getFunctionCategories()
public List<FunctionForm> getFunctionForms(String category)
category
- Category name
FunctionForm
s in a categorypublic FunctionForm findFunctionForm(String name, int numArgs)
name
- Function namenumArgs
- Number of arguments
public FunctionDescriptor findFunction(String name, Class<?>[] types)
name
- Name of the function to resolvetypes
- Array of classes representing the types
public FunctionDescriptor[] determineNecessaryConversions(String name, Class<?> returnType, Class<?>[] types, boolean hasUnknownType)
name
- Name of functionreturnType
- types
- Existing types passed to the function
QueryResolverException
public FunctionDescriptor findTypedConversionFunction(Class<?> sourceType, Class<?> targetType)
sourceType
- The source type classtargetType
- The target type class
public FunctionDescriptor copyFunctionChangeReturnType(FunctionDescriptor fd, Class<?> returnType)
fd
- FunctionDescriptor to be copied.returnType
- The return type to apply to the copied FunctionDescriptor.
public static boolean isConvert(Function function)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |