Hi all,
In case anyone is interested, I made a cool tool that works with null.
As of the moment, there is no documentation except for the tests.
The class:
http://sylow.no-ip.com/pub/apache/jakarta/velocity/tools/NullTool.java
The test:
http://sylow.no-ip.com/pub/apache/jakarta/velocity/tools/NullToolTest.java
Simple manual:
- Putting the tool in the context.
context.put("null", new NullTool());
- Using it.
-- Setting a reference null: (Assuming that $ctx is the Context running.)
$null.setNull($ctx, "foo")
-- Check if a reference is null:
#if ($null.isNull($foo)) it's null #end
-- Check if a reference is not null:
#if ($null.isNotNull($foo)) it's not null #end
Might be useful until the null issues get implemented into Velocity.
Any comments welcome.
Best regards,
-- Shinobu Kawai
--
Shinobu Kawai <[EMAIL PROTECTED]>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]