org.makumba.providers.query.mql
Class MQLFunctionDefinition

java.lang.Object
  extended by org.makumba.providers.query.mql.MQLFunctionDefinition
Direct Known Subclasses:
NowFunction, SQLDialectFunction

public class MQLFunctionDefinition
extends Object

This class represents an MQL function, with it's name, return type and required arguments. This definition is then used to check for correct use of the MQL functions, and set the return type, types of parameters.

Version:
$Id: MQLFunction.java,v 1.1 Dec 20, 2008 1:19:31 AM rudi Exp $
Author:
Rudolf Mayer

Field Summary
protected  int argumentCount
           
 
Constructor Summary
MQLFunctionDefinition(String name, String returnType, MQLFunctionArgument... arguments)
           
MQLFunctionDefinition(String name, String returnType, String... arguments)
           
 
Method Summary
 MQLFunctionArgument[] getArguments()
           
 String getName()
           
 String getReturnType()
           
 String getSQLCommand()
           
 NameResolver.TextList render(List<NameResolver.TextList> args)
          This default implementation just renders the function by concatenating the function name and all arguments; for functions that need to modify the name, the argument order, number of arguments, etc., this method provides an entry point to rewrite it (possibly in a specific SQL dialect).
 OQLParseError throwUnexpectedArguments(int argumentCount)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

argumentCount

protected int argumentCount
Constructor Detail

MQLFunctionDefinition

public MQLFunctionDefinition(String name,
                             String returnType,
                             MQLFunctionArgument... arguments)

MQLFunctionDefinition

public MQLFunctionDefinition(String name,
                             String returnType,
                             String... arguments)
Method Detail

getArguments

public MQLFunctionArgument[] getArguments()

getName

public String getName()

getSQLCommand

public String getSQLCommand()

getReturnType

public String getReturnType()

toString

public String toString()
Overrides:
toString in class Object

throwUnexpectedArguments

public OQLParseError throwUnexpectedArguments(int argumentCount)

render

public NameResolver.TextList render(List<NameResolver.TextList> args)
This default implementation just renders the function by concatenating the function name and all arguments; for functions that need to modify the name, the argument order, number of arguments, etc., this method provides an entry point to rewrite it (possibly in a specific SQL dialect).