Package org.faktorips.fl.functions
Class AbstractBaseVarArgFunction<T extends org.faktorips.codegen.CodeFragment>
java.lang.Object
org.faktorips.fl.FunctionSignatureImpl
org.faktorips.fl.functions.AbstractBaseFlFunction<T>
org.faktorips.fl.functions.AbstractBaseVarArgFunction<T>
- 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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractBaseVarArgFunction(String name, String description, org.faktorips.datatype.Datatype type, org.faktorips.datatype.Datatype argType) Creates a newAbstractBaseVarArgFunction.AbstractBaseVarArgFunction(String name, String description, FunctionSignatures signature) Creates a newAbstractBaseVarArgFunction. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidcompileInternal(CompilationResult<T> returnValue, CompilationResult<T>[] convertedArgs, T fragment) The actual compile logic for this function has to be implemented within this method.protected org.faktorips.datatype.DatatypegetExpectedDatatypeForArgResultConversion(CompilationResult<T>[] argResults) Returns the expectedDatatypeused to convert arguments in a varargs statement to a commonDatatype.Methods inherited from class org.faktorips.fl.functions.AbstractBaseFlFunction
getCompiler, getDescription, setCompiler, setDescriptionMethods inherited from class org.faktorips.fl.FunctionSignatureImpl
getArgTypes, getName, getType, hasVarArgs, isSame, match, matchUsingConversion, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.faktorips.fl.FlFunction
compileMethods inherited from interface org.faktorips.fl.FunctionSignature
getArgTypes, getName, getType, hasVarArgs, isSame, match, matchUsingConversion
-
Field Details
-
ERROR_MESSAGE_CODE
- See Also:
-
-
Constructor Details
-
AbstractBaseVarArgFunction
Creates a newAbstractBaseVarArgFunction. -
AbstractBaseVarArgFunction
public AbstractBaseVarArgFunction(String name, String description, org.faktorips.datatype.Datatype type, org.faktorips.datatype.Datatype argType) Creates a newAbstractBaseVarArgFunction.
-
-
Method Details
-
getExpectedDatatypeForArgResultConversion
protected org.faktorips.datatype.Datatype getExpectedDatatypeForArgResultConversion(CompilationResult<T>[] argResults) Returns the expectedDatatypeused to convert arguments in a varargs statement to a commonDatatype. This default implementation returns theDatatypedefined 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 aDatatype.- 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 theCompilationResultthat will be returned by this function, an array of already converted arguments and aCodeFragmentinto 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 argumentCompilationResultobject to the returned CompilationResult object. This is already handled by the caller.
-