You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On the one hand we have SetOnceConstraintViolation and on the other ErrorMessage.createViolation() with ErrorMessage.createCompositeViolation.
They are quite different, but should have the common base, which this issue suggests to extract. Another aspect of this issue it to create consistent instances of ConstraintViolation throughout the validation library.
The first implementation produces code that creates a ConstraintViolation for a specific option, for this reason it is relatively small. It uses our Expression API, and takes into account that the ConstraintViolation instance expects a printf string format along with a list of parameters for it.
The second implementation is coupled with Rules-based validation codegen. It introduces own entities like: ErrorMessages, ErrorMessage, Template. And something similar to our Expression API from ProtoData: Span, LiteralSpan, ExpressionSpan. Though, it uses Java Poet to "partially" prepare the code. Another aspect is that it doesn't return a printf string, instead it interpolates parameters right into the format string.
So, in the scope of this issue, the following should be done:
Extract the common parts of ContraintValidation creation.
Re-use them in SetOnceConstraintViolation and Rules codegen.
Migrate the remaining code around to PSI/Expression API.
The text was updated successfully, but these errors were encountered:
On the one hand we have
SetOnceConstraintViolation
and on the otherErrorMessage.createViolation()
withErrorMessage.createCompositeViolation
.They are quite different, but should have the common base, which this issue suggests to extract. Another aspect of this issue it to create consistent instances of
ConstraintViolation
throughout the validation library.The first implementation produces code that creates a
ConstraintViolation
for a specific option, for this reason it is relatively small. It uses our Expression API, and takes into account that theConstraintViolation
instance expects aprintf
string format along with a list of parameters for it.The second implementation is coupled with
Rule
s-based validation codegen. It introduces own entities like:ErrorMessages
,ErrorMessage
,Template
. And something similar to our Expression API from ProtoData:Span
,LiteralSpan
,ExpressionSpan
. Though, it uses Java Poet to "partially" prepare the code. Another aspect is that it doesn't return aprintf
string, instead it interpolates parameters right into the format string.So, in the scope of this issue, the following should be done:
ContraintValidation
creation.SetOnceConstraintViolation
andRule
s codegen.The text was updated successfully, but these errors were encountered: