Class AbstractTravelValidator

java.lang.Object
de.hybris.platform.travelacceleratorstorefront.validators.AbstractTravelValidator
All Implemented Interfaces:
org.springframework.validation.Validator
Direct Known Subclasses:
AccommodationAddToCartValidator, AccommodationAvailabilityValidator, AccommodationBookingChangeDateValidator, AccommodationFinderValidator, AddDealToCartFormValidator, AddDealToCartFormValidator, FareFinderValidator, FareFinderValidator

public abstract class AbstractTravelValidator extends Object implements org.springframework.validation.Validator
The type Abstract travel validator.
  • Constructor Details

    • AbstractTravelValidator

      public AbstractTravelValidator()
  • Method Details

    • validateBlankField

      protected Boolean validateBlankField(String fieldName, String fieldValue, org.springframework.validation.Errors errors)
      Method to check if the value of the selected field either empty, null or contains only white spaces and if so it will set a EmptyField error against the field
      Parameters:
      fieldName -
      fieldValue -
      errors -
    • validateDateFormat

      protected Boolean validateDateFormat(String date, org.springframework.validation.Errors errors, String field)
      Method responsible for validating the date format
      Parameters:
      date -
      errors -
      field -
      Returns:
    • validateForPastDate

      protected void validateForPastDate(String date, org.springframework.validation.Errors errors, String field)
      Method check to see if date is a past date and if so sets a PastDate errors for the field
      Parameters:
      date -
      errors -
      field -
    • validateDates

      protected void validateDates(String startDate, String startDateFieldName, String endDate, String endDateFieldName, org.springframework.validation.Errors errors)
    • validateCheckInAndCheckOutDateTimeRange

      protected void validateCheckInAndCheckOutDateTimeRange(String startDate, String startDateFieldName, String endDate, String endDateFieldName, org.springframework.validation.Errors errors)
      Method used to validate Check In and Check Out dates
      Parameters:
      startDate -
      startDateFieldName -
      endDate -
      endDateFieldName -
      errors -
    • validateGuestsQuantity

      public void validateGuestsQuantity(String numberOfRooms, List<RoomStayCandidateData> roomStayCandidates, org.springframework.validation.Errors errors)
      Parameters:
      numberOfRooms -
      roomStayCandidates -
      errors -
    • validateEmptyField

      protected Boolean validateEmptyField(String fieldName, Collection listObject, org.springframework.validation.Errors errors)
      Method to check if the value of the selected field either empty, null and if so it will set a EmptyField error against the field
      Parameters:
      fieldName -
      listObject -
      errors -
    • rejectValue

      protected void rejectValue(org.springframework.validation.Errors errors, String attributeName, String errorCode)
      Method to add errors
      Parameters:
      errors -
      attributeName -
      errorCode -
    • getTargetForm

      protected String getTargetForm()
    • setTargetForm

      public void setTargetForm(String targetForm)
    • getAttributePrefix

      public String getAttributePrefix()
      Returns:
      the attributePrefix
    • setAttributePrefix

      public void setAttributePrefix(String attributePrefix)
      Parameters:
      attributePrefix - the attributePrefix to set
    • getConfigurationService

      protected de.hybris.platform.servicelayer.config.ConfigurationService getConfigurationService()
      Returns:
      the configurationService
    • setConfigurationService

      public void setConfigurationService(de.hybris.platform.servicelayer.config.ConfigurationService configurationService)
      Parameters:
      configurationService - the configurationService to set