velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shinobu Kawai <>
Subject Re: EscapeTool (and velocity-tool best practices)
Date Wed, 08 Dec 2004 21:00:19 GMT
Hi Mike,

> I started using EscapeTool today (since it was far more comprehensive that my
> primitive and misnamed URLEncoder tool), and noticed that it only took
> String arguments.


> In general, should Velocity tools that operate on a String operate on an
> Object instead and perform a object.toString() conversion first?  Or at
> least provide Object argument wrapper methods to call the String argument
> methods?

Sounds reasonable to take Object parameters.  Quoting Nathan, "Java,
being strongly-typed, distinguishes many things that VTL tries not to
distinguish".  Just be sure to check for null.
## But hey, RenderTool takes only Strings for VTL.

> Obviously, I can easily subclass EscapeTool even if no one else agrees with
> me and add "public String html(Object object)"-like methods, but I'm curious
> what we consider to be best-practices....

Overloading in Tools currently gives strange behaviour.
## are these duplicates?

Best regards,
-- Shinobu Kawai

Shinobu Kawai <>

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

View raw message