class DataValidator {

    void validateAttributeOptionCombo( final CategoryOptionCombo attributeOptionCombo,
        final Period period, final DataSet dataSet, final DataElement dataElement )
        throws WebMessageException
    {
        for ( CategoryOption option : attributeOptionCombo.getCategoryOptions() )
        {
            if ( option.getStartDate() != null && period.getEndDate().before( option.getStartDate() ) )
            {
                throw new WebMessageException( conflict( "Period " + period.getIsoDate() + " is before start date "
                    + i18nManager.getI18nFormat().formatDate( option.getStartDate() )
                    + " for attributeOption '" + option.getName() + "'" ) );
            }

            if ( option.getEndDate() != null && period.getStartDate().after( option.getAdjustedEndDate( dataSet, dataElement ) ) )
            {
                throw new WebMessageException( conflict( "Period " + period.getIsoDate() + " is after end date "
                    + i18nManager.getI18nFormat().formatDate( option.getAdjustedEndDate( dataSet, dataElement ) )
                    + " for attributeOption '" + option.getName() + "'" ) );
            }
        }
    }

    public  DataValidator( final CategoryService categoryService, final OrganisationUnitService organisationUnitService,
        final DataSetService dataSetService, final IdentifiableObjectManager idObjectManager,
        final InputUtils inputUtils, final FileResourceService fileResourceService, final I18nManager i18nManager,
        final CalendarService calendarService, final AggregateAccessManager accessManager );

}