package gw.rating.rtm.valueprovider uses java.lang.Comparable uses gw.rating.rtm.domain.RateBookVisitor uses gw.rating.rtm.domain.table.RateTableCell uses gw.rating.rtm.domain.ErrorCollectingVisitor uses gw.rating.rtm.domain.ErrorCollector uses gw.rating.rtm.domain.table.RateTableRow class ValueProviderVisitor extends ErrorCollectingVisitor { delegate _visitor : RateBookVisitor represents RateBookVisitor var _repo : RateTableCellValueProviderFactory var _ratingRow: RateTableRow construct(collector : ErrorCollector, repo : RateTableCellValueProviderFactory, visitor : RateBookVisitor) { super(collector) this._visitor = visitor this._repo = repo } construct(repo : RateTableCellValueProviderFactory, visitor : RateBookVisitor) { this(null, repo, visitor) } override function visit(ratingRow : RateTableRow) { _visitor.visit(ratingRow) _ratingRow = ratingRow } override function visitString(ratingCell : RateTableCell) { _visitor.visitString(ratingCell) var ratingCellValue = ratingCell.Value as String var checkForCode = (ratingCellValue != null and not ratingCellValue.Empty) if (checkForCode and !_repo.getValueProviderFor(ratingCell).containsCodeFor(ratingCell)) { addCellError(_ratingRow, ratingCell, RateTableErrorType.TC_INVALIDCODEVALUE) ratingCell.Value = null } } }