Consider the other two enum values, the
..._UNLESS_BEAN_PROPERTY_READ_METHOD ones. They both want to create a
(fake) property called "isActive". But instead, because it's also a
real Java Bean property read method, instead it's exposed as a pure
method. Hence the "unless" part. In the case of the third enum,
"METHOD_ONLY", it wants to expose "isActive" as a method. But then,
because it's also a real Java Bean property read method, instead it's
exposed as a method. Which is the same thing, so, nothing has changed,
the policy wanted the same outcome.

On Sat, May 18, 2024 at 8:02 PM Simon Hartley
<scrhart...@yahoo.co.uk.invalid> wrote:
>
> About ZeroArgumentNonVoidMethodPolicy.METHOD_ONLY.
>
> If I set:
> recordZeroArgumentNonVoidMethodPolicy=freemarker.ext.beans.ZeroArgumentNonVoidMethodPolicy.METHOD_ONLY
>
> and add this method to a record:
>
> public boolean isActive() {
>     return false;
> }
>
>  Since it's a bean property read method, I can successfully call:
> ${myRecord.active?c}
>
>
> Since bean property read methods take zero arguments and have non-void 
> returns,
> I was wondering why ZeroArgumentNonVoidMethodPolicy.METHOD_ONLY got spared 
> the "_UNLESS_BEAN_PROPERTY_READ_METHOD" treatment.
>
>
> Cheers,
> Simon
>
>
>
>
>
>
> On Saturday 18 May 2024 at 17:20:38 BST, Daniel Dekany <ddek...@apache.org> 
> wrote:
>
>
>
>
>
> Anyone else plans to try this before release? (Because if not, there's
> no need to wait more.)



-- 
Best regards,
Daniel Dekany

Reply via email to