I have bean definition, e.g.
<bean id="DsdDetectorLogic" class="my class" init-method="init" lazy-init="true" >
<property name="threshold" value="#{ properties.threshold }" />
<property name="lag" value="#{ properties.lag }" />
...
</bean>
I need to add constrains on specific parameter (lag), if this parameter exceeds max value of 3 or min value of 1 , i need it to get a default value of 1. Additionally i need to receive some warning message that this parameter received a default value as a result.
I familiar with a solution of using javax.validation.constraints.Min / Max for the annotation of fields inside the code.
Is it possible to use some spring feature to edit the xml file, or the only solution is to do it from the java object class during the time when setters are invoked?
I will answer my question partially, since i found how i can check the constrains and send a default value through xml, warning message is still a puzzle.
I will use SPeL: