Class JavaFunDef

  • All Implemented Interfaces:
    FunDef

    public class JavaFunDef
    extends FunDefBase
    MDX function which is implemented by a Java method. When the function is executed, the method is invoked via reflection.
    Since:
    Jan 5, 2008
    Author:
    wgorman, jhyde
    • Constructor Detail

      • JavaFunDef

        public JavaFunDef​(String name,
                          String desc,
                          Syntax syntax,
                          int returnCategory,
                          int[] paramCategories,
                          Method method)
        Creates a JavaFunDef.
        Parameters:
        name - Name
        desc - Description
        syntax - Syntax
        returnCategory - Return type
        paramCategories - Parameter types
        method - Java method which implements this function
    • Method Detail

      • compileCall

        public Calc compileCall​(ResolvedFunCall call,
                                ExpCompiler compiler)
        Description copied from interface: FunDef
        Converts a call to this function into executable objects.

        The result must implement the appropriate interface for the result type. For example, a function which returns an integer must return an object which implements IntegerCalc.

        Specified by:
        compileCall in interface FunDef
        Overrides:
        compileCall in class FunDefBase
      • scan

        public static List<FunDef> scan​(Class clazz)
        Scans a java class and returns a list of function definitions, one for each static method which is suitable to become an MDX function.
        Parameters:
        clazz - Class
        Returns:
        List of function definitions