org.teiid.metadata
Class FunctionMethod

java.lang.Object
  extended by org.teiid.metadata.AbstractMetadataRecord
      extended by org.teiid.metadata.FunctionMethod
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
FunctionMethod

public class FunctionMethod
extends AbstractMetadataRecord

This class represents information about a particular function signature. Function signatures are unique with respect to their name, # of arguments, and type of arguments. Return type and argument names are not uniqueness factors. This class makes no attempt to validate the data put into it, particularly with respect to null values. The FunctionMetadataValidator can be used to validate this object.

Attributes:

See Also:
FunctionParameter, Serialized Form

Nested Class Summary
static class FunctionMethod.Determinism
          DETERMINISTIC -> normal deterministic functions vdb -> lookup (however lookup values can be flushed at any time), current_database session -> env, user command -> command payload never -> rand, etc.
static class FunctionMethod.PushDown
          Function Pushdown CAN_PUSHDOWN = If the source supports the function, then it will be pushed down.
 
Nested classes/interfaces inherited from class org.teiid.metadata.AbstractMetadataRecord
AbstractMetadataRecord.DataModifiable, AbstractMetadataRecord.Modifiable
 
Field Summary
protected  java.util.List<FunctionParameter> inParameters
           
 
Fields inherited from class org.teiid.metadata.AbstractMetadataRecord
NAME_DELIM_CHAR
 
Constructor Summary
protected FunctionMethod()
           
  FunctionMethod(java.lang.String name, java.lang.String description, java.lang.String category, FunctionMethod.PushDown pushdown, java.lang.String invocationClass, java.lang.String invocationMethod, FunctionParameter[] inputParams, FunctionParameter outputParam, boolean nullOnNull, FunctionMethod.Determinism deterministic)
           
  FunctionMethod(java.lang.String name, java.lang.String description, java.lang.String category, FunctionParameter[] inputParams, FunctionParameter outputParam)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compare other object for equality.
 java.lang.String getCategory()
          Get category of method
 java.lang.String getDescription()
          Get description of method
 FunctionMethod.Determinism getDeterminism()
           
 java.lang.String getFullName()
          WARNING - The name returned by this method may be ambiguous and is not SQL safe - it may need quoted/escaped
 int getInputParameterCount()
          Get a count of the input parameters.
 java.util.List<FunctionParameter> getInputParameters()
          Get input parameters
 java.lang.String getInvocationClass()
          Get invocation class name
 java.lang.String getInvocationMethod()
          Get invocation method name
 java.lang.String getName()
          Return name of method
 FunctionParameter getOutputParameter()
          Get ouput parameter.
 Schema getParent()
           
 FunctionMethod.PushDown getPushdown()
          Get pushdown property of method
 int hashCode()
          Get hash code for this object.
 boolean isNullOnNull()
          Returns true if the function returns null on any null input
 boolean isVarArgs()
           
 void setCategory(java.lang.String category)
          Set category of method
 void setDescription(java.lang.String description)
          Set description of method
 void setDeterminism(FunctionMethod.Determinism determinism)
           
 void setDeterministicBoolean(boolean deterministic)
           
 void setInputParameters(java.util.List<FunctionParameter> params)
          Set input parameters.
 void setInvocationClass(java.lang.String invocationClass)
          Set invocation class name
 void setInvocationMethod(java.lang.String invocationMethod)
          Set invocation method name
 void setName(java.lang.String name)
          Set name of method
 void setNullOnNull(boolean nullOnNull)
           
 void setOutputParameter(FunctionParameter param)
          Set ouput parameter.
 void setParent(Schema parent)
           
 void setPushdown(FunctionMethod.PushDown pushdown)
          Set pushdown property of method
 void setPushDown(java.lang.String pushdown)
           
 java.lang.String toString()
          Return string version for debugging purposes
 
Methods inherited from class org.teiid.metadata.AbstractMetadataRecord
getAnnotation, getCanonicalName, getNameInSource, getProperties, getUUID, setAnnotation, setNameInSource, setProperties, setProperty, setUUID
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

inParameters

protected java.util.List<FunctionParameter> inParameters
Constructor Detail

FunctionMethod

protected FunctionMethod()

FunctionMethod

public FunctionMethod(java.lang.String name,
                      java.lang.String description,
                      java.lang.String category,
                      FunctionParameter[] inputParams,
                      FunctionParameter outputParam)

FunctionMethod

public FunctionMethod(java.lang.String name,
                      java.lang.String description,
                      java.lang.String category,
                      FunctionMethod.PushDown pushdown,
                      java.lang.String invocationClass,
                      java.lang.String invocationMethod,
                      FunctionParameter[] inputParams,
                      FunctionParameter outputParam,
                      boolean nullOnNull,
                      FunctionMethod.Determinism deterministic)
Method Detail

getName

public java.lang.String getName()
Return name of method

Overrides:
getName in class AbstractMetadataRecord
Returns:
Name

setName

public void setName(java.lang.String name)
Set name of method

Overrides:
setName in class AbstractMetadataRecord
Parameters:
name - Name

getFullName

public java.lang.String getFullName()
Description copied from class: AbstractMetadataRecord
WARNING - The name returned by this method may be ambiguous and is not SQL safe - it may need quoted/escaped

Overrides:
getFullName in class AbstractMetadataRecord

getDescription

public java.lang.String getDescription()
Get description of method

Returns:
Description

setDescription

public void setDescription(java.lang.String description)
Set description of method

Parameters:
description - Description

getCategory

public java.lang.String getCategory()
Get category of method

Returns:
Category
See Also:
FunctionCategoryConstants

setCategory

public void setCategory(java.lang.String category)
Set category of method

Parameters:
category - Category
See Also:
FunctionCategoryConstants

getPushdown

public FunctionMethod.PushDown getPushdown()
Get pushdown property of method

Returns:
One of the FunctionMethod constants for pushdown

setPushdown

public void setPushdown(FunctionMethod.PushDown pushdown)
Set pushdown property of method

Parameters:
pushdown - One of the FunctionMethod constants for pushdown

setPushDown

public void setPushDown(java.lang.String pushdown)

getInvocationClass

public java.lang.String getInvocationClass()
Get invocation class name

Returns:
Invocation class name

setInvocationClass

public void setInvocationClass(java.lang.String invocationClass)
Set invocation class name

Parameters:
invocationClass - Invocation class name

getInvocationMethod

public java.lang.String getInvocationMethod()
Get invocation method name

Returns:
Invocation method name

setInvocationMethod

public void setInvocationMethod(java.lang.String invocationMethod)
Set invocation method name

Parameters:
invocationMethod - Invocation method name

getInputParameterCount

public int getInputParameterCount()
Get a count of the input parameters.

Returns:
Number of input parameters

getInputParameters

public java.util.List<FunctionParameter> getInputParameters()
Get input parameters

Returns:
Array of input parameters, may be null if 0 parameters

setInputParameters

public void setInputParameters(java.util.List<FunctionParameter> params)
Set input parameters.

Parameters:
params - Input parameters

getOutputParameter

public FunctionParameter getOutputParameter()
Get ouput parameter.

Returns:
Output parameter or return argument

setOutputParameter

public void setOutputParameter(FunctionParameter param)
Set ouput parameter.

Parameters:
param - Output Parameter

hashCode

public int hashCode()
Get hash code for this object. The hash code is based on the name and input parameters. WARNING: Changing the name or input parameters will change the hash code. If this occurs after the object has been placed in a HashSet or HashMap, the object will be lost!!!! In that case, the object must be added to the hashed collection again.

Overrides:
hashCode in class AbstractMetadataRecord
Returns:
Hash code, based on name and input parameters

equals

public boolean equals(java.lang.Object obj)
Compare other object for equality. This object is equal to another FunctionMethod if 1) Name of function matches (case-insensitive), 2) number of input parameters matches and 3) types of input parameters match.

Overrides:
equals in class AbstractMetadataRecord
Returns:
True if object equals this object according to conditions

toString

public java.lang.String toString()
Return string version for debugging purposes

Overrides:
toString in class AbstractMetadataRecord
Returns:
String representation of function method

isNullOnNull

public boolean isNullOnNull()
Returns true if the function returns null on any null input


setNullOnNull

public void setNullOnNull(boolean nullOnNull)

getDeterminism

public FunctionMethod.Determinism getDeterminism()

setDeterministicBoolean

public void setDeterministicBoolean(boolean deterministic)

setDeterminism

public void setDeterminism(FunctionMethod.Determinism determinism)

isVarArgs

public boolean isVarArgs()

setParent

public void setParent(Schema parent)

getParent

public Schema getParent()
Overrides:
getParent in class AbstractMetadataRecord


Copyright © 2011. All Rights Reserved.