commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frank Grimes <>
Subject OGNL expression validation
Date Wed, 12 Dec 2012 20:18:52 GMT
Hi All,

I was wondering if there was a way to determine if a given expression is valid for a particular
i.e. if the properties/methods specified actually exist.

Something along the lines of Ognl.isValidExpression(Root.class, "root.branch.leaf") 


class Branch {
  public Leaf leaf;
class Root {
  public Branch branch;

Note that I don't need/want to pass in an instance to evaluate getValue on, I just want to
know if "root.branch.leaf" is valid.
I tried passing in a new instance of the type but then I was getting the following error:

ognl.OgnlException: source is null for getProperty(null, "leaf")


Frank Grimes
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message