<?xml version="1.0" encoding="Shift_JIS"?>
<!--
  Copyright 2003 The Apache Software Foundation.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.

  $Id: ToolLoader.xml,v 1.5 2005/03/20 11:57:33 tatakaha Exp $
-->
<document>

    <properties>
        <title>ToolLoader</title>
        <author email="sidler@apache.org">Gabriel Sidler</author>
        <translator email="nekop@programmers.jp">木村 貴由</translator>
        <translator email="tatakaha@jajakarta.org">高橋 達男</translator>
        <projectfile>xdocs-ja/generic/menu.xml</projectfile>
        <original>ToolLoader</original>
    </properties>

    <body>

    <section name="ToolLoader Reference Documentation" alias="ToolLoader リファレンスドキュメント">

        <primary>
        <p>
        A view tool that allows template designers to load view tools 
        from within the template. Any object with a public constructor without 
        parameters can be loaded into the context.  This tool is considered
        by the developers to be merely a development tool and inappropriate
        for use in a production setting.
        </p>
        </primary>
        <p>
        このビューツールは、テンプレートデザイナがテンプレートの内部からビューツールをロードすることを可能にします。
        このツールを用いることで、引数無しの public コンストラクタを持つあらゆるオブジェクトをコンテキスト内にロードすることができます。
        このツールは単なる開発ツールであり、本番環境での利用は推奨しません。
        </p>
        
        <toolinfo>
            <version>@@@version@@@, @@@date@@@</version>

            <clazz>org.apache.velocity.tools.generic.ToolLoader</clazz>

            <name>$toolLoader</name>

            <author email="sidler@apache.org">Gabriel Sidler</author>

            <config-example>&lt;tool&gt;
  &lt;key&gt;toolLoader&lt;/key&gt;
  &lt;scope&gt;application&lt;/scope&gt;
  &lt;class&gt;org.apache.velocity.tools.generic.ToolLoader&lt;/class&gt;
&lt;/tool&gt;</config-example>

        </toolinfo>

        <methods/>

    </section>

    <section name="load()">
        <primary>
        <method name="load()">
    
            <abstract>
                Loads an instance of a tool and returns it.
            </abstract>
    
            <signature>
                void load(String class)
            </signature>
            
            <parameters>
                <parameter name="class">
                    The name of the class to instantiate.
                </parameter>
            </parameters>
            
            <description>
                <p>example:</p>
<sourcecode>
#set( $math = $toolLoader.load("org.apache.velocity.tools.generic.MathTool") )
$math.random(1,1000)
</sourcecode>

                <p>Loads MathTool with name $math into the context. Then, its random() function is
                used to generate a random number between 1 and 1000.</p>
            </description>
    
        </method>
        </primary>
        <method name="load()">
    
            <abstract>
                ツールのインスタンスをロードし返却します。
            </abstract>
    
            <signature>
                void load(String class)
            </signature>
            
            <parameters>
                <parameter name="class">
                    インスタンス化するクラス名。
                </parameter>
            </parameters>
            
            <description>
                <p>例:</p>
<sourcecode>
#set( $math = $toolLoader.load("org.apache.velocity.tools.generic.MathTool") )
$math.random(1,1000)
</sourcecode>

                <p>MathTool を $math という名前でコンテキストへロードします。
                この random() 関数は、1から1000までのランダムな数字を生成します。</p>
            </description>
    
        </method>
    </section>
 </body>
</document>

