Class AbstractBaseVarArgFunction<T extends org.faktorips.codegen.CodeFragment>

All Implemented Interfaces:
FlFunction<T>, FunctionSignature
Direct Known Subclasses:
AbstractVarArgFunction

public abstract class AbstractBaseVarArgFunction<T extends org.faktorips.codegen.CodeFragment> extends AbstractBaseFlFunction<T>
An extension of the AbstractBaseFlFunction that provides base functionality for variable argument functions.
  • Field Details

  • Constructor Details

  • Method Details

    • getExpectedDatatypeForArgResultConversion

      protected org.faktorips.datatype.Datatype getExpectedDatatypeForArgResultConversion(CompilationResult<T>[] argResults)
      Returns the expected Datatype used to convert arguments in a varargs statement to a common Datatype. This default implementation returns the Datatype defined for the first argument in the expression signature.
      Parameters:
      argResults - the results of the compilation of the individual parameters; may be used by subclasses to infer a Datatype.
      Returns:
      the expected Datatype
    • compileInternal

      protected abstract void compileInternal(CompilationResult<T> returnValue, CompilationResult<T>[] convertedArgs, T fragment)
      The actual compile logic for this function has to be implemented within this method. The called provides the CompilationResult that will be returned by this function, an array of already converted arguments and a CodeFragment into which the code is to be generated. The compilation result is provided to this method to write error messages that may occur during the code generation or to get status information. Implementations don't need to care about shoveling messages from the argument CompilationResult object to the returned CompilationResult object. This is already handled by the caller.