|
@@ -237,13 +237,13 @@ filesizes of all files a <code><fileset/></code> caught.</p> |
|
|
</target> |
|
|
</target> |
|
|
</project> |
|
|
</project> |
|
|
</pre></blockquote> |
|
|
</pre></blockquote> |
|
|
<p>We want to use the Java API. Because we don´t want always typing the package signature |
|
|
|
|
|
|
|
|
<p>We want to use the Java API. Because we don't want always typing the package signature |
|
|
we do an import. Rhino knows two different methods for import statements: one for packages |
|
|
we do an import. Rhino knows two different methods for import statements: one for packages |
|
|
and one for a single class. By default only the <i>java</i> packages are available, so |
|
|
and one for a single class. By default only the <i>java</i> packages are available, so |
|
|
<i>java.lang.System</i> can be directly imported with <code>importClass/importPackage</code>. |
|
|
<i>java.lang.System</i> can be directly imported with <code>importClass/importPackage</code>. |
|
|
For other packages you have to prefix the full classified name with <i>Package</i>. |
|
|
|
|
|
For example ant´s <i>FileUtil</i> class can be imported with |
|
|
|
|
|
<code>importClass(<b>Package</b>.org.apache.tools.ant.util.FileUtils)</code> |
|
|
|
|
|
|
|
|
For other packages you have to prefix the full classified name with <i>Packages</i>. |
|
|
|
|
|
For example Ant's <i>FileUtils</i> class can be imported with |
|
|
|
|
|
<code>importClass(<b>Packages</b>.org.apache.tools.ant.util.FileUtils)</code> |
|
|
<br> |
|
|
<br> |
|
|
The <code><script></code> task populates the Project instance under |
|
|
The <code><script></code> task populates the Project instance under |
|
|
the name <i>project</i>, so we can use that reference. Another way is to use its given name |
|
|
the name <i>project</i>, so we can use that reference. Another way is to use its given name |
|
|