> How does it differ from existing syntax? See the examples here:

> propertyChain : term '.' propertyChain
>               | term '?.' propertyChain
>               | term;


Right now you can only check if property is a null when chaining to another 
property to prevent a NPE.

Maybe even better syntax would be:

> value="prop?"
> value="prop.a.b.c?"
> value="prop?.a?.b?.c?"


Denis

Aug 23, 2011 v 1:26 PM, Igor Drobiazko:

> How does it differ from existing syntax? See the examples here:
> 
> http://tapestry.apache.org/property-expressions.html
> 
> On Tue, Aug 23, 2011 at 1:14 PM, Denis Stepanov 
> <[email protected]>wrote:
> 
>> Hello,
>> 
>> I would like to suggest a new syntax for checking if the property
>> expression value is a null:
>> 
>>> value="?prop"
>> 
>> 
>> will return false if property "prop" is null or true if not
>> 
>>> value="?prop.a.b.c"
>> 
>> 
>> will return false if property "c" is null or true if not
>> 
>>> value="?prop?.a?.b?.c"
>> 
>> will return false if one of the properties is null.
>> 
>>> value="prop"
>> 
>> 
>> will call toString to convert it to a boolean, is not the best way how to
>> implement a null check.
>> 
>> We have isNotNull component, which I would like to eliminate.
>> 
>> Denis
>> 
>> 
>> 
>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>> 
>> 
> 
> 
> -- 
> Best regards,
> 
> Igor Drobiazko
> http://tapestry5.de

Reply via email to