/*
 * $Header: /home/cvs/struts/xdocs/struts1.2/documentation/ja/src/share/org/apache/struts/action/ActionErrors.java,v 1.8 2005/04/02 13:52:09 tatakaha Exp $
 * $Revision: 1.8 $
 * $Date: 2005/04/02 13:52:09 $
 *
 * Copyright 2000-2004 The Apache Software Foundation.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.struts.action;

import java.io.Serializable;

/**
 * <p><code>ActionForm</code>の<code>validate()</code>メソッドが報告するエラーメッセージをカプセル化するクラスです。
 * バリデーションエラーは関連する<code>ActionForm</code> Bean全体でグローバル、
 * またはある特定のBeanプロパティに固有
 * (すなわち、対応するフォームの特定入力フィールドに固有) です。</p>
 * {@primary <p>A class that encapsulates the error messages being reported by
 * the <code>validate()</code> method of an <code>ActionForm</code>.
 * Validation errors are either global to the entire <code>ActionForm</code>
 * bean they are associated with, or they are specific to a particular
 * bean property (and, therefore, a particular input field on the corresponding
 * form).</p>}
 *
 * <p>個々のエラーは<code>ActionMessage</code>オブジェクトで記述されます。
 * このオブジェクトは、
 * (適切なメッセージリソースデータベースを検索するための)メッセージキーを含み、
 * メッセージ内のパラメータの置換に用いられる4つまでのプレースホルダ引数を持ちます。</p>
 * {@primary <p>Each individual error is described by an <code>ActionMessage</code>
 * object, which contains a message key (to be looked up in an appropriate
 * message resources database), and up to four placeholder arguments used for
 * parametric substitution in the resulting message.</p>}
 *
 * <p><strong>実装上の注意</strong> - 
 * これらのオブジェクトはシングルスレッドのコンテキスト内でのみ生成・操作されることを前提としています。
 * 従って、内部のコレクションにアクセスする際に同期化する必要はありません。</p>
 * {@primary <p><strong>IMPLEMENTATION NOTE</strong> - It is assumed that these objects
 * are created and manipulated only within the context of a single thread.
 * Therefore, no synchronization is required for access to internal
 * collections.</p>}
 *
 * @version $Revision: 1.8 $ $Date: 2005/04/02 13:52:09 $
 * @translator 横田 健彦
 * @translator 棚澤 昌幸
 * @editor 高橋 達男
 * @update 2005/04/02
 * @status completion
 * @memo ブロックA
 */
public class ActionErrors extends ActionMessages implements Serializable {

    // ----------------------------------------------------- Manifest Constants

    /**
     * <p>特定のプロパティに関連するエラーとは対照的な、
     * グローバルエラーに使用する"プロパティ名"マーカ。</p>
     * {@primary The "property name" marker to use for global errors, as opposed to
     * those related to a specific property.}
     * @deprecated 代わりにActionMessages.GLOBAL_MESSAGEを使ってください。
     * これはStruts 1.2.より後に削除されます。
     * {@primary @deprecated Use ActionMessages.GLOBAL_MESSAGE instead.  This will be 
     * removed after Struts 1.2.}
     */
    public static final String GLOBAL_ERROR = "org.apache.struts.action.GLOBAL_ERROR";

    // --------------------------------------------------------- Public Methods

    /**
     * <p>空の<code>ActionErrors</code>オブジェクトを生成します。</p>
     * {@primary Create an empty <code>ActionErrors</code> object.}
     */
    public ActionErrors() {
        super();
    }

    /**
     * <p>与えられたメッセージで初期化された<code>ActionErrors</code>オブジェクトを生成します。</p>
     * {@primary Create an <code>ActionErrors</code> object initialized with the given 
     * messages.}
     * 
     * @param messages このオブジェクトに最初に追加されるメッセージ。
     * このパラメータは<code>null</code>も可能です。
     * {@primary @param messages The messages to be initially added to this object.
     * This parameter can be <code>null</code>.}
     * @since Struts 1.1
     */
    public ActionErrors(ActionErrors messages) {
        super(messages);
    }

    /**
     * <p>指定されたプロパティに関するエラーのセットにエラーメッセージを追加します。</p>
     * {@primary Add an error message to the set of errors for the specified property.}
     *
     * @param property プロパティ名(またはActionErrors.GLOBAL_ERROR)
     * {@primary @param property Property name (or ActionErrors.GLOBAL_ERROR)}
     * @param error 追加するエラーメッセージ
     * {@primary @param error The error message to be added}
     * @deprecated 代わりにadd(String, ActionMessage)を使ってください。
     * これはStruts 1.2.より後に削除されます。
     * {@primary @deprecated Use add(String, ActionMessage) instead.  This will be
     * removed after Struts 1.2.}
     */
    public void add(String property, ActionError error) {

        super.add(property, error);

    }

}
