@Test public void testToDMNModelNoEditor() { when(editor.getExpression()).thenReturn(Optional::empty); mapper.toDMNModel(0, 0, cellValueSupplier); verify(hasExpression).setExpression(eq(null)); }
@Override public void toDMNModel(final int rowIndex, final int columnIndex, final Supplier<Optional<GridCellValue<?>>> cell) { cell.get().ifPresent(v -> { final ExpressionCellValue ecv = (ExpressionCellValue) v; ecv.getValue().ifPresent(beg -> { hasExpression.setExpression(beg.getExpression().get().orElse(null)); beg.getExpression().get().ifPresent(e -> e.setParent(hasExpression.asDMNModelInstrumentedBase())); }); }); }
UndefinedExpressionUIModelMapper extends BaseUIModelMapper<Expression> { @Override public void toDMNModel(final int rowIndex, final int columnIndex, final Supplier<Optional<GridCellValue<?>>> cell) { cell.get().ifPresent(v -> { final ExpressionCellValue ecv = (ExpressionCellValue) v; ecv.getValue().ifPresent(beg -> { hasExpression.setExpression(beg.getExpression().get().orElse(null)); beg.getExpression().get().ifPresent(e -> e.setParent(hasExpression.asDMNModelInstrumentedBase())); }); }); } }
UndefinedExpressionUIModelMapper extends BaseUIModelMapper<Expression> { @Override public void toDMNModel(final int rowIndex, final int columnIndex, final Supplier<Optional<GridCellValue<?>>> cell) { cell.get().ifPresent(v -> { final ExpressionCellValue ecv = (ExpressionCellValue) v; ecv.getValue().ifPresent(beg -> { hasExpression.setExpression(beg.getExpression().get().orElse(null)); beg.getExpression().get().ifPresent(e -> e.setParent(hasExpression.asDMNModelInstrumentedBase())); }); }); } UndefinedExpressionUIModelMapper(final Supplier<GridData> uiModel,
                                            final Supplier<Optional<Expression>> dmnModel,
                                            final ListSelectorView.Presenter listSelector,
                                            final TranslationService translationService,
                                            final HasExpression hasExpression); }
UndefinedExpressionUIModelMapper extends BaseUIModelMapper<Expression> { @Override public void toDMNModel(final int rowIndex, final int columnIndex, final Supplier<Optional<GridCellValue<?>>> cell) { cell.get().ifPresent(v -> { final ExpressionCellValue ecv = (ExpressionCellValue) v; ecv.getValue().ifPresent(beg -> { hasExpression.setExpression(beg.getExpression().get().orElse(null)); beg.getExpression().get().ifPresent(e -> e.setParent(hasExpression.asDMNModelInstrumentedBase())); }); }); } UndefinedExpressionUIModelMapper(final Supplier<GridData> uiModel,
                                            final Supplier<Optional<Expression>> dmnModel,
                                            final ListSelectorView.Presenter listSelector,
                                            final TranslationService translationService,
                                            final HasExpression hasExpression); @Override void fromDMNModel(final int rowIndex,
                             final int columnIndex); @Override void toDMNModel(final int rowIndex,
                           final int columnIndex,
                           final Supplier<Optional<GridCellValue<?>>> cell); }
UndefinedExpressionUIModelMapper extends BaseUIModelMapper<Expression> { @Override public void toDMNModel(final int rowIndex, final int columnIndex, final Supplier<Optional<GridCellValue<?>>> cell) { cell.get().ifPresent(v -> { final ExpressionCellValue ecv = (ExpressionCellValue) v; ecv.getValue().ifPresent(beg -> { hasExpression.setExpression(beg.getExpression().get().orElse(null)); beg.getExpression().get().ifPresent(e -> e.setParent(hasExpression.asDMNModelInstrumentedBase())); }); }); } UndefinedExpressionUIModelMapper(final Supplier<GridData> uiModel,
                                            final Supplier<Optional<Expression>> dmnModel,
                                            final ListSelectorView.Presenter listSelector,
                                            final TranslationService translationService,
                                            final HasExpression hasExpression); @Override void fromDMNModel(final int rowIndex,
                             final int columnIndex); @Override void toDMNModel(final int rowIndex,
                           final int columnIndex,
                           final Supplier<Optional<GridCellValue<?>>> cell);  }