« Return to Thread: macros parameter type checking

Re: macros parameter type checking

by Nathan Bubna :: Rate this Message:

Reply to Author | View in Thread

#if( $foo.class.name == "java.lang.Integer" )

or just don't give your macro to an untrusted user.  or if you can at
least trust the user to pass a number, then $foo.intValue() is all you
need.

On Fri, Jun 26, 2009 at 10:52 AM, ChadDavis<chadmichaeldavis@...> wrote:

> I have a macro that takes an integer parameter.  AFAIK, there's no
> support for typing in the Velocity language.  How can I verify that
> the parameter is an integer value before doing my velocity macro
> logic?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@...
> For additional commands, e-mail: user-help@...
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...

 « Return to Thread: macros parameter type checking