<?xml version="1.0" encoding="Shift_JIS"?>

<document>

 <properties>
  <title>Velocity User Guide</title>
  <author email="jvanzyl@zenplex.com">Velocity Documentation Team</author>
  <author email="jcastura@kw.igs.net">John Castura</author>
  <translator>熊坂祐二</translator>
  <translator>新穂洋史</translator>
  <translator>高橋達男</translator>
  <translator>野瀬直樹</translator>
  <original>user-guide</original>
 </properties>

<body>

<section name="Table of Contents" alias="目次">


<primary>
<ol>
<li><a href="#About this Guide">About this Guide</a></li>
<li><a href="#What is Velocity?">What is Velocity?</a></li>
<li><a href="#What can Velocity do for me?">What can Velocity do for me?</a>
    <ol>
        <li><a href="#The Mud Store Example">The Mud Store example</a></li>
    </ol>
</li>
<li><a href="#Velocity Template Language (VTL): An
Introduction">Velocity Template Language (VTL): An Introduction</a></li>
<li><a href="#Hello Velocity World!">Hello Velocity World!</a></li>
<li><a href="#Comments">Comments</a></li>
<li><a href="#References">References</a>
    <ol>
        <li><a href="#Variables">Variables</a></li>
        <li><a href="#Properties">Properties</a></li>
        <li><a href="#Methods">Methods</a></li>
    </ol>
</li>
<li><a href="#Formal Reference Notation">Formal Reference Notation</a></li>
<li><a href="#Quiet Reference Notation">Quiet Reference Notation</a></li>
<li><a href="#Getting literal">Getting literal</a>
    <ol>
        <li><a href="#Currency">Currency</a></li>
        <li><a href="#Escaping Valid VTL References">Escaping Valid VTL References</a></li>
    </ol>
</li>
<li><a href="#Case Substitution">Case Substitution</a></li>
<li><a href="#Directives">Directives</a>
    <ol>
        <li><a href="#Set">Set</a></li>
        <li><a href="#String Literals">String Literals</a></li>
        <li><a href="#Conditionals">If-Else Statements</a>
            <ol>
                <li><a href="#Relational and Logical Operators">Relational and Logical
                Operators</a></li>
            </ol>
        </li>
        <li><a href="#Loops">Foreach Loops</a></li>
        <li><a href="#Include">Include</a></li>
        <li><a href="#Parse">Parse</a></li>
        <li><a href="#Stop">Stop</a></li>
        <li><a href="#Velocimacros">Velocimacros</a></li>
    </ol>
</li>
<li><a href="#Escaping VTL Directives">Escaping VTL Directives</a></li>
<li><a href="#VTL: Formatting Issues">VTL: Formatting Issues</a></li>
<li><a href="#Other Features and Miscellany">Other Features and Miscellany</a>
    <ol>
        <li><a href="#Math">Math</a></li>
        <li><a href="#Range Operator">Range Operator</a></li>
        <li><a href="#Advanced Issues: Escaping and !">Advanced Issues: Escaping and
        !</a></li>
        <li><a href="#Velocimacro Miscellany">Velocimacro Miscellany</a></li>
        <li><a href="#String Concatenation">String Concatenation</a></li>
    </ol>
</li>
<li><a href="#Feedback">Feedback</a></li>
</ol>
</primary>
<ol>
<li><a href="#About this Guide">このガイドについて</a></li>
<li><a href="#What is Velocity?">Velocityとは?</a></li>
<li><a href="#What can Velocity do for me?">Velocity で何ができるの?</a>
    <ol>
        <li><a href="#The Mud Store Example">Mud Store のサンプル</a></li>
    </ol>
</li>
<li><a href="#Velocity Template Language (VTL): An Introduction">Velocity テンブレート言語 (VTL): はじめに</a></li>
<li><a href="#Hello Velocity World!">Hello Velocity World!</a></li>
<li><a href="#Comments">コメント</a></li>
<li><a href="#References">リファレンス</a>
    <ol>
        <li><a href="#Variables">変数</a></li>
        <li><a href="#Properties">プロパティ</a></li>
        <li><a href="#Methods">メソッド</a></li>
    </ol>
</li>
<li><a href="#Formal Reference Notation">正式リファレンス表記</a></li>
<li><a href="#Quiet Reference Notation">沈黙リファレンス表記</a></li>
<li><a href="#Getting literal">リテラルを取得する</a>
    <ol>
        <li><a href="#Currency">通貨</a></li>
        <li><a href="#Escaping Valid VTL References">有効なVTL リファレンスをエスケープする</a></li>
    </ol>
</li>
<li><a href="#Case Substitution">大文字小文字置換</a></li>
<li><a href="#Directives">指示子</a>
    <ol>
        <li><a href="#Set">#set</a></li>
        <li><a href="#String Literals">文字列リテラル</a></li>
        <li><a href="#Conditionals">if-else 文</a>
            <ol>
                <li><a href="#Relational and Logical Operators">関係演算子と論理演算子</a></li>
            </ol>
        </li>
        <li><a href="#Loops">#foreach ループ</a></li>
        <li><a href="#Include">#include</a></li>
        <li><a href="#Parse">#parse</a></li>
        <li><a href="#Stop">#stop</a></li>
        <li><a href="#Velocimacros">Velocimacro</a></li>
    </ol>
</li>
<li><a href="#Escaping VTL Directives">VTL 指示子をエスケープする</a></li>
<li><a href="#VTL: Formatting Issues">VTL のフォーマット</a></li>
<li><a href="#Other Features and Miscellany">その他の機能</a>
    <ol>
        <li><a href="#Math">Math</a></li>
        <li><a href="#Range Operator">範囲演算子</a></li>
        <li><a href="#Advanced Issues: Escaping and !">高度な問題: エスケープと「!」</a></li>
        <li><a href="#Velocimacro Miscellany">Velocimacro いろいろ</a></li>
        <li><a href="#String Concatenation">文字列の連結</a></li>
    </ol>
</li>
<li><a href="#Feedback">フィードバック</a></li>
</ol>


</section>

<section name="About this Guide" alias="このガイドについて">

<primary>
 <p>
    The Velocity User Guide is intended to help page designers and
    content providers get acquainted with Velocity and the syntax of its
    simple yet powerful scripting language, the Velocity Template
    Language (VTL). Many of the examples in this guide deal with using
    Velocity to embed dynamic content in web sites, but all VTL examples
    are equally applicable to other pages and templates.
 </p>
</primary>
<p>
Velocity ユーザガイドは、ページデザイナやコンテンツ・プロパイダに
Velocity と、 Velocity の単純ながらも強力なスクリプト言語である  Velocity
テンプレート言語 (VTL:Velocity Template Language)
の構文を理解していただくことを目的としています。

このガイドで出てくる例の多くは、Web サイトで動的に内容を埋め込むための
Velocity の使い方を扱っていますが、VTL の例はすべて、
その他のページやテンプレートにも同様に適用できます。
</p>

<primary>
 <p>
    Thanks for choosing Velocity!
 </p>
</primary>
<p>
Velocity を選んでいただきありがとうございます。
</p>
</section>

<section name="What is Velocity?" alias="Velocityとは?">

<primary>
 <p>
    Velocity is a Java-based template engine. It permits web page
    designers to reference methods defined in Java code. Web designers
    can work in parallel with Java programmers to develop web sites
    according to the Model-View-Controller (MVC) model, meaning that web
    page designers can focus solely on creating a well-designed site,
    and programmers can focus solely on writing top-notch code. Velocity
    separates Java code from the web pages, making the web site more
    maintainable over the long run and providing a viable alternative to
    <a href="http://java.sun.com/products/jsp/">Java Server Pages</a>
    (JSPs) or <a href="http://www.php.net/">PHP</a>.
 </p>
</primary>
<p>
Velocity は、Java ベースのテンプレートエンジンです。
Velocityを使うと、Web ページデザイナが Java コードで定義されたメソッドを参照できます。Model-View-Controller(MVC) モデルに基づく Web サイト開発で、
Java プログラマと Web デザイナが並行して作業できます。つまり、
Web ページデザイナは素晴らしいデザインのサイトをつくることだけに集中し、
プログラマは最高のコードを書くことだけに集中できるということです。
Velocity は、Java コードを Web ページから切り離し、長い目で見ればより保守しやすい
Web サイトを実現し、
<a href="http://java.sun.com/products/jsp/">Java Server Pages</a>(JSP) や <a href="http://www.php.net/">PHP</a> の実現可能な代替案を提供します。
</p>

<primary>
 <p>
    Velocity can be used to generate web pages, SQL, PostScript and
    other output from templates. It can be used either as a standalone
    utility for generating source code and reports, or as an integrated
    component of other systems. When complete, Velocity will provide
    template services for the <a
    href="http://java.apache.org/turbine/">Turbine</a> web application
    framework. Velocity+Turbine will provide a template service that
    will allow web applications to be developed according to a true MVC
    model.
 </p>
</primary>
<p>
Velocity は Web ページや SQL、PostScript といった出力をテンプレートから生成するのに
使えます。ソースコードや帳票を生成する単体のユーティリティとしても使えますし、
他のシステムに統合されるコンポーネントとしても使えます。
Velocityは、<a href="http://jakarta.apache.org/turbine/">Turbine</a>
Web アプリケーションフレームワークでテンプレートサービスを提供します。
Velocity と Turbine の組み合わせで、真の MVC モデルにしたがって
Web アプリケーションを開発できるテンプレートサービスを提供します。
</p>

</section>

<section name="What can Velocity do for me?" alias="Velocity で何ができるの?">
<subsection name="The Mud Store Example" alias="Mud Store のサンプル ">
<primary>
   <p>
    Suppose you are a page designer for an online store that specializes
    in selling mud. Let's call it "The Online Mud Store". Business is
    thriving. Customers place orders for various types and quantities of
    mud. They login to your site using their username and password,
    which allows them to view their orders and buy more mud. Right now,
    Terracotta Mud is on sale, which is very popular. A minority of your
    customers regularly buys Bright Red Mud, which is also on sale,
    though not as popular and usually relegated to the margin of your
    web page. Information about each customer is tracked in your
    database, so one day the question arises, Why not use Velocity to
    target special deals on mud to the customers who are most interested
    in those types of mud?
   </p>
</primary>
<p>
あなたが陶土を専門に扱うオンラインストアのページデザイナであるとしましょう。
オンラインストアの名前は「Online Mud Store」としましょう。
商売は繁盛しています。顧客はいろいろな種類や量の商品を発注します。
サイトにはユーザー名とパスワードを使用してログインし、
注文内容を確認したり、さらに商品を購入したりできます。
現在、テラコッタ土 [訳注：素焼き用の陶土] はセール中で、とても人気があります。
赤土もセール中ですが、あまり人気が無く、少数の顧客が定期的に買うぐらいで、
いつもは Web ページの片隅に追いやられています。
各顧客に関する情報 [購買履歴など] はデータベースに記録されます。
そんなある日、こんな疑問が湧きます。「特別セールを行う時に、
セール対象の商品に最も興味を持っている顧客をターゲットとするのに
Velocity を使うのはどうだろう？」
</p>

<primary>
   <p>
    Velocity makes it easy to customize web pages to your online
    visitors. As a web site designer at The Mud Room, you want to make
    the web page that the customer will see after logging into your
    site.
   </p>
</primary>
<p>
Velocity なら、オンライン訪問者ごとに Web ページを簡単にカスタマイズできます。
「The Mud Room」の Web サイトデザイナであるあなたは、顧客がサイトログイン後に見る
Web ページを作ろうと思っています。
</p>

<primary>
   <p>
    You meet with software engineers at your company, and everyone has
    agreed that <em>$customer</em> will hold information pertaining to
    the customer currently logged in, that <em>$mudsOnSpecial</em> will
    be all the types mud on sale at present. The <em>$flogger</em>
    object contains methods that help with promotion. For the task at
    hand, let's concern ourselves only with these three references.
    Remember, you don't need to worry about how the software engineers
    extract the necessary information from the database, you just need
    to know that it works. This lets you get on with your job, and lets
    the software engineers get on with theirs.
   </p>
</primary>
<p>
会社でソフトウェアエンジニアと打ち合わせをした結果、
<em>$customer</em> に現在ログインしている顧客に関する情報を保持し、
<em>$mudsOnSpecial</em> で現在セール中の全ての種類の商品の情報を保持することに
なりました。 
<em>$flogger</em> オブジェクトには、宣伝に役立つメソッドが入っています。
当面の作業では、これらの3つのリファレンスにだけ注目しましょう。
ソフトウェアエンジニアがどのように必要な情報をデータベースから抽出するかについては
気にしなくてよく、
その情報が使えることだけ知っていればよいということ注目してください。
つまり、あなたもソフトウェアエンジニアも、自分の仕事にだけ注力できるということです。
</p>

<primary>
   <p>
    You could embed the following VTL statement in the web page:
   </p>
</primary>
<p>
以下の VTL 文を Web ページに埋め込みます。
</p>

<source><![CDATA[
<HTML>
<BODY>
Hello $customer.Name!
<table>
#foreach( $mud in $mudsOnSpecial )
   #if ( $customer.hasPurchased($mud) )
      <tr>
        <td>
          $flogger.getPromo( $mud )
        </td>
      </tr>
   #end
#end
</table>
</BODY>
]]></source>

<primary>
   <p>
    The exact details of the <em>foreach</em> statement will be
    described in greater depth shortly; what's important is the impact
    this short script can have on your web site. When a customer with a
    penchant for Bright Red Mud logs in, and Bright Red Mud is on sale,
    that is what this customer will see, prominently displayed. If
    another customer with a long history of Terracotta Mud purchases
    logs in, the notice of a Terracotta Mud sale will be front and
    center. The flexibility of Velocity is enormous and limited only by
    your creativity.
   </p>
</primary>
<p>
<em>foreach</em> 文の詳細は後段で説明しますが、
ここで重要なのは、この短いスクリプトがあなたの Web サイトにあたえるインパクトです。
赤土を好む顧客がログインしたとき、赤土がセール中であれば、
この顧客向けに、赤土がセール中であることを特に目につくように表示します。
テラコッタ土購入歴の長い顧客がログインしたときには、
テラコッタ土のセールのお知らせを一番目立つ場所に表示します。
Velocityの柔軟性は極めて高く、あとはあなたの創造力次第です。
</p>

<primary>
   <p>
    Documented in the VTL Reference are the many other Velocity
    elements, which collectively give you the power and flexibility you
    need to make your web site a web <em>presence</em>. As you get more
    familiar with these elements, you will begin to unleash the power of
    Velocity.
   </p>
</primary>
<p>
<a href="vtl-reference-guide.html">VTLリファレンス</a>では、その他にもたくさんの Velocity 要素が記述されており、
これらを組み合わせることで、
Web サイトの<em>存在感</em> を高めるのに必要なパワーと柔軟性が得られます。
これらの要素に詳しくなれば、Velocity のパワーをさらに発揮できるでしょう。
</p>

</subsection>

</section>

<section name="Velocity Template Language (VTL): An Introduction" alias="Velocity テンブレート言語 (VTL): はじめに">

<primary>
 <p>
    The Velocity Template Language (VTL) is meant to provide the
    easiest, simplest, and cleanest way to incorporate dynamic content
    in a web page. Even a web page developer with little or no
    programming experience should soon be capable of using VTL to
    incorporate dynamic content in a web site.
 </p>
</primary>
<p>
Velocity テンプレート言語(VTL:Velocity Template Language) は、
Web ページに動的な内容を取り込むのに最も簡単、単純で、
無駄のない方法となることを目標としています。
ほとんどプログラミング経験のない Web ページ開発者でも、
VTL を使えばすぐに、動的な内容を Web サイトに取り込めるようになるはずです。
</p>

<primary>
 <p>
    VTL uses <em>references</em> to embed dynamic content in a web site,
    and a variable is one type of reference. Variables are one type of
    reference that can refer to something defined in the Java code, or
    it can get its value from a VTL <em>statement</em> in the web page
    itself. Here is an example of a VTL statement that could be embedded
    in an HTML document:
 </p>
</primary>
<p>
VTL では Web サイトにおいて動的な内容を埋め込むのに<em>リファレンス</em> を使いますが、
変数はその一種です。変数とは Java コードで定義したものを参照するリファレンスの一種で、
Web ページ内の VTL <em>文</em> から変数の値を取得できます。 
HTML 文書に埋め込むことができる VTL 文の例を次に示します：
</p>

<source><![CDATA[
#set( $a = "Velocity" )
]]></source>

<primary>
 <p>
    This VTL statement, like all VTL statements, begins with the
    <em>#</em> character and contains a directive: <em>set</em>. When an
    online visitor requests your web page, the Velocity Templating
    Engine will search through your web page to find all <em>#</em>
    characters, then determine which mark the beginning of VTL
    statements, and which of the <em>#</em> characters that have nothing
    to do with VTL.
 </p>
</primary>
<p>
全ての VTL 文がそうであるように、この VTL 文は 「<em>#</em>」
から始まって、<em>set</em> という指示子を含みます。
Webページが要求されたとき、Velocity テンプレートエンジンは 
Web ページを走査して全ての 「<em>#</em>」を見つけ、
それぞれについて、どれが VTL 文の始まりでどれが VTL と無関係かを判定します。
</p>

<primary>
 <p>
    The <em>#</em> character is followed by a directive, <em>set</em>.
    The <em>set</em> directive uses an expression (enclosed in brackets)
    -- an equation that assigns a <em>value</em> to a <em>variable</em>.
    The variable is listed on the left hand side and its value on the
    right hand side; the two are separated by an <em>=</em> character.
 </p>
</primary>
<p>
「<em>#</em>」の後に指示子(<em>set</em>)が続いています。
<em>set</em> 指示子は、(括弧で囲まれた)式 ─ <em>変数</em> に<em>値</em> を割り当てる
等式 ─ を使います。変数は左側で値は右側になります。この2つは、「<em>=</em>」で区切られます。
</p>

<primary>
 <p>
    In the example above, the variable is <em>$a</em> and the value is
    <em>Velocity</em>. This variable, like all references, begins with
    the <em>$</em> character. Values are always enclosed in quotes; with
    Velocity there is no confusion about data types, as only strings
    (text-based information) may be passed to variables.
 </p>
</primary>
<p>
上の例では、変数は $a で値は Velocity です。
全てのリファレンスがそうであるように、この変数は 「<em>$</em>」で始まります。
値は常に引用符で囲まれます。Velocity では、文字列 (テキストに基づく情報)
だけが変数に渡されるので、データ型に対する混乱は発生しません。
</p>

<primary>
 <p>
    The following rule of thumb may be useful to better understand how
    Velocity works: <strong>References begin with <em>$</em> and are
    used to get something. Directives begin with <em>#</em> and are used
    to do something.</strong>
 </p>
</primary>
<p>
以下の簡単なルールが、Velocity がどのように動作するかをさらに理解するのに役立つでしょう。
<strong>
リファレンスは、「<em>$</em>」 から始まって、何かを取得するのに使います。
指示子は、「<em>#</em>」 から始まって、何かを行うのに使います。</strong>
</p>

<primary>
 <p>
     In the example above, <em>#set</em> is used to assign a value to a
     variable. The variable, <em>$a</em>, can then be used in the
     template to output "Velocity".
 </p>
</primary>
<p>
上の例では、<em>#set</em> は、値を変数に割り当てるのに使われます。
変数 (<em>$a</em>) は、「Velocity」を出力するのにテンプレートで使うことができます。
</p>

</section>

<section name="Hello Velocity World!" alias="Hello Velocity World!">

<primary>
 <p>
    Once a value has been assigned to a variable, you can reference the
    variable anywhere in your HTML document. In the following example, a
    value is assigned to <em>$foo</em> and later referenced.
 </p>
</primary>
<p>
一旦変数に値が割り当てられたら、HTML 文書のどこででも変数を参照できます。
下記の例では、値は <em>$foo</em> に割り当てられて後で参照されます。
</p>

<source><![CDATA[
<html>
<body>
#set( $foo = "Velocity" )
Hello $foo World!
</body>
<html>
]]></source>

<primary>
 <p>
    The result is a web page that prints "Hello Velocity World!".
 </p>
</primary>
<p>
結果として Web ページは、"Hello Velocity World!"を表示します。
</p>

<primary>
 <p>
    To make statements containing VTL directives more readable, we
    encourage you to start each VTL statement on a new line, although
    you are not required to do so. The <em>set</em> directive will be
    revisited in greater detail later on.
 </p>
</primary>
<p>
VTL 指示子を含んだ文をより読みやすくするために、個々の VTL 文は、
新しい行から始めることを推奨しますが、必須ではありません。
<em>set</em> 指示子については、後ほど更に詳しく説明します。
</p>

</section>

<section name="Comments" alias="コメント">

<primary>
 <p>
    Comments allows descriptive text to be included that is not placed
    into the output of the template engine. Comments are a useful way of
    reminding yourself and explaining to others what your VTL statements
    are doing, or any other purpose you find useful. Below is an example
    of a comment in VTL.
 </p>
</primary>
<p>
コメントを使うと説明用のテキストを埋め込むことができます。
コメントはテンプレートエンジンの出力に含まれません。
コメントは、VTL 文が何を行なっているかを他人 (や未来の自分自身) に説明するなど、
便利と思われるどんな目的でも使うことができます。
下記は、VTL でのコメントの例です。
</p>

<primary>
<source><![CDATA[
## This is a single line comment.
]]></source>
</primary>
<source><![CDATA[
## 一行コメントです。
]]></source>

<primary>
 <p>
    A single line comment begins with <em>##</em> and finishes at the
    end of the line. If you're going to write a few lines of commentary,
    there's no need to have numerous single line comments. Multi-line
    comments, which begin with <em>#*</em> and end with <em>*#</em>, are
    available to handle this scenario.
 </p>
</primary>
<p>
一行コメントは、<em>##</em> で始まり行末で終わります。
コメントを複数行書こうとする場合、一行コメントをたくさん並べる必要ありません。こういう場合には、
複数行コメント (<em>#*</em> で始まり <em>*#</em> で終わります) が利用できます。
</p>

<primary>
<source><![CDATA[
This is text that is outside the multi-line comment.
Online visitors can see it.

#*
 Thus begins a multi-line comment. Online visitors won't
 see this text because the Velocity Templating Engine will
 ignore it.
*#

Here is text outside the multi-line comment; it is visible.
]]></source>
</primary>
<source><![CDATA[
この部分は複数行コメントの外なので、
ページには表示されます。

#*
 複数行コメントはここからです。ページにはこのテキストは表示されません。
 Velocity テンプレートエンジンはこの部分を無視するからです。
*#

ここも複数行コメントの外なので、ページに表示されます。
]]></source>

<primary>
 <p>
    Here are a few examples to clarify how single line and multi-line
    comments work:
 </p>
</primary>
<p>
一行コメントと複数行コメントの動作を分かりやすく説明するいくつかの例を以下に示します。
</p>

<primary>
<source><![CDATA[
This text is visible. ## This text is not.
This text is visible.
This text is visible. #* This text, as part of a multi-line comment,
is not visible. This text is not visible; it is also part of the
multi-line comment. This text still not visible. *# This text is outside
the comment, so it is visible.
## This text is not visible.
]]></source>
</primary>
<source><![CDATA[
このテキストは表示されます。 ## このテキストは表示されません。
このテキストは表示されます。
このテキストは表示されます。 #* このテキストは、複数行コメントの一部なので、
表示されません。このテキストも複数行コメントの一部なので、表示されません。
このテキストもまだ表示されません。*# このテキストはコメントの外側なので、
表示されます。
## このテキストは表示されません。
]]></source>

<primary>
 <p>
    There is a third type of comment, the VTL comment block, which may
    be used to store such information as the document author and
    versioning information:
 </p>
</primary>
<p>
コメントには第3の形式 (VTLコメントブロック) があります。
文書の作者やバージョン情報などを格納するために使われるかもしれません。
</p>

<primary>
<source><![CDATA[
#**
This is a VTL comment block and
may be used to store such information
as the document author and versioning
information:
@author
@version 5
*#
]]></source>
</primary>
<source><![CDATA[
#**
これは VTL コメントブロックで、
文書の作者やバージョン情報といった
情報を格納するのに使われるかも
しれません。
@author
@version 5
*#
]]></source>

</section>

<section name="References" alias="リファレンス">

<primary>
 <p>
    There are three types of references in the VTL: variables,
    properties and methods. As a designer using the VTL, you and your
    engineers must come to an agreement on the specific names of
    references so you can use them correctly in your templates.
 </p>
</primary>
<p>
VTL には、変数/プロパティ/メソッドという3種類のリファレンスがあります。
VTL を使うデザイナがテンプレートでリファレンスを正しく使えるように、
デザイナとエンジニアとの間で、
個々のリファレンスの名前について同意しておかなければなりません。
</p>

<primary>
 <p>
    Everything coming to and from a reference is treated as a String
    object. If there is an object that represents <em>$foo</em> (such as
    an Integer object), then Velocity will call its
    <code>.toString()</code> method to resolve the object into a String.
 </p>
</primary>
<p>
リファレンスに出入りするものはすべて、文字列オブジェクトとみなされます。 
<em>$foo</em>という名前のオブジェクト (例えばIntegerオブジェクト) があるならば、
Velocity はオブジェクトを文字列にするために<code>.toString()</code>メソッドを呼びます。
</p>

<primary>
 <p>
 <a name="Variables"><strong>Variables</strong></a>
 <br/>
    The shorthand notation of a variable consists of a leading "$"
    character followed by a VTL <em>Identifier</em>. A VTL Identifier
    must start with an alphabetic character (a .. z or A .. Z). The rest
    of the characters are limited to the following types of characters:
 </p>
</primary>
 <p>
 <a name="Variables"><strong>変数</strong></a>
 <br />
変数の簡略表記は、「$」とそれに続く VTL <em>識別子</em> から構成されます。 
VTL 識別子は、英字から始めなければなりません (a・・・zまたはA・・・Z)。
先頭以外の文字についても、以下の種類に限定されます：
 </p>

<primary>
 <p>
   <ul>
     <li>alphabetic (a .. z, A .. Z)</li>
     <li>numeric (0 .. 9)</li>
     <li>hyphen ("-")</li>
     <li>underscore ("_")</li>
   </ul>
 </p>
</primary>
 <p> 
   <ul>
     <li>アルファベット (a・・・z, A・・・Z)</li>
     <li>数字 (0・・・9)</li>
     <li>ハイフン ("-")</li>
     <li>アンダースコア ("_")</li>
   </ul>
 </p>

<primary>
 <p>
    Here are some examples of valid variable references in the VTL:
 </p>
</primary>
 <p>
    VTL で有効な変数リファレンスの例をいくつか示します。
 </p>

<source><![CDATA[
$foo
$mudSlinger
$mud-slinger
$mud_slinger
$mudSlinger1
]]></source>

<primary>
 <p>
    When VTL references a variable, such as <em>$foo</em>, the variable
    can get its value from either a <em>set</em> directive in the
    template, or from the Java code. For example, if the Java variable
    <em>$foo</em> has the value <em>bar</em> at the time the template is
    requested, <em>bar</em> replaces all instances of <em>$foo</em> on
    the web page. Alternatively, if I include the statement
 </p>
</primary>
 <p>
VTL が (<em>$foo</em> のような) 変数を参照する場合、
変数の値を、テンプレートの <em>set</em> 指示子、
または Java のコードから取得できます。
例えば、テンプレートが要求された時に Java 変数 <em>$foo</em> が値 <em>bar</em>
を持っていれば、Web ページ上で <em>$foo</em> の全てのインスタンスが 
<em>bar</em> で置換できます。言い換えると、以下の文を入れると、
 </p>
<source><![CDATA[
#set( $foo = "bar" )
]]></source>

<primary>
 <p>
    The output will be the same for all instances of <em>$foo</em> that
    follow this directive.
 </p>
</primary>
<p>
この指示子以降の <em>$foo</em> の全てのインスタンスについて出力は同じになります。
</p>
<primary>
 <p>
 <a name="Properties"><strong>Properties</strong></a>
 <br/>
    The second flavor of VTL references are properties, and properties
    have a distinctive format. The shorthand notation consists of a
    leading <em>$</em> character followed a VTL Identifier, followed by
    a dot character (".") and another VTL Identifier. These are examples
    of valid property references in the VTL:
 </p>
</primary>
 <p>
 <a name="Properties"><strong>プロパティ</strong></a>
 <br />
VTL リファレンスの第二の形式はプロパティで、特徴的なフォーマットを持っています。
簡略表記は、「<em>$</em>」とそれに続く VTL 識別子、それにドット「.」を挟んで続く別の 
VTL 識別子から成ります。
VTL での有効なプロパティリファレンスの例を示します：
 </p>

<source><![CDATA[
$customer.Address
$purchase.Total
]]></source>

<primary>
 <p>
    Take the first example, <em>$customer.Address</em>. It can have two
    meanings. It can mean, Look in the hashtable identified as
    <em>customer</em> and return the value associated with the key
    <em>Address</em>. But <em>$customer.Address</em> can also be
    referring to a method (references that refer to methods will be
    discussed in the next section); <em>$customer.Address</em> could be
    an abbreviated way of writing <em>$customer.getAddress()</em>. When
    your page is requested, Velocity will determine which of these two
    possibilities makes sense, and then return the appropriate value.
 </p>
</primary>
<p>
最初の例 (<em>$customer.Address</em>) の場合は、2つの意味が考えられます。
一つは、<em>customer</em> で識別される hashtable を見て、
キー <em>Address</em> と関連づけられる値を返すという意味です。
しかし、<em>$customer.Address</em> はメソッドを参照しているのかも知れないのです。
 (メソッドを参照するリファレンスは、次のセクションで説明します)。
<em>$customer.Address</em> は、<em>$customer.getAddress()</em>
の省略表記でもあるのです。
ページが要求されたとき、Velocity はこれらの2つの可能性のうち
どちらが意味をなすかを判定して、適切な値を返します
</p>

<primary>
 <p>
 <a name="Methods"><strong>Methods</strong></a>
 <br/>
    A method is defined in the Java code and is capable of doing
    something useful, like running a calculation or arriving at a
    decision. Methods are references that consist of a leading "$"
    character followed a VTL Identifier, followed by a VTL <em>Method
    Body</em>. A VTL Method Body consists of a VTL Identifier followed
    by an left parenthesis character ("("), followed by an optional
    parameter list, followed by right parenthesis character (")"). These
    are examples of valid method references in the VTL:
 </p>
</primary>
<p>
 <a name="Methods"><strong>メソッド</strong></a>
 <br />
メソッドは Java コードにおいて定義されるもので、何か役に立つこと
(計算や判定の実行など) を行うことができます。
メソッドは「$」と、それに続く VTL 識別子と、それに続く
VTL <em>メソッドボディ (Method Body)</em> から構成されるリファレンスです。
VTL メソッドボディは、VTL 識別子と、それに続く左括弧("(")、
パラメータリスト (オプション)、それに右括弧(")")から構成されます。
VTL で有効なメソッドリファレンスの例を示します。
 </p>

<source><![CDATA[
$customer.getAddress()
$purchase.getTotal()
$page.setTitle( "My Home Page" )
$person.setAttributes( ["Strange", "Weird", "Excited"] )
]]></source>

<primary>
 <p>
    The first two examples -- <em>$customer.getAddress()</em> and
    <em>$purchase.getTotal()</em> -- may look similar to those used in
    the Properties section above, <em>$customer.Address</em> and
    <em>$purchase.Total</em>. If you guessed that these examples must be
    related some in some fashion, you are correct!
 </p>
</primary>
<p>
最初の2つの例 (<em>$customer.getAddress()</em> と <em>$purchase.getTotal()</em>) は、
上の<a href="#Properties">プロパティ</a>のセクションで使われた例
(<em>$customer.Address</em>と<em>$purchase.Total</em>)
に類似しているように見えるかもしれません。
これらの例は何か関係があるはずだと思ったら、それは正解です！
</p>

<primary>
 <p>
    VTL Properties can be used as a shorthand notation for VTL Methods.
    The Property <em>$customer.Address</em> has the exact same effect as
    using the Method <em>$customer.getAddress()</em>. It is generally
    preferable to use a Property when available. The main difference
    between Properties and Methods is that you can specify a parameter
    list to a Method.
 </p>
</primary>
<p>
VTL プロパティは、VTL メソッドの簡略表記として使えます。
プロパティ <em>$customer.Address</em> は、
メソッド <em>$customer.getAddress()</em> を使うのと完全に同じ効果があります。
一般に、利用可能ならプロパティを使う方が望ましいです。
プロパティとメソッドの主な違いは、
メソッドにはパラメータリストを指定できるということです。
</p>

<primary>
 <p>
    The shorthand notation can be used for the following Methods
 </p>
</primary>
<p>
簡略表記は、以下のメソッドで使うことができます。
</p>

<source><![CDATA[
$sun.getPlanets()
$annelid.getDirt()
$album.getPhoto()
]]></source>

<primary>
 <p>
    We might expect these methods to return the names of planets
    belonging to the sun, feed our earthworm, or get a photograph from
    an album. Only the long notation works for the following Methods.
 </p>
</primary>
<p>
こうしたメソッドは、太陽系の惑星の名前を返すとか
ミミズに餌をやるとか、アルバムから写真を取り出すといったことが想定されるでしょう。
以下のメソッドは、長い表記だけが動作します。
</p>

<primary>
<source><![CDATA[
$sun.getPlanet( ["Earth", "Mars", "Neptune"] )
## Can't pass a parameter list with $sun.Planets

$sisyphus.pushRock()
## Velocity assumes I mean $sisyphus.getRock()

$book.setTitle( "Homage to Catalonia" )
## Can't pass a parameter list
]]></source>
</primary>
<source><![CDATA[
$sun.getPlanet( ["Earth", "Mars", "Neptune"] )
## $sun.Planets にはパラメータリストを渡せません。

$sisyphus.pushRock()
## ($sisyphus.Rockだと) Velocity は $sisyphus.getRock() だと思ってしまいます。

$book.setTitle( "Homage to Catalonia" )
## パラメータリストは渡せません。
]]></source>

<primary>
 <p>
    <a name="Formal Reference Notation"><strong>Formal Reference Notation</strong></a>
    <br/>
    Shorthand notation for references was used for the examples listed
    above, but there is also a formal notation for references, which is
    demonstrated below:
 </p>
</primary>
 <p>
    <a name="Formal Reference Notation"><strong>正式リファレンス表記</strong></a>
    <br />
上で一覧として挙げた例では、リファレンスの簡略表記が使われました。
しかし、リファレンスのための正式表記もあります。以下に例を示します。
 </p>

<source><![CDATA[
${mudSlinger}
${customer.Address}
${purchase.getTotal()}
]]></source>

<primary>
 <p>
    In almost all cases you will use the shorthand notation for
    references, but in some cases the formal notation is required for
    correct processing.
 </p>
</primary>
<p>
ほとんどすべての場合、リファレンスには簡略表記を使用することになりますが、
正しく処理するために正式表記が必要となる場合があります。
</p>

<primary>
 <p>
    Suppose you were constructing a sentence on the fly where
    <em>$vice</em> was to be used as the base word in the noun of a
    sentence. The goal is to allow someone to choose the base word and
    produce one of the two following results: "Jack is a pyromaniac." or
    "Jack is a kleptomaniac.". Using the shorthand notation would be
    inadequate for this task. Consider the following example:
 </p>
</primary>
<p>
例えば、動的に文を構築するのに、文で使われる名詞のベースとなる単語として<em>$vice</em>
を使うとしましょう。誰かにベースとなる単語を選択させて、
「Jack is pyromaniac.」あるいは「Jack is kleptomaniac.」という結果を生成します。
こういう場合、簡略表記を使用するとまずいのです。
以下の例を考えてみてください。
</p>


<source><![CDATA[
Jack is a $vicemaniac.
]]></source>

<primary>
 <p>
    There is ambiguity here, and Velocity assumes that
    <em>$vicemaniac</em>, not <em>$vice</em>, is the Identifier that you
    mean to use. Finding no value for <em>$vicemaniac</em>, it will
    return <em>$vicemaniac</em>. Using formal notation can resolve this
    problem.
 </p>
</primary>
<p>
この表現は曖昧で、Velocity は識別子として、あなたが使いたい<em>$vice</em>ではなく
<em>$vicemaniac</em> を認識します。<em>$vicemaniac</em> の値は見つからないので 
<em>$vicemaniac</em> をそのまま返すことになります。
正式表記を使用することで、この問題を解決できます。
</p>

<source><![CDATA[
Jack is a ${vice}maniac.
]]></source>

<primary>
 <p>
    Now Velocity knows that <em>$vice</em>, not <em>$vicemaniac</em>, is
    the reference. Formal notation is often useful when references are
    directly adjacent to text in a template.
 </p>
</primary>
<p>
こうすれば Velocity は、<em>$vicemaniac</em> ではなく
<em>$vice</em> がリファレンスであると認識します。
正式表記が役に立つことが多いのは、
このようにリファレンスがテンプレート中でテキストと隣接している時です。
</p>

<primary>
 <p>
    <a name="Quiet Reference Notation"><strong>Quiet Reference Notation</strong></a>
    <br/>
    When Velocity encounters an undefined reference, its normal behavior
    is to output the image of the reference. For example, suppose the
    following reference appears as part of a VTL template.
 </p>
</primary>
 <p>
    <a name="Quiet Reference Notation"><strong>沈黙リファレンス表記</strong></a>
    <br />
Velocity が未定義のリファレンスに遭遇したとき、
通常の挙動として、リファレンスの記述をそのまま出力します。
例えば、以下のリファレンスが VTL テンプレートの一部に出てきたとしましょう。
 </p>

<source><![CDATA[
<input type="text" name="email" value="$email"/>
]]></source>

<primary>
 <p>
    When the form initially loads, the variable reference
    <em>$email</em> has no value, but you prefer a blank text field to
    one with a value of "$email". Using the quiet reference notation
    circumvents Velocity's normal behavior; instead of using
    <em>$email</em> in the VTL you would use <em>$!email</em>. So the
    above example would look like the following:
 </p>
</primary>
<p>
最初にフォームがロードされるとき、変数のリファレンス 
<em>$email</em> には値がありませんが、
テキストフィールドに「$email」という値が入っているより
ブランクになっている方がよいでしょう。
リファレンスの沈黙表記を使用することで、Velocity の通常の挙動を回避します。
具体的には VTL で <em>$email</em> を使う代わりに、 <em>$!email</em> を使います。
したがって、上記の例は以下のようになります：
</p>

<source><![CDATA[
<input type="text" name="email" value="$!email"/>
]]></source>

<primary>
 <p>
    Now when the form is initially loaded and <em>$email</em> still has
    no value, an empty string will be output instead of "$email".
 </p>
</primary>
<p>
これで、最初にフォームがロードされて <em>$email</em> がまだ値を持たないとき、
「$email」の代わりに空の文字列が出力されます。
</p>

<primary>
 <p>
    Formal and quiet reference notation can be used together, as
    demonstrated below.
 </p>
</primary>
<p>
リファレンスを正式表記かつ沈黙表記として使うことも出来ます。
具体的には以下のようにします。
</p>

<source><![CDATA[
<input type="text" name="email" value="$!{email}"/>
]]></source>

</section>

<section name="Getting literal" alias="リテラルを取得する">

<primary>
  <p>
    VTL uses special characters, such as <em>$</em> and <em>#</em>, to
    do its work, so some added care should be taken where using these
    characters in your templates. This section deals with escaping the
    <em>$</em> character.
  </p>
</primary>
 <p>
VTL は、「<em>$</em>」 や 「<em>#</em>」のように特殊文字を使用するので、
テンプレート内でこれらの文字を使用する場合には注意が必要です。
このセクションでは、「<em>$</em>」をエスケープする方法を説明します。
  </p>

<primary>
  <p>
    <a name="Currency"><strong>Currency</strong></a>
    <br/>
    There is no problem writing "I bought a 4 lb. sack of potatoes at
    the farmer's market for only $2.50!" As mentioned, a VTL identifier
    always begins with an upper- or lowercase letter, so $2.50 would not
    be mistaken for a reference.
  </p>
</primary>
  <p>
    <a name="Currency"><strong>通貨</strong></a>
    <br />
「私は市場で 4ポンドの袋入りのジャガイモをたった $2.50 で買いました！」
と書くことについては問題はありません。
VTL 識別子は常に大文字または小文字の英字から始まるので、$2.50をリファレンスと間違えることはありません。
  </p>

<primary>
  <p>
    <a name="Escaping Valid VTL References"><strong>Escaping Valid VTL References</strong></a>
    <br/>
    Cases may arise where there is the potential for Velocity to get
    confused. <em>Escaping</em> special characters is the best way to
    handle VTL's special characters in your templates, and this can be
    done using the backslash ( <em>\</em> ) character.
  </p>
</primary>
   <p>
    <a name="Escaping Valid VTL References"><strong>有効なVTLリファレンスをエスケープする</strong></a>
    <br />
Velocity が混乱する可能性がある場合もあります。
特殊文字の<em>エスケープ</em>は、テンプレート内で VTL の特殊文字を扱う最適な方法であり、
バックスラッシュ(<em>\</em>)を使って行えます。
  </p>

<source><![CDATA[
#set( $email = "foo" )
$email
]]></source>

<primary>
  <p>
    If Velocity encounters  a reference in your VTL template to
    <em>$email</em>, it will search the Context for a corresponding
    value. Here the output will be <em>foo</em>, because <em>$email</em> is
    defined. If <em>$email</em> is not defined, the output will be
    <em>$email</em>.
  </p>
</primary>
<p>
Velocity が VTL テンプレートで <em>$email</em> リファレンスを検出すると、
対応する値を求めてコンテキストを検索します。
ここでは、<em>$email</em> が定義されているので、出力は <em>foo</em> になります。 
<em>$email</em> が定義されていなければ、出力は <em>$email</em> になります。
</p>

<primary>
  <p>
    Suppose that <em>$email</em> is defined (for example, if it has the
    value <em>foo</em>), and that you want to output <em>$email</em>. There are a few
    ways of doing this, but the simplest is to use the escape character.
  </p>
</primary>
<p>
 (例えば値が <em>foo</em> である) <em>$email</em> が定義されていて、 
<em>$email</em> と出力したい場合を考えてください。
解決方法はいくつかありますが、最も単純なのはエスケープ文字を使うことです。
</p>

<primary>
<source><![CDATA[
## The following line defines $email in this template:
#set( $email = "foo" )
$email
\$email
\\$email
\\\$email
]]></source>
</primary>
<source><![CDATA[
## このテンプレートでは、次の行で $email を定義しています。
#set( $email = "foo" )
$email
\$email
\\$email
\\\$email
]]></source>

<primary>
  <p>
     renders as
  </p>
</primary>
  <p>
これは以下のように処理されます。
  </p>

<source><![CDATA[
foo
$email
\foo
\$email
]]></source>

<primary>
  <p>
     Note that the <em>\</em> character bind to the <em>$</em>
     from the left. The bind-from-left rule causes <em>\\\$email</em> to
     render as <em>\\$email</em>. Compare these examples to those in
     which <em>$email</em> is not defined.
  </p>
</primary>
<p>
左から「<em>\</em>」が「<em>$</em>」に結合することに注意してください。
「左から結合する」規則の結果、
<em>\\\$email</em> を処理すると <em>\\$email</em> になります。
上記の例を、下記の<em>$email</em> が定義されない例と比較してみてください。
</p>

<source><![CDATA[
$email
\$email
\\$email
\\\$email
]]></source>

<primary>
  <p>
     renders as
  </p>
</primary>
  <p>
これは以下のように処理されます。
  </p>

<source><![CDATA[
$email
\$email
\\$email
\\\$email
]]></source>

<primary>
  <p>
     Notice Velocity handles references that are defined differently
     from those that have not been defined. Here is a set directive that
     gives <em>$foo</em> the value <em>gibbous</em>.
  </p>
</primary>
<p>
Velocity は、定義されていない場合と定義されていない場合とで、
リファレンスの扱いが異なることに注意してください。 
以下の例では、set 指示子で <em>$foo</em> に値 <em>gibbous</em> をセットします。
</p>

<source><![CDATA[
#set( $foo = "gibbous" )
$moon = $foo
]]></source>

<primary>
  <p>
    The output will be: <em>$moon = gibbous</em> -- where <em>$moon</em>
    is output as a literal because it is undefined and <em>gibbous</em>
    is output in place of <em>$foo</em>.
  </p>
</primary>
<p>
出力は<em>$moon = gibbous</em>になります ─ <em>$moon</em> は未定義なのでリテラルとして出力され、
<em>$foo</em> のところには <em>gibbous</em> が出力されるのです。
</p>

<primary>
  <p>
     It is also possible to escape VTL directives; this is described in
     more detail in the Directives section.
  </p>
</primary>
<p>
VTL 指示子をエスケープすることも可能です; 
この詳細については、 <a href="#Directives">指示子</a> セクションで説明します。
</p>

</section>

<section name="Case Substitution" alias="大文字小文字置換 ">

<primary>
    <p>
    Now that you are familiar with references, you can begin to apply
    them effectively in your templates. Velocity references take
    advantage of some Java principles that template designers will find
    easy to use. For example:
    </p>
</primary>
<p>
リファレンスに慣れると、テンプレートで効果的にリファレンスを使えるようになります。 
Velocity リファレンスでは Java の利点を生かしていますが、
テンプレートデザイナでも使うのは難しくないと思います。例を挙げましょう。
</p>

<primary>
<source><![CDATA[
$foo

$foo.getBar()
## is the same as
$foo.Bar

$data.getUser("jon")
## is the same as
$data.User("jon")

$data.getRequest().getServerName()
## is the same as
$data.Request.ServerName
## is the same as
${data.Request.ServerName}
]]></source>
</primary>
<source><![CDATA[
$foo

$foo.getBar()
## 上と下は同じです
$foo.Bar

$data.getUser("jon")
## 上と下は同じです
$data.User("jon")

$data.getRequest().getServerName()
## 上と下は同じです
$data.Request.ServerName
## また、これも同じです
${data.Request.ServerName}
]]></source>

<primary>
    <p>
    These examples illustrate alternative uses for the same references.
    Velocity takes advantage of Java's introspection and bean features
    to resolve the reference names to both objects in the Context as
    well as the objects methods. It is possible to embed and evaluate
    references almost anywhere in your template.
    </p>
</primary>
<p>
これらは、同じリファレンスのいろんな使い方の具体例です。
Velocity は、Java のイントロスペクション機能と Bean 機能を利用して、
コンテキスト内のオブジェクトと、オブジェクトメソッドの両方のリファレンス名を解決します。
テンプレート中のほぼどこにでもリファレンスを埋め込んで、評価することが可能です。
</p>

<primary>
    <p>
    Velocity, which is modelled on the Bean specifications defined by
    Sun Microsystems, is case sensitive; however, its developers have
    strove to catch and correct user errors wherever possible.
    When the method <em>getFoo()</em> is referred to in a template
    by <code>$bar.foo</code>, Velocity will first try <code>$getfoo</code>.
    If this fails, it will then try <code>$getFoo</code>.
    Similarly, when a template refers to <code>$bar.Foo</code>, Velocity
    will try <em>$getFoo()</em> first and then try <em>getfoo()</em>.
    </p>
</primary>
<p>
Velocity では、サンマイクロシステムズが策定した Bean 仕様書に元にモデルを作ったので、
大文字と小文字を区別します。しかし、Velocity の開発者は、
ユーザエラーを出来る限り検出して訂正するよう努力しました。
<em>getFoo()</em> メソッドが、テンプレート内で<code>$bar.foo</code> によって
参照されるとき、Velocityはまず <code>$getfoo</code> を試み、それに失敗すると、
<code>$getFoo</code> を試みます。
同じように、テンプレートが <code>$bar.Foo</code> を参照するとき、
Velocity は最初に <em>$getFoo()</em> を試みて、
それから <em>getfoo()</em> を試みます。
</p>

<primary>
    <p>
    Note: <em>References to instance variables in a template are not
    resolved.</em> Only references to the attribute equivalents of
    JavaBean getter/setter methods are resolved
    (i.e. <code>$foo.Name</code> does resolve to the class Foo's
    <code>getName()</code> instance method, but not to a public
    <code>Name</code> instance variable of Foo).
    </p>
</primary>
<p> 
注意: <em>テンプレート中のインスタンス変数への参照は解決されません。</em>
JavaBean の getter/setter メソッドに対応する属性だけが解決されます。 
(つまり、<code>$foo.Name</code> は、
Foo クラスのインスタンスメソッドである <code>getName()</code> としては解決されますが、
Foo のパブリックのインスタンス変数である <code>Name</code> としては解決されません。)
</p> 

</section>


<section name="Directives" alias="指示子">

<primary>
 <p>
    References allow template designers to generate dynamic content for
    web sites, while <em>directives</em> -- easy to use script elements
    that can be used to creatively manipulate the output of Java code --
    permit web designers to truly take charge of the appearance and
    content of the web site.
 </p>
</primary>
<p>
リファレンスを使うと、
テンプレートのデザイナが Web サイト向けに動的に内容を生成できるのに対して、
<em>指示子</em> (使いやすいスクリプト要素で、Java コードの出力を思い通りに操作するのに使えます) を使うと、 Web デザイナは真の意味で
Web サイトの内容と見栄えを管理できるようになります。
</p>

<primary>
 <a name="Set"><strong>#set</strong></a>
</primary>
 <a name="Set"><strong>#set</strong></a>

<primary>
 <p>
    The <em>#set</em> directive is used for setting the value of a
    reference. A value can be assigned to either a variable reference or
    a property reference, and this occurs in brackets, as demonstrated:
 </p>
</primary>
<p>
<em>#set</em> 指示子は、リファレンスの値をセットするのに使います。
値は、変数リファレンスかプロパティリファレンスにセットされ、
その際、以下に示すように丸括弧でくくります。
</p>

<source><![CDATA[
#set( $primate = "monkey" )
#set( $customer.Behavior = $primate )
]]></source>

<primary>
 <p>
    The left hand side (LHS) of the assignment must be a variable
    reference or a property reference. The right hand side (RHS) can be
    one of the following types:
 </p>
</primary>
<p>
左辺(LHS:Left Hand Side)は、変数リファレンスまたはプロパティリファレンスでなければなりません。
右辺(RHS:Right Hand Side)は、以下のタイプのいずれかです：
</p>

<primary>
 <p>
    <ul>
        <li>Variable reference</li>
        <li>String literal</li>
        <li>Property reference</li>
        <li>Method reference</li>
        <li>Number literal</li>
        <li>ArrayList</li>
    </ul>
 </p>
</primary>
 <p>
    <ul>
        <li>変数リファレンス</li>
        <li>文字列リテラル</li>
        <li>プロパティリファレンス</li>
        <li>メソッドリファレンス</li>
        <li>数値リテラル</li>
        <li>配列リスト (ArrayList)</li>
    </ul>
 </p>

<primary>
 <p>
    These examples demonstrate each of the aforementioned types:
 </p>
</primary>
  <p>
以下は、上記タイプの各々の例です：
 </p>

<primary>
<source><![CDATA[
#set( $monkey = $bill ) ## variable reference
#set( $monkey.Friend = "monica" ) ## string literal
#set( $monkey.Blame = $whitehouse.Leak ) ## property reference
#set( $monkey.Plan = $spindoctor.weave($web) ) ## method reference
#set( $monkey.Number = 123 ) ##number literal
#set( $monkey.Say = ["Not", $my, "fault"] ) ## ArrayList
]]></source>
</primary>
<source><![CDATA[
#set( $monkey = $bill )                        ## 変数リファレンス
#set( $monkey.Friend = "monica" )              ## 文字列リテラル
#set( $monkey.Blame = $whitehouse.Leak )       ## プロパティリファレンス
#set( $monkey.Plan = $spindoctor.weave($web) ) ## メソッドリファレンス
#set( $monkey.Number = 123 )                   ## 数値リテラル
#set( $monkey.Say = ["Not", $my, "fault"] )    ## 配列リスト
]]></source>

<primary>
 <p>
   NOTE: In the last example the elements defined with the
   [..] operator are accessible using the methods defined
   in the ArrayList class. So, for example, you could access
   the first element above using $monkey.Say.get(0).
 </p>
</primary>
  <p>
注意: 最後の例で [..] オペレータで定義された要素は
ArrayList クラスで定義されているメソッドを使用してアクセスできます。したがって、
例えば、$monkey.Say.get(0) を使って上記の最初の要素 ("Not") にアクセスできます。
 </p>

<primary>
 <p>
    The RHS can also be a simple arithmetic expression:
 </p>
</primary>
<p>
右辺には単純な計算式を入れることもできます。 
</p>

<source><![CDATA[
#set( $value = $foo + 1 )
#set( $value = $bar - 1 )
#set( $value = $foo * $bar )
#set( $value = $foo / $bar )
]]></source>

<primary>
 <p>
    If the RHS is a property or method reference that evaluates to
    <em>null</em>, it will <b>not</b> be assigned to the LHS.  It is
    not possible to remove an existing reference from the context via
    this mechanism.  This can be confusing for
    newcomers to Velocity.  For example:
 </p>
</primary>
 <p>
右辺が<em>null</em>として評価されるプロパティやメソッドだった場合、
null値は左辺に代入<b>されません</b>。
null代入で既存のリファレンスをコンテキストから削除することはできません。
これはVelocity初心者には混乱の元となるかもしれません。
例えば、
 </p>

<primary>
<source><![CDATA[
#set( $result = $query.criteria("name") )
The result of the first query is $result

#set( $result = $query.criteria("address") )
The result of the second query is $result
]]></source>
</primary>
<source><![CDATA[
#set( $result = $query.criteria("name") )
最初のクエリの結果は $result です。

#set( $result = $query.criteria("address") )
2番目のクエリの結果は $result です。
]]></source>

<primary>
  <p>
     If <em>$query.criteria("name")</em> returns the string
     "bill", and <em>$query.criteria("address")</em> returns
     <em>null</em>, the above VTL will render as the following:
 </p>
</primary>
  <p>
<em>$query.criteria("name")</em> が "bill" という文字列を返し、
<em>$query.criteria("address")</em> は <em>null</em> を返す時、
上のVTLは次のように処理されます：
 </p>

<primary>
<source><![CDATA[
The result of the first query is bill

The result of the second query is bill
]]></source>
</primary>
<source><![CDATA[
最初のクエリの結果は bill です。

2番目のクエリの結果は bill です。
]]></source>

<primary>
 <p>
     This tends to confuse newcomers who construct <em>#foreach</em>
     loops that attempt to <em>#set</em> a reference via a property or
     method reference, then immediately test that reference with an
     <em>#if</em> directive.  For example:
 </p>
</primary>
 <p>
このため、初心者が<em>#foreach</em> を使って、
プロパティやメソッドリファレンスを別のリファレンスに <em>#set</em> し、
直後にそのリファレンスを<em>#if</em> 指示子でテストする、
というループを構築すると混乱しやすいでしょう。
例えば、
 </p>

<primary>
<source><![CDATA[

#set( $criteria = ["name", "address"] )

#foreach( $criterion in $criteria )

    #set( $result = $query.criteria($criterion) )

    #if( $result )
        Query was successful
    #end

#end
]]></source>
</primary>
<source><![CDATA[

#set( $criteria = ["name", "address"] )

#foreach( $criterion in $criteria )

    #set( $result = $query.criteria($criterion) )

    #if( $result )
        クエリは成功しました。
    #end

#end
]]></source>

<primary>
 <p>
     In the above example, it would not be wise to rely on the
     evaluation of <em>$result</em> to determine if a query was
     successful.  After <em>$result</em> has been <em>#set</em> (added to
     the context), it cannot be set back to <em>null</em> (removed from
     the context).  The details of the <em>#if</em> and <em>#foreach</em>
     directives are covered later in this document.
 </p>
</primary>
 <p>
上の例において、クエリが成功したかどうかを判定するのに <em>$result</em> 
の評価を信頼するのは賢明とはいえません。
<em>$result</em> が <em>#set</em> された(コンテキストに追加された)後、
これを <em>null</em> に戻す(コンテキストから削除される)ことはできないのです。
<em>#if</em> と <em>#foreach</em> の各指示子についてはこの文書で後述します。
 </p>

<primary>
 <p>
   One solution to this would be to pre-set <em>$result</em>
   to <em>false</em>.  Then if the <em>$query.criteria()</em>
   call fails, you can check.
 </p>
</primary>
 <p>
これに対する解決法の一つは、事前に <em>$result</em> を <em>false</em> 
にセットしておくことです。そうすれば、 <em>$query.criteria()</em> 
の呼び出しが失敗した場合、チェックすることができます。
 </p>


<primary>
<source><![CDATA[

#set( $criteria = ["name", "address"] )

#foreach( $criterion in $criteria )

    #set( $result = false )
    #set( $result = $query.criteria($criterion) )

    #if( $result )
        Query was successful
    #end

#end
]]></source>
</primary>
<source><![CDATA[

#set( $criteria = ["name", "address"] )

#foreach( $criterion in $criteria )

    #set( $result = false )
    #set( $result = $query.criteria($criterion) )

    #if( $result )
        クエリは成功しました。
    #end

#end
]]></source>

<primary>
 <p>
    Unlike some of the other Velocity directives, the <em>#set</em>
    directive does not have an <em>#end</em> statement.
 </p>
</primary>
<p>
他の Velocity 指示子のいくつかとは異なり、<em>#set</em> 指示子には
<em>#end</em> 文がありません。
</p>

<primary>
</primary>
<a name="String Literals"><strong>文字列リテラル</strong></a>

<primary>
 <p>
    When using the <em>#set</em> directive, string literals that are
    enclosed in double quote characters will be parsed and rendered, as
    shown:
 </p>
</primary>
 <p>
<em>#set</em> 指示子を使うとき、二重引用符(「"」)で囲まれた文字列リテラルは、
以下に示すようにパース／処理されます。
 </p>

<source><![CDATA[
#set( $directoryRoot = "www" )
#set( $templateName = "index.vm" )
#set( $template = "$directoryRoot/$templateName" )
$template
]]></source>

<primary>
 <p>
  The output will be
 </p>
</primary>
 <p>
  出力はこうなります
 </p>

<source><![CDATA[
www/index.vm
]]></source>

<primary>
 <p>
    However, when the string literal is enclosed in single quote
    characters, it will not be parsed:
 </p>
</primary>
 <p>
しかし、文字列リテラルが単一引用符 (「'」) で囲まれている場合には
パースされません。
 </p>

<source><![CDATA[
#set( $foo = "bar" )
$foo
#set( $blargh = '$foo' )
$blargh
]]></source>

<primary>
  This renders as:
</primary>
<p>
  この処理結果は、こうなります
</p>

<source><![CDATA[
  bar
  $foo
]]></source>

<primary>
 <p>
    By default, this feature of using single quotes to render unparsed
    text is available in Velocity. This default can be changed by
    editing <code>velocity.properties</code> such that
    <code>stringliterals.interpolate=false</code>.
 </p>
</primary>
<p>
単一引用符を使ってテキストをパースせずに処理するという機能は、
Velocity ではデフォルトで利用できます。
このデフォルトは、<code>velocity.properties</code> を編集して
<code>stringliterals.interpolate=false</code>
とすることによって変更できます
</p>
</section>


<section name="Conditionals" alias="If-Else 文">

<primary>
    <strong>If / ElseIf / Else</strong>
</primary>
    <strong>If / ElseIf / Else</strong>

<primary>
    <p>
       The <em>#if</em> directive in Velocity allows for text to be
       included when the web page is generated, on the conditional that
       the if statement is true. For example:
    </p>
</primary>
<p>
Velocity の <em>#if</em> 指示子を使えば、if 文の条件が真という条件文で、
Web ページの生成時にテキストを含むようにできます。
例を挙げましょう。
</p>

<source><![CDATA[
#if( $foo )
   <strong>Velocity!</strong>
#end
]]></source>

<primary>
    <p>
      The variable <em>$foo</em> is evaluated to determine whether it is
      true, which will happen under one of two circumstances: (i)
      <em>$foo</em> is a boolean (true/false) which has a true value, or
      (ii) the value is not null.  Remember that the Velocity context only
      contains Objects, so when we say 'boolean', it will be represented
      as a Boolean (the class).  This is true even for methods that return
      <code>boolean</code> - the introspection infrastructure will return
      a <code>Boolean</code> of the same logical value.
    </p>
</primary>
<p>
変数 <em>$foo</em> が評価されて true かどうか判定されます。
true であるとは以下の2つの状況を指します。<br/>
(i) <em>$foo</em> が true の値を持つ boolean (true/false) の場合<br/>
(ii) <em>$foo</em> の値が null ではない場合<br/>
です。
Velocity のコンテキストはオブジェクトのみを保持することを思い出してください。
「boolean」という場合、それは(クラスである)Booleanを意味します。
これは <code>boolean</code> を返すメソッドに対しても当てはまり、
内部的には同じ論理値の <code>Boolean</code> を返します。
</p>

<primary>
    <p>
       The content between the <em>#if</em>
      and the <em>#end</em> statements become the output if the
      evaluation is true. In this case, if <em>$foo</em> is true, the
      output will be: "Velocity!". Conversely, if <em>$foo</em> has a
      null value, or if it is a boolean false, the statement evaluates
      as false, and there is no output.
    </p>
</primary>
    <p>
<em>#if</em> と <em>#end</em> の間の内容は、評価値が true の場合に出力されます。
この場合、<em>$foo</em> が true ならば、出力は「Velocity!」となります。
逆に、<em>$foo</em> が null または、boolean で false ならば、
文の評価は false となり、出力はありません。
    </p>

<primary>
    <p>
      An <em>#elseif</em> or <em>#else</em> element can be used with an
      <em>#if</em> element. Note that the Velocity Templating Engine
      will stop at the first expression that is found to be true. In the
      following example, suppose that <em>$foo</em> has a value of 15
      and <em>$bar</em> has a value of 6.
    </p>
</primary>
<p>
<em>#elseif</em>または<em>#else</em>要素は <em>#if</em>要素と組で使用できます。
Velocity テンプレートエンジンは、最初に式が true 
になったところで評価を止めることに注意してください。
下記の例で、<em>$foo</em> が 15 という値を持ち、<em>$bar</em> は 6 という値を持つとします。
</p>

<source><![CDATA[
#if( $foo < 10 )
    <strong>Go North</strong>
#elseif( $foo == 10 )
    <strong>Go East</strong>
#elseif( $bar == 6 )
    <strong>Go South</strong>
#else
    <strong>Go West</strong>
#end
]]></source>

<primary>
    <p>In this example, <em>$foo</em> is greater than 10, so the first
    two comparisons fail.  Next <em>$bar</em> is compared to 6, which is
    true, so the output is <strong>Go South</strong>.
    </p>
</primary>
<p>
この例では、<em>$foo</em> は、10 より大きいので最初の 2 つの比較は失敗します。
次に、<em>$bar</em> が、6 と比較され、それが true なので、
出力は <strong>Go South</strong> となります。
</p>

<primary>
    <p>
    Please note that currently, Velocity's numeric comparisons are constrained
    to Integers - anything else will evaluate to <em>false</em>.  The only exception
    to this is equality '==', where Velocity requires that the objects on each
    side of the '==' is of the <em>same</em> class.
    </p>
</primary>
<p>
注意: 現在、Velocity の数値の比較は Integer のみ行えます ─ 
それ以外の場合には <em>false</em> と評価します。
これに対する唯一の例外は等号「==」です。その場合、「==」の両辺のオブジェクトは、
<em>同じ</em>クラスである必要があります。
</p>

<primary>
    <p>
    <a name="Relational and Logical Operators"><strong>Relational and Logical Operators</strong></a>
    </p>
</primary>
    <p>
    <a name="Relational and Logical Operators"><strong>関係演算子と論理演算子</strong></a>
    </p>

<primary>
    <p>
    Velocity uses the equivalent operator to determine the relationships between variables.
    Here is a simple example to illustrate how the equivalent operator is used.
    </p>
</primary>
<p>
Velocity は、変数の関係を決定するために等価演算子を使います。
等価演算子の使い方の単純な例を示します。
</p>

<primary>
<source><![CDATA[
#set ($foo = "deoxyribonucleic acid")
#set ($bar = "ribonucleic acid")

#if ($foo == $bar)
  In this case it's clear they aren't equivalent. So...
#else
  They are not equivalent and this will be the output.
#end
]]></source>
</primary>
<source><![CDATA[
#set ($foo = "deoxyribonucleic acid")
#set ($bar = "ribonucleic acid")

#if ($foo == $bar)
  この場合、等価でないことは明らかなので…
#else
  等価でないので、こちらが出力されます。
#end
]]></source>

<primary>
    <p>
      Velocity has logical AND, OR and NOT operators as well.
      For further information, please see the
      <a href="vtl-reference-guide.html">VTL Reference Guide</a>
      Below are examples demonstrating the use of the
      logical AND, OR and NOT operators.
    </p>
</primary>
   <p>
      Velocity には、この他に AND/OR/NOT という論理演算子があります。
      詳細な情報については、
      <a href="vtl-reference-guide.html">VTL Reference Guide</a>
      をご覧下さい。
      以下は、論理演算子 AND/OR/NOT を使用した例です。
    </p>

<primary>
<source><![CDATA[

## logical AND

#if( $foo && $bar )
   <strong> This AND that</strong>
#end

]]></source>
</primary>
<source><![CDATA[

## 論理 AND

#if( $foo && $bar )
   <strong>これ AND あれ</strong>
#end

]]></source>

<primary>
    <p>
      The <em>#if()</em> directive will only evaluate to true
      if both <em>$foo</em>
      and <em>$bar</em> are true. If <em>$foo</em> is false, the
      expression will evaluate to false; <em>$bar</em> will not be
      evaluated. If <em>$foo</em> is true, the Velocity Templating
      Engine will then check the value of <em>$bar</em>; if
      <em>$bar</em> is true, then the entire expression is true and
      <strong>This AND that</strong> becomes the output. If
      <em>$bar</em> is false, then there will be no output as the entire
      expression is false.
    </p>
</primary>
<p>
<em>#if()</em> 指示子は、<em>$foo</em> と <em>$bar</em> が共に true かどうか、
評価します。
<em>$foo</em> が false ならば、式全体は false に評価され
<em>$bar</em> は、評価されません。
<em>$foo</em> が true ならば、Velocity テンプレートエンジンは、
次に <em>$bar</em> の値をチェックします。
<em>$bar</em> が true ならば、式全体が、true となって
<strong>これ AND あれ</strong> が出力されます。
<em>$bar</em> が false ならば、式全体が false となって
出力されません。
</p>

<primary>
    <p>
      Logical OR operators work the same way, except only one of the
      references need evaluate to true in order for the entire
      expression to be considered true. Consider the following example.
    </p>
</primary>
<p>
論理演算子 OR も同様ですが、式全体が true になるには true と評価されるリファレンス
が1つだけあればよいというところだけが違います。
以下の例を考えてみてください。
</p>

<primary>
<source><![CDATA[

## logical OR

#if( $foo || $bar )
    <strong>This OR That</strong>
#end
]]></source>
</primary>
<source><![CDATA[

## 論理 OR

#if( $foo || $bar )
    <strong>これ OR あれ</strong>
#end
]]></source>

<primary>
    <p>
      If <em>$foo</em> is true, the Velocity Templating Engine has no
      need to look at <em>$bar</em>; whether <em>$bar</em> is true or
      false, the expression will be true, and <strong>This OR That</strong>
      will be output. If <em>$foo</em> is false,
      however, <em>$bar</em> must be checked. In this case, if
      <em>$bar</em> is also false, the expression evaluates to false and
      there is no output. On the other hand, if <em>$bar</em> is true,
      then the entire expression is true, and the output is
      <strong>This OR That</strong>
    </p>
</primary>
<p>
<em>$foo</em> が true ならば、Velocity テンプレートエンジンは <em>$bar</em>
を調べる必要はありません。
<em>$bar</em> が true であるか false であるかどうかに関係なく、
式は true となり、 <strong>これ OR あれ</strong> が出力されます。
<em>$foo</em> が false ならば、今度は <em>$bar</em> をチェックしなければなりません。
この場合、<em>$bar</em> も false ならば、式は false と評価して、出力はありません。
一方、<em>$bar</em> が true ならば、式全体が true になり、
出力は <strong>これ OR あれ</strong> となります。
</p>

<primary>
    <p>
    With logical NOT operators, there is only one argument :
    </p>
</primary>
    <p>
論理演算子 NOT では、引数は1つしかありません。
    </p>

<primary>
<source><![CDATA[

##logical NOT

#if( !$foo )
  <strong>NOT that</strong>
#end

]]></source>
</primary>
<source><![CDATA[

## 論理 NOT

#if( !$foo )
  <strong>NOT あれ</strong>
#end

]]></source>

<primary>
    <p>
    Here, the if <em>$foo</em> is true, then <em>!$foo</em> evaluates to
    false, and there is no output.  If <em>$foo</em> is false, then
    <em>!$foo</em> evaluates to true and <strong>NOT that</strong> will be
    output.  Be careful not to confuse this with the <em>quiet reference $!foo</em>
    which is something altogether different.
    </p>
</primary>
    <p>
ここで、 <em>$foo</em> が true であれば、 <em>!$foo</em> は false と評価され、
出力はありません。 <em>$foo</em> が false であれば、 <em>!$foo</em> は true 
と評価されて、 <strong>NOT あれ</strong> が出力されます。
これを <em>沈黙リファレンスの $!foo</em> と混同しないように注意してください。
全然違うものですから。
    </p>

 </section>

<section name="Loops" alias="#foreach ループ">

<primary>
   <strong>Foreach Loop</strong>
</primary>
   <strong>Foreach Loop</strong>

<primary>
    <p>
      The <em>#foreach</em> element allows for looping. For example:
    </p>
</primary>
    <p>
      <em>#foreach</em> 要素を使うとループ処理ができます。例えば
    </p>
<source><![CDATA[
<ul>
#foreach( $product in $allProducts )
    <li>$product</li>
#end
</ul>
]]></source>

<primary>
    <p>
    This <em>#foreach</em> loop causes the <em>$allProducts</em> list
    (the object) to be looped over for all of the products (targets) in
    the list. Each time through the loop, the value from
    <em>$allProducts</em> is placed into the <em>$product</em> variable.
    </p>
</primary>
<p>
この <em>#foreach</em> ループによって、<em>$allProducts</em> リスト
(オブジェクト) で製品(ターゲット)の全てについてループが行われます。
ループの一回一回で <em>$allProducts</em> からの値が <em>$product</em>
変数にセットされます。
</p>

<primary>
    <p>
    The contents of the <em>$allProducts</em> variable is a Vector, a
    Hashtable or an Array. The value assigned to the <em>$product</em>
    variable is a Java Object and can be referenced from a variable as
    such. For example, if <em>$product</em> was really a Product class
    in Java, its name could be retrieved by referencing the
    <em>$product.Name</em> method (ie: <em>$Product.getName()</em>).
    </p>
</primary>
<p>
<em>$allProducts</em> 変数の内容は、Vector、Hashtable、配列のいずれかです。
<em>$product</em> 変数に割り当てられる値は、Java オブジェクトで、
Java オブジェクトのように変数から参照できます。
たとえば、もし <em>$product</em> が本当に Java の Product クラスならば、
その名前は、<em>$product.Name</em> メソッド (= <em>$Product.getName()</em>)
で参照して取り出すことができます。
</p>

<primary>
    <p>
    Lets say that <em>$allProducts</em> is a Hashtable. If you wanted to
    retrieve the key values for the Hashtable as well as the objects
    within the Hashtable, you can use code like this:
    </p>
</primary>
      <p> 
$allProduct が Hashtable だとしましょう。もし Hashtable から、
キーの値と Hashtable 内のオブジェクトを取り出したい場合には、次のように
コードを使用します。
       </p> 
    
   <source><![CDATA[ 
   <ul> 
   #foreach( $key in $allProducts.keySet() ) 
       <li>Key: $key -> Value: $allProducts.get($key)</li> 
   #end 
   </ul> 
   ]]></source> 
<primary>
    <p>
    Velocity provides an easy way to get the loop counter so that you
    can do something like the following:
    </p>
</primary>
      <p> 
Velocity ではループカウンタを簡単に取得できるので、
次のようなことができます。
       </p> 
    
   <source><![CDATA[ 
   <table> 
   #foreach( $customer in $customerList ) 
       <tr><td>$velocityCount</td><td>$customer.Name</td></tr> 
   #end 
   </table> 
   ]]></source> 
    
<primary>
    <p>
    The default name for the loop counter variable reference, which is
    specified in the velocity.properties file, is $velocityCount. By
    default the counter starts at 1, but this can be set to either 0 or
    1 in the <code>velocity.properties</code> file. Here's what the loop
    counter properties section of the <code>velocity.properties</code>
    file appears:
    </p>
</primary>
       <p> 
ループカウンタ変数リファレンスのデフォルト名は、velocity.properties ファイル
に指定されている通り、$velocityCount です。カウンタはデフォルトでは
1 から開始しますが、<code>velocity.properties</code> ファイルで 0 か 1
のどちらかに設定できます。<code>velocity.properties</code> ファイルの
ループカウンタプロパティセクションの内容を以下に示します。
       </p> 
    
<primary>
<source><![CDATA[
# Default name of the loop counter
# variable reference.
directive.foreach.counter.name = velocityCount

# Default starting value of the loop
# counter variable reference.
directive.foreach.counter.initial.value = 1
]]></source>
</primary>
   <source><![CDATA[ 
   # ループカウンタ変数リファレンスのデフォルト名
   directive.foreach.counter.name = velocityCount
    
   # ループカウンタ変数リファレンスのデフォルト開始値
   directive.foreach.counter.initial.value = 1
   ]]></source> 
    

 </section>

<section name="Include" alias="#include">

<primary>
    <p>
    The <em>#include</em> script element allows the template designer to
    import a local file, which is then inserted into the location where
    the <em>#include</em> directive is defined. The contents of the file
    are not rendered through the template engine. For security reasons,
    the file to be included may only be under TEMPLATE_ROOT.
    </p>
</primary>
<p>
<em>#include</em> スクリプト要素でローカルファイルをインポートできます。
ファイルは <em>#include</em> 指示子が定義される位置に挿入されます。
ファイルの中身は、テンプレートエンジンによって処理されません。
セキュリティ上の理由から、インクルードされるファイルは、
TEMPLATE_ROOT 以下にあるものだけが許されます。
</p>

<source><![CDATA[
#include( "one.txt" )
]]></source>

<primary>
    <p>
    The file to which the <em>#include</em> directive refers is enclosed
    in quotes. If more than one file will be included, they should be
    separated by commas.
    </p>
</primary>
<p>
<em>#include</em> 指示子が参照するファイルは、引用符で囲まれます。
複数のファイルをインクルードする場合には、それらをコンマで区切ります。
</p>

<source><![CDATA[
#include( "one.gif","two.txt","three.htm" )
]]></source>

<primary>
    <p>
    The file being included need not be referenced by name; in fact, it
    is often preferable to use a variable instead of a filename. This
    could be useful for targeting output according to criteria
    determined when the page request is submitted. Here is an example
    showing both a filename and a variable.
    </p>
</primary>
<p>
インクルードされるファイルを名前で参照する必要はありません。
実際、多くの場合ファイル名の代わりに変数を使うことが望ましいです。
これは、ページ要求があったときに、事前に決めた基準にしたがって
出力を切り替えるのに役立ちます。
これは、ファイル名と変数両方を使用した例です。
</p>

<source><![CDATA[
#include( "greetings.txt", $seasonalstock )
]]></source>

 </section>

<section name="Parse" alias="#parse">

<primary>
    <p>
    The <em>#parse</em> script element allows the template designer to
    import a local file that contains VTL. Velocity will parse the VTL
    and render the template specified.
    </p>
</primary>
<p>
<em>#parse</em> スクリプト要素で
VTL を含むローカルファイルをインポートできます。
Velocity は、VTL を解析し、指定されたテンプレートを処理します。
</p>

<source><![CDATA[
#parse( "me.vm" )
]]></source>

<primary>
    <p>
    Like the <em>#include</em> directive, <em>#parse</em> can take a
    variable rather than a template. Any templates to which
    <em>#parse</em> refers must be included under TEMPLATE_ROOT. Unlike
    the <em>#include</em> directive, <em>#parse</em> will only take a
    single argument.
    </p>
</primary>
<p>
<em>#include</em> 指示子と同じく、<em>#parse</em> はテンプレートの代わりに変数をとることができます。
<em>#parse</em> が参照するテンプレートはすべて、TEMPLATE_ROOT 以下になければなりません。
<em>#include</em> 指示子と違って、<em>#parse</em> の引数は一つだけです。
</p>

<primary>
    <p>
    VTL templates can have <em>#parse</em> statements referring to
    templates that in turn have <em>#parse</em> statements. By default
    set to 10, the <em>parse_directive.maxdepth</em> line of the
    <code>velocity.properties</code> allows users to customize maximum
    number of <em>#parse</em> referrals that can occur from a single
    template. (Note: If the <em>parse_directive.maxdepth</em> property
    is absent from the <code>velocity.properties</code> file, Velocity
    will set this default to 10.) Recursion is permitted, for example,
    if the template <code>dofoo.vm</code> contains the following lines:
    </p>
</primary>
<p>
VTL テンプレートは、<em>#parse</em> 文で参照する
テンプレート内でさらに <em>#parse</em> 文で [別のテンプレートを]
参照できます。
単独のテンプレートでの <em>#parse</em> 
参照による入れ子の回数の最大値はデフォルトで10にセットされていて、
<code>velocity.properties</code> の
<em>parse_directive.maxdepth</em> 行で、カスタマイズできます。
(注：
<em>parse_directive.maxdepth</em> プロパティが <code>velocity.properties</code>
ファイルになければ、Velocity がこのデフォルトを 10 にセットします。)
再帰も可能です。例えば
テンプレート <code>dofoo.vm</code> が以下の行を含む場合、
</p>

<primary>
<source><![CDATA[
Count down.
#set( $count = 8 )
#parse( "parsefoo.vm" )
All done with dofoo.vm!
]]></source>
</primary>
<source><![CDATA[
カウントダウン。
#set( $count = 8 )
#parse( "parsefoo.vm" )
dofoo.vm の処理完了!
]]></source>

<primary>
    <p>
    It would reference the template <code>parsefoo.vm</code>, which
    might contain the following VTL:
    </p>
</primary>
<p>
このコードは以下の VTL の内容のテンプレート <code>parsefoo.vm</code> を参照します。
</p>

<primary>
<source><![CDATA[
$count
#set( $count = $count - 1 )
#if( $count > 0 )
    #parse( "parsefoo.vm" )
#else
    All done with parsefoo.vm!
#end
]]></source>
</primary>
<source><![CDATA[
$count
#set( $count = $count - 1 )
#if( $count > 0 )
    #parse( "parsefoo.vm" )
#else
    parsefoo.vm の処理完了!
#end
]]></source>

<primary>
<p>
    After "Count down." is displayed, Velocity passes through
    <code>parsefoo.vm</code>, counting down from 8. When the count
    reaches 0, it will display the "All done with parsefoo.vm!" message.
    At this point, Velocity will return to <code>dofoo.vm</code> and
    output the "All done with dofoo.vm!" message.
    </p>
</primary>
<p>
「カウントダウン。」が表示された後、
Velocity は <code>parsefoo.vm</code> を走査し、8 からカウントダウンします。
カウントが 0 に達すると、「parsefoo.vm の処理完了!」メッセージを表示します。
この時点で、Velocity は<code>dofoo.vm</code> に戻って、
「dofoo.vm の処理完了!」メッセージを出力します。
</p>

 </section>


<section name="Stop" alias="#stop">

<primary>
    <p>
    The <em>#stop</em> script element allows the template designer to
    stop the execution of the template engine and return. This is useful
    for debugging purposes.
    </p>
</primary>
<p>
<em>#stop</em> スクリプト要素でテンプレートエンジンの実行を止めることができます。
これは、デバッグするときに役立ちます。
</p>

<source><![CDATA[
#stop
]]></source>
 </section>

<section name="Velocimacros" alias="Velocimacro">

<primary>
    <p>
    The <em>#macro</em> script element allows template designers to
    define a repeated segment of a VTL template. Velocimacros are very
    useful in a wide range of scenarios both simple and complex. This
    Velocimacro, created for the sole purpose of saving keystrokes and
    minimizing typographic errors, provides an introduction to the
    concept of Velocimacros.
    </p>
</primary>
<p>
<em>#macro</em> スクリプト要素で、VTL
テンプレートで繰り返し出てくる部分を定義できます。
Velocimacro は、単純なものから複雑なものまで広範囲にわたるシナリオで非常に役立ちます。
次の Velocimacro は、
キーストロークを節約し、入力ミスを少なくするためだけに作られたものですが、 
Velocimacro の概念を紹介するのに役立つでしょう。
</p>

<source><![CDATA[
#macro( d )
<tr><td></td></tr>
#end
]]></source>

<primary>
    <p>
    The Velocimacro being defined in this example is <em>d</em>, and it
    can be called in a manner analogous to any other VTL directive:
    </p>
</primary>
<p>
この例で定義されている Velocimacro は <em>d</em> です。そして、
それは他の VTL 指示子 と同じような方法で呼び出すことができます：
</p>

<source><![CDATA[
#d()
]]></source>

<primary>
    <p>
    When this template is called, Velocity would replace <em>#d()</em>
    with a row containing a single, empty data cell.
    </p>
</primary>
<p>
このテンプレートが呼ばれると、Velocity は <em>#d()</em> を一つの、
空のデータセルを含んでいる列と置換します。
</p>

<primary>
    <p>
    A Velocimacro could take any number of arguments -- even zero
    arguments, as demonstrated in the first example, is an option -- but
    when the Velocimacro is invoked, it must be called with the same
    number of arguments with which it was defined. Many Velocimacros are
    more involved than the one defined above. Here is a Velocimacro that
    takes two arguments, a color and an array.
    </p>
</primary>
<p>
Velocimacro は任意の数の引数を取ることが出来ます
(最初の例で示したとおり引数なしでもかまいません)。
ただし、Velocimacro が呼び出されるとき、
定義されたのと同じ数の引数で呼ばれなければなりません。
多くの Velocimacro は、上で定義したものより多くの引数を含みます。
これは、色と配列という2つの引数をとる Velocimacro です。
</p>

<source><![CDATA[
#macro( tablerows $color $somelist )
#foreach( $something in $somelist )
    <tr><td bgcolor=$color>$something</td></tr>
#end
#end
]]></source>

<primary>
    <p>
    The Velocimacro being defined in this example, <em>tablerows</em>,
    takes two arguments. The first argument takes the place of
    <em>$color</em>, and the second argument takes the place of
    <em>$somelist</em>.
    </p>
</primary>
<p>
この例(<em>tablerows</em>)で定義されている Velocimacro は、2つの引数をとります。
最初の引数は、<em>$color</em> となり、2番目の引数は、<em>$somelist</em> となります。
</p>

<primary>
    <p>
    Anything that can be put into a VTL template can go into the body of
    a Velocimacro. The <em>tablerows</em> Velocimacro is a
    <em>foreach</em> statement. There are two <em>#end</em> statements
    in the definition of the <em>#tablerows</em> Velocimacro; the first
    belongs to the <em>#foreach</em>, the second ends the Velocimacro
    definition.
    </p>
</primary>
<p>
VTL テンプレートに入れられるものは何でも、Velocimacro の本体に入れることができます。
<em>tablerows</em> Velocimacro は、<em>foreach</em> 文です。
2つの <em>#end</em> 文が、<em>#tablerows</em> Velocimacro の定義にありますが、
最初の end で <em>#foreach</em> が終了し、二番目の end で Velocimacro 定義が終了します。
</p>

<source><![CDATA[
#set( $greatlakes = ["Superior","Michigan","Huron","Erie","Ontario"] )
#set( $color = "blue" )
<table>
    #tablerows( $color $greatlakes )
</table>
]]></source>

<primary>
    <p>
    Notice that <em>$greatlakes</em> takes the place of
    <em>$somelist</em>. When the <em>#tablerows</em> Velocimacro is
    called in this situation, the following output is generated:
    </p>
</primary>
<p>
<em>$greatlakes</em> が <em>$somelist</em> に代わることに注意してください。
<em>#tablerows</em> Velocimacro が上記のように呼ばれるとき、以下の出力が生成されます。
</p>

<source><![CDATA[
<table>
    <tr><td bgcolor="blue">Superior</td></tr>
    <tr><td bgcolor="blue">Michigan</td></tr>
    <tr><td bgcolor="blue">Huron</td></tr>
    <tr><td bgcolor="blue">Erie</td></tr>
    <tr><td bgcolor="blue">Ontario</td></tr>
</table>
]]></source>

<primary>
    <p>
    Velocimacros can be defined <em>inline</em> in a Velocity template,
    meaning that it is unavailable to other Velocity templates on the
    same web site. Defining a Velocimacro such that it can be shared by
    all templates has obvious advantages: it reduces the need to
    redefine the Velocimacro on numerous templates, saving work and
    reducing the chance of error, and ensures that a single change to a
    macro available to more than one template.
    </p>
</primary>
<p>
Velocimacro は Velocity テンプレート内で <em>インライン</em> で定義できますが、
その場合は同じ Web サイトの他の Velocity テンプレートには利用できません。
全てのテンプレートで共有できるような Velocimacro を定義することには、
明らかにいくつかの利点があります。例えば、多数のテンプレートで
Velocimacro をいちいち定義する必要を減らせますし、それにより作業量が節約されたり、
エラーの可能性が減りますし、一つのマクロに対する一箇所の変更が複数のテンプレートに反映されることを保証します。
</p>

<primary>
    <p>
    Were the <em>#tablerows($color $list)</em> Velocimacro defined in a
    Velocimacros template library, this macro could be used on any of
    the regular templates. It could be used many times and for many
    different purposes. In the template <code>mushroom.vm</code> devoted
    to all things fungi, the <em>#tablerows</em> Velocimacro could be
    invoked to list the parts of a typical mushroom:
    </p>
</primary>
<p>
<em>#tablerows($color $list)</em> Velocimacro が Velocimacro
テンプレートライブラリで定義されている場合、
このマクロはどの通常のテンプレートでも使うこともできます。
それは、何度でも使えますし、どんな用途でも使うことが出来ます。
菌類百科専門の <code>mushroom.vm</code> テンプレートの中で、
<em>#tablerows</em> Velocimacro は、
典型的なキノコの各部分をリストするために呼び出すことができます：
</p>

<source><![CDATA[
#set( $parts = ["volva","stipe","annulus","gills","pileus"] )
#set( $cellbgcol = "#CC00FF" )
<table>
#tablerows( $cellbgcol $parts )
</table>
]]></source>

<primary>
    <p>
    When fulfilling a request for <code>mushroom.vm</code>, Velocity
    would find the <em>#tablerows</em> Velocimacro in the template
    library (defined in the <code>velocity.properties</code> file) and
    generate the following output:
    </p>
</primary>
<p>
<code>mushroom.vm</code> の要求を満たすとき、Velocity は
<em>#tablerows</em> Velocimacro をテンプレートライブラリ
(<code>velocity.properties</code> ファイルにおいて定義されています) から見つけて、
以下の出力を生成します。
</p>

<source><![CDATA[
<table>
    <tr><td bgcolor="#CC00FF">volva</td></tr>
    <tr><td bgcolor="#CC00FF">stipe</td></tr>
    <tr><td bgcolor="#CC00FF">annulus</td></tr>
    <tr><td bgcolor="#CC00FF">gills</td></tr>
    <tr><td bgcolor="#CC00FF">pileus</td></tr>
</table>
]]></source>

<primary>
  <strong>Velocimacro Arguments</strong>
</primary>
  <strong>Velocimacro 引数</strong>

<primary>
  <p>
   Velocimacros can take as arguments any of the following
   VTL elements :
  </p>
</primary>
  <p>
   Velocimacro は、以下の VTL 要素のどれでも引数として取ることができます。
  </p>

<primary>
  <ul>
    <li>
      Reference : anything that starts with '$'
    </li>
    <li>
      String literal : something like "$foo" or 'hello'
    </li>
    <li>
      Number literal : 1, 2 etc
    </li>
    <li>
      IntegerRange : [ 1..2] or [$foo .. $bar]
    </li>
    <li>
      ObjectArray : [ "a", "b", "c"]
    </li>
    <li>
       boolean value true
    </li>
    <li>
       boolean value false
    </li>
  </ul>
</primary>
  <ul>
    <li> 
      リファレンス : 「$」で始まる全て
    </li>
    <li> 
      文字列リテラル : "$foo" や 'hello'のようなもの
    </li>
    <li> 
      数値リテラル : 1, 2 など
    </li>
    <li> 
      整数範囲 : [1..2] や [$foo .. $bar]
    </li>
    <li> 
      オブジェクト配列 : ["a", "b", "c"]
    </li>
    <li> 
       boolean 値の true
    </li>
    <li> 
       boolean 値の false
    </li>
  </ul>

<primary>
   <p>
     When passing references as arguments to Velocimacros,
     please note that references are passed 'by name'.
     This means that their value is 'generated' at each
     use inside the Velocimacro.  This feature allows you
     to pass references with method calls and have the
     method called at each use.  For example, when calling
     the following Velocimacro as shown
   </p>
</primary>
<p>
Velocimacro の引数としてリファレンスを渡す際、
リファレンスは「名前渡し」されることに注意してください。
つまり、Velocimacro 内で使われるたびにその値が「生成される」ことを意味します。
この機能を使って、リファレンスにメソッド呼び出しを渡して、
使うたびにそのメソッドを呼ぶようにできます。
例えば、以下に示すように Velocimacro を呼び出すと、
</p>

   <source><![CDATA[
     #macro( callme $a )
         $a $a $a
     #end

     #callme( $foo.bar() )
   ]]></source>

<primary>
    <p>
       results in the method bar() of the reference $foo
       being called 3 times.
    </p>
</primary>
<p>
結果として、リファレンス $foo のメソッド bar() が3回呼び出されます。
</p>

<primary>
    <p>
       At first glance, this feature appears surprising, but
       when you take into consideration the original motivation
       behind Velocimacros -- to eliminate cut'n'paste duplication
       of commonly used VTL -- it makes sense.  It allows you to
       do things like pass stateful objects, such as an object
       that generates colors in a repeating sequence for
       coloring table rows, into the Velocimacro.
    </p>
</primary>
   <p>
一見、この機能は驚くべきことのように見えます、
しかし、あなたが Velocimacro の背景にある最初の動機 ―
よく使われる VTL をカット&amp;ペーストすることによる重複を除去する ― 
を考慮すれば、納得できるかと思います。
この機能により、 Velocimacro に「状態を保持する」(Stateful) オブジェクト (例えばテーブル列に色をつけるために繰り返しシーケンスで色を生成するオブジェクト) を渡すようなことができます。
</p>

<primary>
    <p>
       If you need to circumvent this feature, you can always
       just get the value from the method as a new reference
       and pass that :
    </p>
</primary>
<p>
この機能を回避する必要があるならば、常にメソッドから値をリファレンスとして取得し、
それを渡せばよいのです。
</p>

    <source><![CDATA[
     #set( $myval = $foo.bar() )
     #callme( $myval )
   ]]></source>

<primary>
    <strong>Velocimacro Properties</strong>
</primary>
    <strong>Velocimacro プロパティ</strong>
    
<primary>
    <p>
    Several lines in the <code>velocity.properties</code> file allow for
    flexible implementation of Velocimacros.  Note that these are also
    documented in the <a href="developer-guide.html">Developer Guide</a>.
    </p>
</primary>
<p>
<code>velocity.properties</code>ファイル内の何行かを使えば、Velocimacro を柔軟に実装できます。
注意:　<a href="developer-guide.html">開発者ガイド</a>も参照してください。
</p>

<primary>
    <p>
    <code>velocimacro.library</code> - A comma-separated list of all
    Velocimacro template libraries. By default, Velocity looks for
    a single library: <em>VM_global_library.vm</em>. The configured template path
    is used to find the Velocimacro libraries.
    </p>
</primary>
<p>
<code>velocimacro.library</code>
─
全ての Velocimacro テンプレートライブラリのコンマ区切りリスト。
デフォルトでは、Velocity は <em>VM_global_library.vm</em>
というライブラリのみを探します。
設定されたテンプレートパスは Velomacro ライブラリを見つけるのに使用されます。
</p>

<primary>
    <p>
    <code>velocimacro.permissions.allow.inline</code> - This property,
    which has possible values of true or false, determines whether
    Velocimacros can be defined in regular templates. The default,
    true, allows template designers to define Velocimacros in the
    templates themselves.
    </p>
</primary>
<p>
<code>velocimacro.permissions.allow.inline</code>
─
このプロパティは true または false の値を取ることができ、
Velocimacro を通常のテンプレートで定義できるかどうか判定します。
デフォルト (true) では、テンプレートで Velocimacro を定義できます。
</p>

<primary>
    <p>
    <code>velocimacro.permissions.allow.inline.to.replace.global</code> -
     With possible values of true or false,
    this property allows the user to specify if a  Velocimacro defined
    inline in a template can replace a globally defined template, one
    that was loaded on startup via the <code>velocimacro.library</code>
    property. The default, <code>false</code>, prevents
    Velocimacros defined inline in a template from replacing those
    defined in the template libraries loaded at startup.
    </p>
</primary>
<p>
<code>velocimacro.permissions.allow.inline.to.replace.global</code>
─
このプロパティは true または false の値を取ることができ、
テンプレート内でインラインで定義された Velocimacro が
グローバルで定義されたテンプレート
(スタートアップ時に<code>velocimacro.library</code>
プロパティ経由でロードされたもの)
を上書きできるかどうかを指定します。
デフォルトでは <code>false</code> なので、
スタートアップでロードされたテンプレートライブラリで定義されたものは
インラインの Velocimacro では上書きできません。
</p>

<primary>
   <p>
    <code>velocimacro.permissions.allow.inline.local.scope</code> - This
    property, with possible values of true or false, defaulting to false,
    controls if Velocimacros defined inline are 'visible' only to the
    defining template.  In other words, with this property set to true,
    a template can define inline VMs that are usable only by the defining
    template.  You can use this for fancy VM tricks - if a global VM calls
    another global VM, with inline scope, a template can define a
    private implementation of the second VM that will be called by the
    first VM when invoked by that template.  All other templates
    are unaffected.
    </p>
</primary>
<p>
<code>velocimacro.permissions.allow.inline.local.scope</code>
─
このプロパティは true または false の値を取ることができ、
デフォルトは false です。
インラインで定義された Velocimacro が、
定義したテンプレートでだけ「見える」かどうかを制御します。
つまり、このプロパティを true にすると、定義されたテンプレート内でのみ有効な
インライン VM を定義することが出来ます。
これを使った、手の込んだ VM のテクニックがあります。
グローバルな VM が別のグローバルな VM を呼ぶ場合、
テンプレートはインラインスコープで、前者の VM から呼ばれる後者の
VM のプライベート実装を定義できます。
他のどのテンプレートにも影響ありません。
</p>

<primary>
    <p>
    <code>velocimacro.context.localscope</code> - This property has the
    possible values true or false, and the default is false.  When true,
    any modifications to the context via #set() within a Velocimacro
    are considered 'local' to the Velocimacro, and will not
    permanently affect the context.
    </p>
</primary>
<p>
<code>velocimacro.context.localscope</code>
─
このプロパティは true または false の値を取ることができ、
デフォルトは false です。
true のときは、Velocimacro 内の #set() によるコンテキストへの変更はすべて、
Velocimacro に「ローカル」であると扱われて、
コンテキストに永続的な影響を及ぼしません。
</p>

<primary>
    <p>
    <code>velocimacro.library.autoreload</code> - This property
     controls Velocimacro library autoloading. The default value
    is <code>false</code>.  When set to <code>true</code>
    the source Velocimacro library for an invoked Velocimacro will be checked
    for changes, and reloaded if necessary.  This allows you to change and
    test Velocimacro libraries without having to restart your application or
    servlet container, just like you can with regular templates.
    This mode only works when caching is <i>off</i>
    in the resource loaders (e.g. <code>file.resource.loader.cache = false</code> ).
    This feature is intended for development, not for production.
    </p>
</primary>
<p>
<code>velocimacro.library.autoreload</code>
─
このプロパティは Velocimacro の自動ロードを制御します。
デフォルトの値は <code>false</code> です。
<code>true</code> にセットされると、呼び出された Velocimacro に対応する
Velocimacro ライブラリのソース変更がチェックされ、必要に応じてリロードされます。
これにより、ちょうど普通のテンプレートでできるように、
アプリケーションやサーブレットコンテナを再起動せずに Velocimacro 
ライブラリを変更、テストすることができます。
このモードはリソースローダーでキャッシングを <i>off</i> にした時
(例えば <code>file.resource.loader.cache = false</code> にした時)
だけ有効です。
この機能は開発用で、本番環境用ではありません。
</p>

<primary>
    <strong>Velocimacro Trivia</strong>
</primary>
    <strong>Velocimacro まめ知識</strong>

<primary>
    <p>
    Currently, Velocimacros must be defined before they are first
    used in a template.  This means that your #macro() declarations
    should come before using the Velocimacros.
    </p>
</primary>
<p>
現在、Velocimacro はテンプレートで最初に使われる前に定義されていなければなりません。
つまり、 #macro() 宣言が Velocimacro を使う前に出てくる必要があります。
</p>

<primary>
    <p>
    This is important to remember if you try to #parse()
    a template containing inline #macro() directives.  Because
    the #parse() happens at runtime, and the parser decides if
    a VM-looking element in the template is a VM at parsetime,
    #parse()-ing a set of VM declarations won't work as expected.
    To get around this, simply use the <code>velocimacro.library</code>
    facility to have Velocity load your VMs at startup.
    </p>
</primary>
<p>
インラインの #macro() 指示子を含んでいるテンプレートを #parse()
しようとするときには、このことに気をつける必要があります。
というのも、 #parse() は実行時に発生し、
パーサはテンプレート中の VM のように見える要素が VM かどうかをパース時に判定するため、
VM 宣言を #parse() しても期待したようには動かないのです。
これを回避するには、単に <code>velocimacro.library</code> 機能を使ってください。 
Velocity はあなたの VM を起動時にロードします。
</p>

 </section>

<section name="Escaping VTL Directives" alias="VTL 指示子をエスケープする">
<primary>
  <p>
    VTL directives can be escaped with the backslash character ("\") in
    a manner similar to valid VTL references.
  </p>
</primary>
<p>
VTL 指示子は、VTL リファレンスと同様に、バックスラッシュ (「\」)
でエスケープできます。
</p>

<primary>
<source><![CDATA[
## #include( "a.txt" ) renders as <contents of a.txt>
#include( "a.txt" )

## \#include( "a.txt" ) renders as \#include( "a.txt" )
\#include( "a.txt" )

## \\#include ( "a.txt" ) renders as \<contents of a.txt>
\\#include ( "a.txt" )
]]></source>
</primary>
<source><![CDATA[
## #include( "a.txt" ) は <a.txtの内容> として処理される
#include( "a.txt" )

## \#include( "a.txt" ) は \#include( "a.txt" ) として処理される
\#include( "a.txt" )

## \\#include ( "a.txt" ) は \<a.txt の内容> として処理される
\\#include ( "a.txt" )
]]></source>

<primary>
  <p>
  Extra care should be taken when escaping VTL directives that contain
  multiple script elements in a single directive (such as in an
  if-else-end statements). Here is a typical VTL if-statement:
  </p>
</primary>
<p>
一つの指示子に複数のスクリプト要素が含まれている VTL 指示子
(if-else-end 文など)をエスケープする時は、
特に注意が必要です。
典型的な VTL の if 文は以下のようなものです：
</p>

<source><![CDATA[
#if( $jazz )
    Vyacheslav Ganelin
#end
]]></source>

<primary>
  <p>
  If <em>$jazz</em> is true, the output is
  </p>
</primary>
<p>
<em>$jazz</em> が true ならば、出力は
<source><![CDATA[ 
    Vyacheslav Ganelin 
]]></source> 
です。
</p> 

<primary>
  <p>
  If <em>$jazz</em> is false, there is no output. Escaping script elements
  alters the output. Consider the following case:
  </p>
</primary>
     <p> 
<em>$jazz</em>が false ならば、出力はありません。
スクリプト要素をエスケープすると、出力が変わります。
以下の場合を考えてみましょう。
</p>

<source><![CDATA[
\#if( $jazz )
    Vyacheslav Ganelin
\#end
]]></source>

<primary>
  <p>
  Whether <em>$jazz</em> is true or false, the output will be
  </p>
</primary>
<p>
<em>$jazz</em>が ture か false かどうかに関係なく、
出力は、
</p>

<primary>
<source><![CDATA[ 
#if($ jazz ) 
    Vyacheslav Ganelin 
#end 
]]></source> 
</primary>
<source><![CDATA[ 
#if($ jazz ) 
    Vyacheslav Ganelin 
#end 
]]></source> 
となるでしょう。

<primary>
  <p>
  In fact, because all script elements
  are escaped, <em>$jazz</em> is never evaluated for it's boolean value.
  Suppose
  backslashes precede script elements that are legitimately escaped:
  </p>
</primary>
<p>
実際、全てのスクリプト要素がエスケープされるので、<em>$jazz</em>
の真偽は決してチェックされません。
バックスラッシュが正しくエスケープされたスクリプト要素の前にあるとしましょう。
</p>

<source><![CDATA[
\\#if( $jazz )
   Vyacheslav Ganelin
\\#end
]]></source>

<primary>
  <p>
  In this case, if <em>$jazz</em> is true, the output is
  </p>
</primary>
<p>
この場合、<em>$jazz</em>が true ならば、出力は
</p>

<primary>
<source><![CDATA[ 
\ Vyacheslav Ganelin 
\ 
]]></source> 

</primary>
<source><![CDATA[ 
\ Vyacheslav Ganelin 
\ 
]]></source> 
<p>
となります。
</p>

<primary>
  <p>
  To understand this, note that the <code>#if( arg ) </code> when
  ended by a newline (return) will omit the newline from the output.
  Therefore, the body of the <code>#if()</code>
  block follows the first '\', rendered
  from the '\\' preceding the <code>#if()</code>.
   The last \ is on a different
  line than the text because there is a newline after 'Ganelin', so
  the final \\, preceding the <code>#end</code> is part of the
  body of the block.
  </p>
</primary>
<p> 
これを理解するためには、<code>#if( arg ) </code>が
改行(return) で終了しているときに、その改行は出力から除外されることに着目してください。
そのため、<code>#if()</code> ブロックのボディが最初の「\」 (<code>#if()</code> とその前の 「\\」 の処理結果)に続きます。
最後の「\」は別の行になっています。それは、「Ganelin」の後に改行があり、
<code>#end</code> の前にある最後の \\ は、ブロックのボディの一部であるためです。
</p>

<primary>
  <p>
  If <em>$jazz</em> is false, there is no output. Note that
  things start to break if script elements are not properly escaped.
  </p>
</primary>
<p>
<em>$jazz</em>が false ならば、出力はありません。
[訳注：実際には、<code>#if( arg ) </code> とその前の「\\」の処理結果である「\」
だけが出力されます。]
スクリプト要素が適切にエスケープされていなけば、おかしくなることに注意してください。
</p>


<source><![CDATA[
\\\#if( $jazz )
    Vyacheslave Ganelin
\\#end
]]></source>

<primary>
  <p>
  Here the <em>#if</em> is escaped, but there is an <em>#end</em>
  remaining; having too many endings will cause a parsing error.
  </p>
</primary>
<p>
ここでは、<em>#if</em> はエスケープされますが、<em>#end</em> が残っています。
end が余分なので、解析エラーを引き起こすことになります。
</p>

</section>

<section name="VTL: Formatting Issues" alias="VTL のフォーマット">

<primary>
    <p>
    Although VTL in this user guide is often displayed with newlines and
    whitespaces, the VTL shown below
    </p>
</primary>
  <p>
このユーザガイドの中の VTL は多くの場合、下記のように改行と空白を含んで表示されています。
    </p>

<source><![CDATA[
#set( $imperial = ["Munetaka","Koreyasu","Hisakira","Morikune"] )
#foreach( $shogun in $imperial )
    $shogun
#end
]]></source>

<primary>
    <p>
    is equally valid as the following snippet that Geir Magnusson Jr.
    posted to the Velocity user mailing list to illustrate a completely
    unrelated point:
    </p>
</primary>
<p>
Geir Magnusson Jr. は、改行や空白が全く無関係というのを示すために Velocity ユーザのメーリングリストに次のようなコードを投稿しました。
</p>
<source><![CDATA[
Send me #set($foo = ["$10 and ","a cake"])#foreach($a in $foo)$a #end please.
]]></source>

<primary>
    <p>
    Velocity's behaviour is to gobble up excess whitespace. The
    preceding directive can be written as:
    </p>
</primary>
<p>
Velocity は、余分な空白を吸収するように振舞います。
上の指示子は以下のように書くことができます：
</p>

<source><![CDATA[
Send me
#set( $foo = ["$10 and ","a cake"] )
#foreach( $a in $foo )
$a
#end
please.
]]></source>

<primary>
    <p>
    or as
    </p>
</primary>
 <p>
    または
    </p>
<source><![CDATA[
Send me
#set($foo       = ["$10 and ","a cake"])
                 #foreach           ($a in $foo )$a
         #end please.
]]></source>

<primary>
    <p>
    In each case the output will be the same.
    </p>
</primary>
   <p>
    どちらの場合も出力は同じです。
    </p>
</section>

<section name="Other Features and Miscellany" alias="その他の機能">

<subsection name="Math" alias="Math">

<primary>
  <p>
    Velocity has a handful of built-in mathematical functions that can
    be used in templates with the <em>set</em> directive. The following
    equations are examples of addition, subtraction, multiplication and
    division, respectively:
  </p>
</primary>
<p>
Velocity には一握りですが組み込みの計算機能があり、
テンプレートの<em>set</em> 指示子で使うことができます。
以下の式は、それぞれ加算、減算、乗算、除算の例です。
</p>

<source><![CDATA[
#set( $foo = $bar + 3 )
#set( $foo = $bar - 4 )
#set( $foo = $bar * 6 )
#set( $foo = $bar / 2 )
]]></source>

<primary>
  <p>
    When a division operation is performed, the result will be an
    integer. Any remainder can be obtained by using the modulus
    (<em>%</em>) operator.
  </p>
</primary>
<p>
除算が実行される場合も結果は整数となります。
余りについては剰余演算子 (「<em>%</em>」) を使って取得できます。
</p>

<source><![CDATA[
#set( $foo = $bar % 5 )
]]></source>

<primary>
  <p>
    Only integers (...-2, -1, 0, 1, 2...) are permissible when
    performing mathematical equations in Velocity; when a non-integer is
    used, it is logged and a null will be returned as the output.
  </p>
</primary>
<p>
Velocity で数式演算を実行する時は、整数だけ(...-2、-1、0、1、2...)が許可されており、
非整数が使われるとログに記録され、null が出力として返されます。
</p>

  </subsection>

<subsection name="Range Operator" alias="範囲演算子">

<primary>
  <p>
    The range operator can be used in conjunction with <em>#set</em> and
    <em>#foreach</em> statements. Useful for its ability to produce an
    object array containing integers, the range operator has the
    following construction:
  </p>
</primary>
<p>
範囲演算子は、<em>#set</em> や <em>#foreach</em> 文と一緒に使うことができます。
要素に整数を持つオブジェクト配列を生成するのに役立つ範囲演算子は、
次のように生成できます。
</p>

<source><![CDATA[
[n..m]
]]></source>

<primary>
  <p>
    Both <em>n</em> and <em>m</em> must either be or produce integers.
    Whether <em>m</em> is greater than or less than <em>n</em> will not
    matter; in this case the range will simply count down. Examples
    showing the use of the range operator as provided below:
  </p>
</primary>
<p>
<em>n</em> と <em>m</em> は両方とも整数であるか、整数を生成しなければなりません。
<em>m</em> が、<em>n</em> より大きいか、小さいかは重要ではありません;
より小さい場合には、範囲は単にカウントダウンします。
下記は範囲演算子の使い方を示している例です。
</p>

<primary>
<source><![CDATA[
First example:
#foreach( $foo in [1..5] )
$foo
#end

Second example:
#foreach( $bar in [2..-2] )
$bar
#end

Third example:
#set( $arr = [0..1] )
#foreach( $i in $arr )
$i
#end

Fourth example:
[1..3]
]]></source>
</primary>
<source><![CDATA[
例1:
#foreach( $foo in [1..5] )
$foo
#end

例2:
#foreach( $bar in [2..-2] )
$bar
#end

例3:
#set( $arr = [0..1] )
#foreach( $i in $arr )
$i
#end

例4:
[1..3]
]]></source>

<primary>
  <p>
    Produces the following output:
  </p>
</primary>
  <p>
    以下の出力を生成します:
  </p>

<primary>
<source><![CDATA[
First example:
1 2 3 4 5

Second example:
2 1 0 -1 -2

Third example:
0 1

Fourth example:
[1..3]
]]></source>
</primary>
<source><![CDATA[
例1:
1 2 3 4 5

例2:
2 1 0 -1 -2

例3:
0 1

例4:
[1..3]
]]></source>

<primary>
  <p>
    Note that the range operator only produces the array when used in
    conjunction with <em>#set</em> and <em>#foreach</em> directives, as
    demonstrated in the fourth example.
  </p>
</primary>
<p>
4番目の例が示しているとおり、範囲演算子は <em>#set</em> と <em>#foreach</em>
指示子とともに使われた時だけ配列を生成することに注意してください。
</p>

<primary>
  <p>
    Web page designers concerned with making tables a standard size, but
    where some will not have enough data to fill the table, will find
    the range operator particularly useful.
  </p>
</primary>
<p>
HTMLの表を決まったサイズにしたいのに、
表を埋めるにはデータが足りないこともあります。
そんな時、範囲演算子は特に便利です。
</p>

  </subsection>

<subsection name="Advanced Issues: Escaping and !" alias="高度な問題: エスケープと 「!」 ">

<primary>
  <p>
    When a reference is silenced with the <em>!</em> character and the
    <em>!</em> character preceded by an <em>\</em> escape character, the
    reference is handled in a special way. Note the differences between
    regular escaping, and the special case where <em>\</em> precedes
    <em>!</em> follows it:
  </p>
</primary>
<p>
リファレンスを「<em>!</em>」で沈黙させていて、
「<em>!</em>」の前に「<em>\</em>」エスケープ文字があるときは、
リファレンスは特別扱いされます。
通常のエスケープと、
「<em>\</em>」に「<em>!</em>」が続く特別な場合の違いに注意してください。
</p>

<source><![CDATA[
#set( $foo = "bar" )
$\!foo
$\!{foo}
$\\!foo
$\\\!foo
]]></source>

<primary>
  <p>
   This renders as:
  </p>
</primary>
   <p>
これは以下のように処理されます。
[訳注: 2行目は実際には「$!{」となります。]
  </p>

<source><![CDATA[
$!foo
$!{foo}
$\!foo
$\\!foo
]]></source>

<primary>
  <p>
   Contrast this with regular escaping, where <em>\</em> precedes
   <em>$</em>:
  </p>
</primary>
<p>
これを、「<em>\</em>」が「<em>$</em>」に先行する、通常のエスケープと比較してみましょう。
</p>

<source><![CDATA[
\$foo
\$!foo
\$!{foo}
\\$!{foo}
]]></source>

<primary>
  <p>
    This renders as:
  </p>
</primary>
  <p>
これは以下のように処理されます。<br/>
  </p>

<source><![CDATA[
$foo
$!foo
$!{foo}
\bar
]]></source>

 </subsection>

  <subsection name="Velocimacro Miscellany" alias="Velocimacro いろいろ"> 
    
<primary>
<p>
This section is a mini-FAQ on topics relating to Velocimacros.  This
section will change over time, so it's worth checking for new information
from time to time.
</p>
</primary>
   <p> 
このセクションは、Velocimacro に関するミニ FAQ です。
このセクションは、時とともに変更されるでしょう、
ですから新しい情報を時々確認するのは有用です。
[訳注：このバージョンでは変更されませんが、
次のバージョンでは変更されているかもしれません]
   </p> 
    
<primary>
<p>
Note : Throughout this section, 'Velocimacro' will commonly be abbreviated
as 'VM'.
</p>
</primary>
   <p> 
   注意: このセクションでは、「Velocimacro」は通常「VM」と略します。
   </p> 
    
<primary>
<strong>Can I use a directive or another VM as an argument to a VM?</strong>
</primary>
   <strong>VM の引数として指示子や他の VM を使用できますか?</strong> 
    
<primary>
<p>
Example : <code>#center( #bold("hello") )</code>
</p>
</primary>
   <p> 
   例 : <code>#center( #bold("hello") )</code> 
   </p> 
    
<primary>
<p>
No.  A directive isn't a valid argument to a directive, and for most practical
purposes, a VM is a directive.
</p>
</primary>
   <p> 
いいえ。指示子は指示子の有効な引数にはなりません。
また、一般的に、 VM は指示子です。
   </p> 
    
<primary>
<p>
<i>However...</i>, there are things you can do. One easy solution is to take
advantage of the fact that 'doublequote' (") renders it's contents. So you
could do something like
</p>
</primary>
   <p> 
<i>それでも…</i>、解決策はあります。簡単なものとして、
ダブルクォート (") がその内容を処理することを利用する方法があります。
なので、このようにできます。
   </p> 
    
   <source><![CDATA[ 
   #set($stuff = "#bold('hello')" ) 
   #center( $stuff ) 
   ]]></source> 
    
<primary>
<p>
You can save a step...
</p>
</primary>
   <p> 
   以下のように省略も可能です…
   </p> 
    
   <source><![CDATA[ 
   #center( "#bold( 'hello' )" ) 
   ]]></source> 
    
<primary>
<p>
Please note that in the latter example the arg
is evaluated <i>inside</i> the VM, not at the
calling level.  In other words, the argument to
the VM is passed in in its entirety and evaluated within the VM
it was passed into. This allows you to do things like :
</p>
</primary>
   <p> 
注意: 後者の例では、引数は VM <i>内部</i>で評価されます。呼び出し時ではありません。
言い換えると、VM への引数は、そっくりそのまま渡されて、
渡された VM の中で評価されます。その結果、次のようなことが可能です。
   </p> 
    
   <source><![CDATA[ 
    
   #macro( inner $foo ) 
     inner : $foo 
   #end 
    
   #macro( outer $foo ) 
      #set($bar = "outerlala") 
      outer : $foo 
   #end 
    
   #set($bar = 'calltimelala') 
   #outer( "#inner($bar)" ) 
    
   ]]></source> 
    
<primary>
<p>
Where the output is
</p>
</primary>
   <p> 
   ここで出力は以下のようになります。
   </p> 
    
   <source><![CDATA[ 
   outer : inner : outerlala 
   ]]></source> 
    
<primary>
<p>
because the evaluation of the "#inner($bar)" happens inside #outer(), so the
$bar value set inside #outer() is the one that's used.
</p>
</primary>
   <p> 
"#inner($bar)" の評価は、#outer() の内部で発生するため、
$bar の値としては #outer() 内部でセットされたその値が使われます。
   </p> 
    
<primary>
<p>
This is an intentional and jealously guarded feature - args are passed 'by
name' into VMs, so you can hand VMs things like stateful references such as
</p>
</primary>
   <p> 
この機能は意図的なものであり、十分に保護されています
─ 引数は VM に「名前渡し」されるので、以下のように、
「状態を保持する」(Stateful) リファレンスなどを
VM に渡すことが出来ます。
   </p> 
    
   <source><![CDATA[ 
   #macro( foo $color ) 
     <tr bgcolor=$color><td>Hi</td></tr> 
     <tr bgcolor=$color><td>There</td></tr> 
   #end 
    
   #foo( $bar.rowColor() ) 
   ]]></source> 
    
<primary>
<p>
And have rowColor() called repeatedly, rather than just once.  To avoid that,
invoke the method outside of the VM, and pass the value into the VM.
</p>
</primary>
   <p> 
また、rowColor() は1回ではなく、[#foo() の呼び出しごとに] 何度も呼ばれます。
これを禁止するには、 VM の外側でメソッドを呼び出し、
VM には値を渡してください。
   </p> 
    
   <source><![CDATA[ 
   #set($color = $bar.rowColor()) 
   #foo( $color ) 
   ]]></source> 
 

<primary>
<strong>Can I register Velocimacros via #parse() ? </strong>
</primary>
  <strong>#parse() を使って Velocimacro を登録できますか ? </strong> 

<primary>
    <p>
    Currently, Velocimacros must be defined before they are first
    used in a template.  This means that your #macro() declarations
    should come before using the Velocimacros.
    </p>
</primary>
<p>
現在、Velocimacro はテンプレートで最初に使われる前に定義されていなければなりません。
つまり、 #macro() 宣言が Velocimacro を使う前に出てくる必要があります。
</p>

<primary>
    <p>
    This is important to remember if you try to #parse()
    a template containing inline #macro() directives.  Because
    the #parse() happens at runtime, and the parser decides if
    a VM-looking element in the template is a VM at parsetime,
    #parse()-ing a set of VM declarations won't work as expected.
    To get around this, simply use the <code>velocimacro.library</code>
    facility to have Velocity load your VMs at startup.
    </p>
</primary>
<p>
インラインの #macro() 指示子を含んでいるテンプレートを #parse()
しようとするときには、このことに気をつける必要があります。
というのも、 #parse() は実行時に行われ、
パーサは、テンプレート内の VM のように見える要素が VM かどうかをパース時に決定するため、
VM の宣言を #parse() しても期待したようには動かないのです。
これを回避するには、単に <code>velocimacro.library</code> 機能を使ってください。 
Velocity はあなたの VM を起動時にロードします。
</p>


<primary>
<strong>What is Velocimacro Autoreloading?</strong>
</primary>
  <strong>Velocimacro 自動再ロードとは ?</strong>

<primary>
  <p>
   There is a property, meant to be used in <i>development</i>,
   not production :
  </p>
</primary>
  <p>
   そのためのプロパティがあります。これは<i>開発時</i>に使用するためのもので、
本番環境用ではありません。
  </p>
  
<primary>
  <p>
  <code>velocimacro.library.autoreload</code>
  </p>
</primary>
  <p>
  <code>velocimacro.library.autoreload</code>
  </p>

<primary>
   <p>
   which defaults to false.  When set to true <em>along with</em>
   </p>
</primary>
   <p>
   デフォルトは、 false です。 true にセットする時は、<em>下記の指定と一緒に</em>使います。
   </p>
   
<primary>
   <p>
   <code>&lt;type&gt;.resource.loader.cache = false</code>
   </p>
</primary>
   <p>
   <code>&lt;type&gt;.resource.loader.cache = false</code>
   </p>
    
<primary>
    <p>
    (where &lt;type&gt; is the name of the resource loader that you
    are using, such as 'file') then the Velocity engine will automatically
    reload changes to your Velocimacro library files when you make them,
    so you do not have to dump the servlet engine (or application) or do
    other tricks to have your Velocimacros reloaded.
    </p>
</primary>
    <p>
(ここで、 &lt;type&gt; は、'file' など使用するリソースローダの名前です)
そうすると Velocity エンジンは、自動的にあなたの Velocimacro 
ライブラリファイルが変更されたときに変更をリロードしようとします。
そのため、サーブレットエンジン (あるいはアプリケーション) を再起動したり
Velocimacro をリロードするために小細工をする必要はありません。
    </p>

<primary>
    <p>
    Here is what a simple set of configuration properties would look like.
    </p>
</primary>
    <p>
簡単なプロパティ設定はこのようになります。
    </p>

    <source><![CDATA[
    file.resource.loader.path = templates
    file.resource.loader.cache = false
    velocimacro.library.autoreload = true
    ]]></source>

<primary>
    <p>
    Don't keep this on in production.
    </p>
</primary>
    <p>
本番環境ではこの状態のままにしておかないでください。
    </p>

</subsection>

<subsection name="String Concatenation" alias="文字列の連結">

<primary>
    <p>
    A common question that developers ask is
    <i>How do I do String concatenation?  Is there any
    analogue to the '+' operator in Java?</i>.
   </p>
</primary>
<p>
開発者共通の疑問として、
「文字列の連結はどうするのか？Javaにおける '+' 
演算子のようなものがあるのか？」というのがあります。
</p>

<primary>
   <p>
    To do concatenation of references in VTL, you
    just have to 'put them together'.  The context of
    where you want to put them together does matter, so
    we will illustrate with some examples.
   </p>
</primary>
<p>
VTLにおいてリファレンスの結合を行うには、単に
「並べて記述する」だけです。
並べて記述するといっても状況によりますので、
いくつかの例を使って示します。 
</p>

<primary>
   <p>
    In the regular 'schmoo' of a template (when you are mixing
    it in with regular content) :
   </p>
</primary>
<p>
テンプレートの一般的な「シュムー」[訳注：VTL
以外の部分]において(一般的な内容に混ぜる時)、
   </p>

<primary>
   <source><![CDATA[
       #set( $size = "Big" )
       #set( $name = "Ben" )

      The clock is $size$name.
   ]]></source>
</primary>
   <source><![CDATA[
       #set( $size = "Big" )
       #set( $name = "Ben" )

      その時計は $size$name.
   ]]></source>

<primary>
   <p>
     and the output will render as 'The clock is BigBen'.
     For more interesting cases, such as when you want to concatenate
     strings to pass to a method, or to set a new reference, just
     do
   </p>
</primary>
<p>
出力は「その時計は BigBen.」と処理されます。
もうすこし面白い例として、メソッドに渡すために文字列を結合したい場合や
新しいリファレンスにセットしたい場合は以下のようにします。
</p>

<primary>
   <source><![CDATA[
      #set( $size = "Big" )
      #set( $name = "Ben" )

      #set($clock = "$size$name" )

      The clock is $clock.
    ]]></source>
</primary>
   <source><![CDATA[
      #set( $size = "Big" )
      #set( $name = "Ben" )

      #set($clock = "$size$name" )

      その時計は $clock.
    ]]></source>

<primary>
    <p>
     Which will result in the same output.  As a final example, when
     you want to mix in 'static' strings with your references, you may
     need to use 'formal references' :
    </p>
</primary>
<p>
結果として同じ出力になります。
最後の例として、リファレンスを「静的な」文字列と混ぜたい場合、
「正式リファレンス」を使う必要があるかもしれません。
    </p>

<primary>
    <source><![CDATA[
      #set( $size = "Big" )
      #set( $name = "Ben" )

      #set($clock = "${size}Tall$name" )

      The clock is $clock.
    ]]></source>
</primary>
    <source><![CDATA[
      #set( $size = "Big" )
      #set( $name = "Ben" )

      #set($clock = "${size}Tall$name" )

      その時計は $clock.
    ]]></source>

<primary>
    <p>
      Now the output is 'The clock is BigTallBen'.  The
      formal notation is needed so the parser knows you
      mean to use the reference '$size' versus '$sizeTall'
      which it would if the '{}' weren't there.
    </p>
</primary>
<p>
出力は「その時計は BigTallBen.」になります。正式表記は
パーサに「$sizeTall」ではなく「$size」リファレンスを使うということを
知らせるのに必要です。「{}」がないと「$sizeTall」になってしまいます。
</p>

</subsection>

</section>

<section name="Feedback" alias="フィードバック">

<primary>
  <p>
    If you encounter any mistakes in this manual or have
    other feedback related to the Velocity User Guide, please
    email the
    <a href="mailto:velocity-user@jakarta.apache.org">Velocity user list</a>.
    Thanks!
  </p>
</primary>
<p>
このマニュアルの誤りなど、Velocity ユーザガイドに関するフィードバックを行う時は、
<a href="mailto:velocity-user@jakarta.apache.org">Velocity ユーザメーリングリスト</a>
に電子メールを送ってください。
よろしくお願いします。
</p>

</section>

</body>
</document>

