Module ch.ralscha.extdirectspring
Package ch.ralscha.extdirectspring.bean
Class EdFormPostResult.Builder
java.lang.Object
ch.ralscha.extdirectspring.bean.EdFormPostResult.Builder
- Enclosing class:
EdFormPostResult
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds one error message to a specific field.addError(org.springframework.validation.BindingResult bindingResult) addErrors(Locale locale, org.springframework.context.MessageSource messageSource, org.springframework.validation.BindingResult bindingResult) Extracts errors from the bindingResult and inserts them into the error properties.addErrorsResolveCode(Locale locale, org.springframework.context.MessageSource messageSource, org.springframework.validation.BindingResult bindingResult) resolve the messages codes along the implementation described inDefaultMessageCodesResolver
stop at first message found
method is useless if no specific validation message have been set (example: jakarta.validation.constraints.NotNull.message.fax=Fax number is mandatory)
it will behaveaddErrors(Locale, MessageSource, BindingResult)with a big overheadabstract EdFormPostResultbuild()fail()abstract EdFormPostResult.Builderabstract EdFormPostResult.Buildersuccess()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
result
-
putResult
-
build
-
addErrors
public EdFormPostResult.Builder addErrors(Locale locale, org.springframework.context.MessageSource messageSource, org.springframework.validation.BindingResult bindingResult) Extracts errors from the bindingResult and inserts them into the error properties. Sets the property success to false if there are errors. Sets the property success to true if there are no errors.- Parameters:
locale-messageSource-bindingResult-builder-
-
addErrorsResolveCode
public EdFormPostResult.Builder addErrorsResolveCode(Locale locale, org.springframework.context.MessageSource messageSource, org.springframework.validation.BindingResult bindingResult) resolve the messages codes along the implementation described inDefaultMessageCodesResolver
stop at first message found
method is useless if no specific validation message have been set (example: jakarta.validation.constraints.NotNull.message.fax=Fax number is mandatory)
it will behaveaddErrors(Locale, MessageSource, BindingResult)with a big overhead- Parameters:
locale- locale for internationalizationmessageSource- source of validation code and messagebindingResult- Errors list to resolve- Returns:
- this
for easy chaining
invalid reference
#ExtDirectFormPostResult
-
addError
public EdFormPostResult.Builder addError(org.springframework.validation.BindingResult bindingResult) -
fail
-
success
-
addError
Adds one error message to a specific field. Does not overwrite already existing errors.- Parameters:
field- the name of the fielderror- the error message
-
addErrors
-