|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Objectorg.apache.struts.action.ActionMessages
メッセージをカプセル化したクラスです。 メッセージはグローバル、 または指定どちらかの特別なBeanプロパティとなることができます。
A class that encapsulates messages. Messages can be either global or they are specific to a particular bean property.
それぞれ特定のメッセージは、
ActionMessageオブジェクトにより記述されます。
このオブジェクトはメッセージキーを含みます。
(メッセージキーは、適切なメッセージリソースデータベースを調べるためです。)
そして、
4つまでのプレースホルダー引数が結果のメッセージの置換変数として使用されます。
Each individual message is described by an ActionMessage
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.
実装上の注意 - これらのオブジェクトは、 シングルスレッドコンテキストの中でのみ生成され扱われることを想定しています。 従いまして、内部コレクションへのアクセスは同期化されていません。
IMPLEMENTATION NOTE - 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.
| 入れ子クラスの概要 | |
protected class |
ActionMessages.ActionMessageItem
プロパティ/キーとリストに最初に追加する位置に関連付けられたメッセージのセットを登録するため、 このクラスは使われます。 |
| フィールドの概要 | |
protected boolean |
accessed
このオブジェクトに関連付けられたメッセージを持つかのboolean。 |
private static java.util.Comparator |
actionItemComparator
アクションメッセージアイテムオブジェクトを比較します。 |
static java.lang.String |
GLOBAL_MESSAGE
特定のプロパティと関連付けられたものとは対照的に、 グローバルメッセージを使用するための"プロパティ名"の文字列。 |
protected int |
iCount
加算されたプロパティ/キーの最新の数値。 |
protected java.util.HashMap |
messages
それぞれのプロパティでプロパティ名をキーとした、 (ArrayListに代表される) ActionMessageオブジェクトの累積されたセット。 |
| コンストラクタの概要 | |
ActionMessages()
空の ActionMessagesオブジェクトを生成します。 |
|
ActionMessages(ActionMessages messages)
与えられたメッセージで初期化された ActionMessagesオブジェクトを生成します。 |
|
| メソッドの概要 | |
void |
add(ActionMessages messages)
このメッセージのセットに与えられた ActionMessagesオブジェクトからメッセージを追加します。
|
void |
add(java.lang.String property,
ActionMessage message)
指定されたプロパティでメッセージのセットにメッセージを追加します。 |
void |
clear()
このオブジェクトにより登録されている全てのメッセージを消去します。 |
java.util.Iterator |
get()
メッセージに関連付けられたプロパティにより区別することなく、 登録されている全てのメッセージを返します。 |
java.util.Iterator |
get(java.lang.String property)
指定されたプロパティに関連付けられたメッセージのセットを返します。 |
boolean |
isAccessed()
get()またはget(String)メソッドが呼ばれている場合、
trueを返します。 |
boolean |
isEmpty()
このコレクションにメッセージが登録されていない場合、 trueを返します。
|
java.util.Iterator |
properties()
少なくとも1つ以上登録されているプロパティ名のセットを返します。 |
int |
size()
(グローバルメッセージを含む)全てのプロパティに登録されたメッセージの数を返します。 |
int |
size(java.lang.String property)
指定されたプロパティに関連付けられたメッセージの数を返します。 |
java.lang.String |
toString()
このアクションメッセージのプロパティ名=メッセージリストのマップを表わす文字列を返します。 |
| クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| フィールドの詳細 |
private static final java.util.Comparator actionItemComparator
アクションメッセージアイテムオブジェクトを比較します。
Compares ActionMessageItem objects.
public static final java.lang.String GLOBAL_MESSAGE
特定のプロパティと関連付けられたものとは対照的に、 グローバルメッセージを使用するための"プロパティ名"の文字列。
The "property name" marker to use for global messages, as opposed to those related to a specific property.
protected boolean accessed
このオブジェクトに関連付けられたメッセージを持つかのboolean。
Have the messages been retrieved from this object?
セッションスコープに格納されたメッセージを削除できるか判断するため、 コントローラはこのプロパティを使用します。
The controller uses this property to determine if session-scoped messages can be removed.
protected java.util.HashMap messages
それぞれのプロパティでプロパティ名をキーとした、
(ArrayListに代表される)ActionMessageオブジェクトの累積されたセット。
The accumulated set of ActionMessage objects (represented
as an ArrayList) for each property, keyed by property name.
protected int iCount
加算されたプロパティ/キーの最新の数値。 この値は加えられたメッセージの順序を維持するために使用されます。
The current number of the property/key being added. This is used to maintain the order messages are added.
| コンストラクタの詳細 |
public ActionMessages()
空のActionMessagesオブジェクトを生成します。
Create an empty ActionMessages object.
public ActionMessages(ActionMessages messages)
与えられたメッセージで初期化されたActionMessagesオブジェクトを生成します。
Create an ActionMessages object initialized with the given
messages.
messages - このオブジェクトに最初に加えられるメッセージ
このパラメータはnullも可能です。
null.| メソッドの詳細 |
public void add(java.lang.String property,
ActionMessage message)
指定されたプロパティでメッセージのセットにメッセージを追加します。 プロパティ/キーの最初に加えられた内容を基に、 プロパティ/キーの順序は維持されます。
Add a message to the set of messages for the specified property. An order of the property/key is maintained based on the initial addition of the property/key.
property - プロパティ名(またはActionMessages.GLOBAL_MESSAGE)
message - 追加するメッセージ
public void add(ActionMessages messages)
このメッセージのセットに与えられたActionMessagesオブジェクトからメッセージを追加します。
メッセージはpropertiesメソッドで返された順序の中に追加されます。
メッセージのプロパティが最新のActionMessagesオブジェクト既に存在する場合、
プロパティのためのリストの最後に追加されます。
メッセージのプロパティが最新のリストに無い場合、
プロパティの最後に追加されます。
Adds the messages from the given ActionMessages object to
this set of messages. The messages are added in the order they are returned from
the properties method. If a message's property is already in the current
ActionMessages object, it is added to the end of the list for that
property. If a message's property is not in the current list it is added to the end
of the properties.
messages - 追加されるActionMessagesオブジェクト
このパラメータはnullも可能です。
ActionMessages object to be added.
This parameter can be null.public void clear()
このオブジェクトにより登録されている全てのメッセージを消去します。
Clear all messages recorded by this object.
public boolean isEmpty()
このコレクションにメッセージが登録されていない場合、
trueを返します。
それ以外の場合、
falseを返します。
Return true if there are no messages recorded
in this collection, or false otherwise.
public java.util.Iterator get()
メッセージに関連付けられたプロパティにより区別することなく、 登録されている全てのメッセージを返します。 メッセージが登録されたいない場合、 空のリストを返します。
Return the set of all recorded messages, without distinction by which property the messages are associated with. If there are no messages recorded, an empty enumeration is returned.
public java.util.Iterator get(java.lang.String property)
指定されたプロパティに関連付けられたメッセージのセットを返します。 そのようなメッセージが無い場合、 空のリストを返します。
Return the set of messages related to a specific property. If there are no such messages, an empty enumeration is returned.
property - プロパティ名(またはActionMessages.GLOBAL_MESSAGE)
public boolean isAccessed()
get()またはget(String)メソッドが呼ばれている場合、
trueを返します。
Returns true if the get() or
get(String) methods are called.
true メッセージが1回以上アクセスされている場合
true if the messages have been accessed one or more
times.public java.util.Iterator properties()
少なくとも1つ以上登録されているプロパティ名のセットを返します。
メッセージが無い場合、
空のIteratorを返します。
グローバルメッセージを登録している場合、
ActionMessages.GLOBAL_MESSAGEのString値が返されるプロパティ名の1つとなります。
Return the set of property names for which at least one message has
been recorded. If there are no messages, an empty Iterator is returned.
If you have recorded global messages, the String value of
ActionMessages.GLOBAL_MESSAGE will be one of the returned
property names.
public int size()
(グローバルメッセージを含む)全てのプロパティに登録されたメッセージの数を返します。
注意 -
メッセージの有無に関心がある場合、
isEmptyを使用する方が効果的です。
Return the number of messages recorded for all properties (including
global messages). NOTE - it is more efficient to call
isEmpty if all you care about is whether or not there are
any messages at all.
public int size(java.lang.String property)
指定されたプロパティに関連付けられたメッセージの数を返します。
Return the number of messages associated with the specified property.
property - プロパティ名(またはActionMessages.GLOBAL_MESSAGE)
public java.lang.String toString()
このアクションメッセージのプロパティ名=メッセージリストのマップを表わす文字列を返します。
Returns a String representation of this ActionMessages' property name=message list mapping.
Object.toString()
|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||