Is there a global setting in Mapstruct that will trim a string value prior to setting it to a destination bean property -


is possible trim string value before set against bean property of type string in destination bean?

dozer offers such facility through mapping configuration example,

<configuration>     <trim-strings>true</trim-strings> </configuration> 

also see dozer global configuration

with mapstruct 1.0.0.final can achieve through expressions or before/after mapping customization.

but wanted know if there better way handle such use cases.

thanks in advance.

it appears mapstruct in current form not support this.

however 1 can achieve effect custom mapper methods, example implement class method trims string argument passed , reference class in use attribute of @mapper annotation. more @ invoking other mappers

if require fine gained access control use selection based on qualifiers

i made aware of these approaches in response question posted in mapstruct google group


Comments