|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface TableFunctionExecution
This interface is used for code that is generated for table access functions called within the formula language. Since the fl-language is an expression language the java code that is generated is also an expression. A problem arises when a call to a table within the generated java expression returns null instead of a table row. Since this causes a NullPointerException when a getter-method is called upon the row instance special care has to be taken to circumvent this situation. Therefor a table function call within the formula language is generated as java code within the execute method of an anonymous class of this interface. Within the execute method the null situation can be handled within an if block. Example:
public Decimal computePremium(final Integer age) {
return ((Decimal)(new TableFunctionExecution() {
public Object execute() {
TableWithMultipleContentsRow row = TableWithMultipleContents.getInstance(getRepository(),
"tables.TableWithMultipleContents1").findRow(age);
if (row != null) {
return row.getRate();
}
return Decimal.NULL;
}
}).execute());
}
| Method Summary | |
|---|---|
Object |
execute()
Executes the java code that is generated for a table function call of the formula language. |
| Method Detail |
|---|
Object execute()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||