You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Shinobu Kawai <sh...@gmail.com> on 2004/11/13 09:29:13 UTC

Re: creating new instances

Hi Larry,

> Is it possible to create new instances of a class from a velocity
> template?  I'd like to do something like "#set($foo =
> com.foo.bar.class.getConstructor().newInstance())".  I know that doesn't
> work, but is there another way to achieve that?
I just found this Tool:
  http://jakarta.apache.org/velocity/tools/generic/ToolLoader.html

Looks like it's going to disappear in 1.2, though.
  http://jakarta.apache.org/velocity/tools/javadoc/org/apache/velocity/tools/generic/ToolLoader.html

Best regards,
-- Shinobu Kawai

-- 
Shinobu Kawai <sh...@gmail.com>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org