JavaCast

"-->
 JavaCast (type, variable) 

Description

Converts the data type of a ColdFusion variable to pass as an argument to an overloaded method of a Java object. Use only for scalar and string arguments. Can convert to the following types: Boolean, int, long, double, string.

Example

 Within ColdFusion, you use the following code: <cfobject    type = java    CLASS = fooClass name = obj>    <!--- ColdFusion may treat this as a string or a real number --->    <cfset x = 33>    <!--- Perform an explicit cast to an int. --->    <cfset myInt = JavaCast("int", x)>    <cfset void = fooMethod(myInt)>    <!--- Perform an explicit cast to a string. --->    <cfset myString = javaCast("String", x)>    <cfset void = fooMethod(myString)>  </cfobject>  


Inside ColdFusion MX
Inside Coldfusion MX
ISBN: 0735713049
EAN: 2147483647
Year: 2005
Pages: 579

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net