I am trying to parse a speL expression fo validation purposes. But while parsing it I actually want to parser to consider the data type of # parameters while parsing
For example:
!#res== “STRING”
the value that res actually has is of Type opject so this expression is invalid as ! can be applied to objects but normal parsing actually doesn’t give erro on this.
Additional Doubt:
- is it possible in some way to type check nested speL expression . Fo Example:
Expression #user.getName()==true
parser actually check data type of user , consider it is an object of User class
secondly if that object contains .getName function if yes what return type -> here String
now check if left & right of == have same type or not.
I tried using StandardEvaluationContext and provided dummy variable context but problem was it was evaluating with actual values , but I only want type checking.
for that too searched for ParserContext but didn’t get any solution.
Satwik Agrawal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.