velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Llewellyn Falco" <isid...@setgame.com>
Subject Re: Problems with Overloaded Methods
Date Fri, 06 May 2005 16:58:50 GMT
I had a simular problem with
asJavascript(String s)
asJavascript(Number n)

and my work arround was to overload a thrid time as

asJavascript(Object o)
{
  if (o ==  null)                        {return "null";}
  else if (o instanceof Number){return asJavascript((Number)o);}
  else                                      { return 
asJavascript(o.toString);}
}


it's a bit o cludge, but ....



llewellyn. 


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


Mime
View raw message