Class AbstractTravelValidator
java.lang.Object
de.hybris.platform.coretravelbasewebservicescommons.validators.AbstractTravelValidator
- All Implemented Interfaces:
TravelValidator,org.springframework.validation.Validator
- Direct Known Subclasses:
AccommodationSearchRequestValidator,AccommodationSearchRequestValidator,AddBundleToCartTransportOfferingCodesValidator,AddRoomStayValidator,AddRoomStayValidator,CabinValidator,ChangeCurrencyValidator,CountryIsoValidator,DateValidator,DepartureDateValidator,EmailValidator,EnumValueValidator,FieldIntegerValidator,FieldNotEmptyOrWrongLengthValidator,FieldNotEmptyValidator,FieldNumberValidator,FieldRangeValidator,FlightCodesValidator,LanguageIsoValidator,ListNotEmptyOrWrongSizeValidator,ListNotEmptyValidator,ListWrongSizeValidator,PackageSearchRequestValidator,PassengerTypeValidator,PaymentDetailsValidator,RegexpValidator,TransportSearchRequestValidator,TravelCompositeValidator
The abstract travel validator which contains default implementation for
TravelValidator.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringGets error id.protected StringGets error message.Gets field path.protected booleanGets optional flag.booleanisValidationRequired(Object target) Checks thatTravelValidatorneeds to be executed for the suppliedtargetobjectprotected voidreject(org.springframework.validation.Errors errors) Register a global error using validator context.voidsetErrorId(String errorId) Sets error id.voidsetErrorMessage(String errorMessage) Sets error message.voidsetFieldPath(String fieldPath) Sets field path.voidsetOptional(boolean optional) Sets optional flag.voidValidate the suppliedtargetobjectMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.validation.Validator
supports, validate
-
Constructor Details
-
AbstractTravelValidator
public AbstractTravelValidator()
-
-
Method Details
-
isValidationRequired
Description copied from interface:TravelValidatorChecks thatTravelValidatorneeds to be executed for the suppliedtargetobject- Specified by:
isValidationRequiredin interfaceTravelValidator- Parameters:
target- the object that is to be validated- Returns:
trueif thisTravelValidatorneeds to be executed
-
validate
public void validate(Object target, org.springframework.validation.Errors errors, boolean ignoreNull) Description copied from interface:TravelValidatorValidate the suppliedtargetobject- Specified by:
validatein interfaceTravelValidator- Parameters:
target- the object that is to be validatederrors- contextual state about the validation processignoreNull- ignore validation for null objects
-
reject
protected void reject(org.springframework.validation.Errors errors) Register a global error using validator context.- Parameters:
errors- contextual state about the validation process
-
getFieldPath
Gets field path.- Specified by:
getFieldPathin interfaceTravelValidator- Returns:
- the field path
-
setFieldPath
Sets field path.- Parameters:
fieldPath- the field path
-
isOptional
protected boolean isOptional()Gets optional flag.- Returns:
- the optional flag
-
setOptional
public void setOptional(boolean optional) Sets optional flag.- Parameters:
optional- the optional flag
-
getErrorId
Gets error id.- Returns:
- the error id
-
setErrorId
Sets error id.- Parameters:
errorId- the error id
-
getErrorMessage
Gets error message.- Returns:
- the error message
-
setErrorMessage
Sets error message.- Parameters:
errorMessage- the error message
-