|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.metamatrix.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 java.lang.String |
CAST
|
static java.lang.String |
COALESCE
|
static java.lang.String |
COMMAND_PAYLOAD
|
static java.lang.String |
CONCAT
|
static java.lang.String |
CONCAT_OPERATOR
|
static java.lang.String |
CONCAT2
|
static java.lang.String |
CONTEXT
|
static java.lang.String |
CONVERT
|
static java.lang.String |
DECODEINTEGER
|
static java.lang.String |
DECODESTRING
|
static java.lang.String |
ENV
|
static java.lang.String |
FROM_UNIXTIME
|
static java.lang.String |
IFNULL
|
static java.lang.String |
LOOKUP
|
static java.lang.String |
NULLIF
|
static java.lang.String |
NVL
|
static java.lang.String |
ROWLIMIT
|
static java.lang.String |
ROWLIMITEXCEPTION
|
static java.lang.String |
SPACE
|
static java.lang.String |
SUBSTRING
|
static java.lang.String |
TIMESTAMPADD
|
static java.lang.String |
USER
|
static java.lang.String |
XPATHVALUE
|
Method Summary | |
---|---|
FunctionDescriptor |
copyFunctionChangeReturnType(FunctionDescriptor fd,
java.lang.Class returnType)
Return a copy of the given FunctionDescriptor with the sepcified return type. |
FunctionDescriptor[] |
determineNecessaryConversions(java.lang.String name,
java.lang.Class<?> returnType,
java.lang.Class<?>[] types,
boolean hasUnknownType)
Get the conversions that are needed to call the named function with arguments of the given type. |
FunctionDescriptor |
findFunction(java.lang.String name,
java.lang.Class[] types)
Find a function descriptor given a name and the types of the arguments. |
FunctionForm |
findFunctionForm(java.lang.String name,
int numArgs)
Find function form based on function name and # of arguments. |
FunctionDescriptor |
findTypedConversionFunction(java.lang.Class sourceType,
java.lang.Class targetType)
Find conversion function and set return type to proper type. |
java.util.List |
getFunctionCategories()
Get all function categories, sorted in alphabetical order |
java.util.List |
getFunctionForms(java.lang.String category)
Get all function forms in a category, sorted by name, then # of args, then names of args. |
java.lang.Object |
invokeFunction(FunctionDescriptor fd,
java.lang.Object[] values)
Invoke the function described in the function descriptor, using the values provided. |
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 java.lang.String CONVERT
public static final java.lang.String CAST
public static final java.lang.String LOOKUP
public static final java.lang.String USER
public static final java.lang.String ENV
public static final java.lang.String XPATHVALUE
public static final java.lang.String CONTEXT
public static final java.lang.String ROWLIMIT
public static final java.lang.String ROWLIMITEXCEPTION
public static final java.lang.String DECODESTRING
public static final java.lang.String DECODEINTEGER
public static final java.lang.String COMMAND_PAYLOAD
public static final java.lang.String CONCAT
public static final java.lang.String CONCAT2
public static final java.lang.String CONCAT_OPERATOR
public static final java.lang.String SUBSTRING
public static final java.lang.String NVL
public static final java.lang.String IFNULL
public static final java.lang.String FROM_UNIXTIME
public static final java.lang.String TIMESTAMPADD
public static final java.lang.String NULLIF
public static final java.lang.String COALESCE
public static final java.lang.String SPACE
Method Detail |
---|
public java.util.List getFunctionCategories()
public java.util.List getFunctionForms(java.lang.String category)
category
- Category name
FunctionForm
s in a categorypublic FunctionForm findFunctionForm(java.lang.String name, int numArgs)
name
- Function namenumArgs
- Number of arguments
public FunctionDescriptor findFunction(java.lang.String name, java.lang.Class[] types)
name
- Name of the function to resolvetypes
- Array of classes representing the types
public FunctionDescriptor[] determineNecessaryConversions(java.lang.String name, java.lang.Class<?> returnType, java.lang.Class<?>[] types, boolean hasUnknownType)
name
- Name of functionreturnType
- types
- Existing types passed to the function
QueryResolverException
public FunctionDescriptor findTypedConversionFunction(java.lang.Class sourceType, java.lang.Class targetType)
sourceType
- The source type classtargetType
- The target type class
public java.lang.Object invokeFunction(FunctionDescriptor fd, java.lang.Object[] values) throws InvalidFunctionException, FunctionExecutionException
fd
- Function descriptor describing the name and types of the argumentsvalues
- Values that should match 1-to-1 with the types described in the
function descriptor
InvalidFunctionException
FunctionExecutionException
public FunctionDescriptor copyFunctionChangeReturnType(FunctionDescriptor fd, java.lang.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 |