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.

Oops.

> 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.
  http://issues.apache.org/bugzilla/show_bug.cgi?id=13637
  http://issues.apache.org/bugzilla/show_bug.cgi?id=16707
## are these duplicates?

Best regards,
-- Shinobu Kawai

--
Shinobu Kawai <[EMAIL PROTECTED]>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to