<html>
<head>
<link href="mmres://user_interface_reference.css" rel="stylesheet" type="text/css">
<title>JAVACAST</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
   <div id="">
   <table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
      <tr> 
         <td valign="top" class="name">JAVACAST</td>
         <td valign="top" nowrap class="compatibility">&nbsp;</td>
      </tr>
      <tr>
         <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
      </tr>


    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title"></span>
<p>
Java IuWFNg̃I[o[[hꂽ\bhɈƂēn ColdFusion ϐ̃f[^^Cvϊ܂BXJѕ݂̈̂Ɏgp܂B
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">߂l</span>
<p>
type Ŏw肳ꂽ^Cv̕ϐ
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">JeS</span>
<p>
֐
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">֐̃V^bNX</span><pre>JavaCast(type, variable)
</pre>    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">֘A</span>
<p>
CreateObjectAcfobject
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">p[^</span>
<p>

</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">gp@</span>
<p>
cfobject ^O Java IuWFNg쐬ĂÃ\bh 1 Ăяo܂ł̊ԂɎgp܂B\bhI[o[[hꂽ𕡐ꍇAeɂ JavaCast ĂяoKv܂BJavaCast ́A\bhI[o[[hĂꍇɂ̂ݎgp܂B́A\bh܂܂Ȑ̈邽߂ł͂ȂÃf[^^Cv邽߂łB 
</p>

<p>
JavaCast ́AGȃIuWFNgԂ̃LXgAʃNXւ̃LXgɂ͎gpł܂B 
</p>

<p>
̗Ɏ悤ɁAJava IuWFNgɑ΂Ăяȍꍇɂ݂̂̊֐̌ʂgp܂B
</p>
<pre>&lt;cfscript&gt;
    x = CreateObject(&quot;java&quot;, &quot;test.Hello&quot;);
    x.init();
    ret = x.sayHello(JavaCast(&quot;null&quot;, &quot;&quot;));
&lt;/cfscript&gt;
</pre><table>
  <tr valign="top">
    <td width="30"><strong>x: </strong></td>
    <td>JavaCast(&quot;null&quot;,&quot;&quot;) ̌ʂ ColdFusion ϐɊ蓖ĂȂłB\Ȃʂ܂B </td>
  </tr>
</table>
<p>
ɕۊǂꂽ ColdFusion ^Cv Java XJ^Cv̊Ԃ 1  1 ̑Ή֌WȂ߂ɁAsłȂϊ܂B 
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title"></span>
<p>
fooClass NX̃\bh fooMethod ́AI[o[[hꂽ 1 ̈܂BfooClass NX͎̂悤ɒ`Ă܂B 
</p>
<pre>public class fooClass {
   public fooClass () {
   }
   public String fooMethod(String arg) {
      return &quot;͕łB&quot;;
   }
   public String fooMethod(int arg) {
      return &quot;͐łB&quot;;
   }
}
</pre>
<p>
ColdFusion ł́ÃR[hgp܂B
</p>
<pre>&lt;cfobject
action=&quot;create&quot;
    type = &quot;java&quot;
    class = &quot;fooClass&quot; 
    name = obj&gt;

&lt;!--- ColdFusion ́A𕶎܂͎Ƃď܂B ---&gt;
&lt;cfset x = 33&gt;

ւ̖IȃLXgsĂ fooMethod Ăяo&lt;br&gt;
&lt;cfset myInt = JavaCast(&quot;int&quot;, x)&gt; 
&lt;cfoutput&gt;#obj.fooMethod(myInt)#&lt;/cfoutput&gt;
&lt;br&gt;&lt;br&gt;
ւ̖IȃLXgsĂ fooMethod Ăяo&lt;br&gt;
&lt;cfset myString = javaCast(&quot;String&quot;, x)&gt; 
&lt;cfoutput&gt;#obj.fooMethod(myString)#&lt;/cfoutput&gt;
</pre>
         </td>
      </tr>
   </table>
   </div>
<div id="TYPE">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">TYPE</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

 </td>
  </tr>
  <tr>
    <td>ϐϊf[^^CvłB
<ul>

<li>boolean</li>

<li>int</li>

<li>long</li>

<li>float</li>

<li>double</li>

<li>string</li>

<li>null</li>
</ul>


  </td>
  </tr>
  </table>
</div>
<div id="VARIABLE">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">VARIABLE</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

 </td>
  </tr>
  <tr>
    <td>XJ܂͕̃^Cvێ ColdFusion ϐłBtype  null ̏ꍇA&quot;&quot; łȂ
΂Ȃ܂B


  </td>
  </tr>
  </table>
</div>

  </body>
</html>
