org.apache.turbine.util
Class FormMessages
java.lang.Object
|
+--org.apache.turbine.util.FormMessages
- public class FormMessages
- extends java.lang.Object
Used for adding and accessing messages that relate to a specific
form and field. Allows to query for messages by form name and
field name. Used together with FormMessage class.
- Version:
- $Id: FormMessages.java,v 1.1.1.1 2001/08/16 05:09:39 jvanzyl Exp $
- Author:
- Neeme Praks
Method Summary |
private void |
addValue(java.util.Hashtable table,
java.lang.String key,
java.lang.String value)
Adds a pair key/value to a table, making sure not to add
duplicate keys. |
private boolean |
formHasField(java.lang.String formName,
java.lang.String fieldName)
Check whether a form as a field. |
FormMessage[] |
getFormMessages(java.lang.String formName)
Gets all form messages for a given form. |
FormMessage[] |
getFormMessages(java.lang.String formName,
java.lang.String fieldName)
Get form messages for a given form and field. |
private java.util.Vector |
getValues(java.util.Hashtable table,
java.lang.String key)
Gets a pair key/value from a table. |
void |
setMessage(java.lang.String formName,
java.lang.String fieldName,
long returnCode)
Sets a message for a field of a form. |
void |
setMessage(java.lang.String formName,
java.lang.String fieldName,
java.lang.String messageName)
Sets a message for a field of a form. |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
forms_messages
private java.util.Hashtable forms_messages
fields_messages
private java.util.Hashtable fields_messages
messages_fields
private java.util.Hashtable messages_fields
forms_fields
private java.util.Hashtable forms_fields
FormMessages
public FormMessages()
- Constructor.
setMessage
public void setMessage(java.lang.String formName,
java.lang.String fieldName,
long returnCode)
- Sets a message for a field of a form. The message is given as
a long representing a return code.
- Parameters:
formName
- A String with the form name.fieldName
- A String with the field name.returnCode
- A long with the return code.
setMessage
public void setMessage(java.lang.String formName,
java.lang.String fieldName,
java.lang.String messageName)
- Sets a message for a field of a form. The message is given as
a String.
- Parameters:
formName
- A String with the form name.fieldName
- A String with the field name.messageName
- A String with the message.
addValue
private void addValue(java.util.Hashtable table,
java.lang.String key,
java.lang.String value)
- Adds a pair key/value to a table, making sure not to add
duplicate keys.
- Parameters:
table
- A Hastable.key
- A String with the key.value
- A String with value.
getValues
private final java.util.Vector getValues(java.util.Hashtable table,
java.lang.String key)
- Gets a pair key/value from a table.
- Parameters:
table
- A Hastable.key
- A String with the key.- Returns:
- A Vector with the pair key/value, or null.
getFormMessages
public FormMessage[] getFormMessages(java.lang.String formName)
- Gets all form messages for a given form.
- Parameters:
formName
- A String with the form name.- Returns:
- A FormMessage[].
getFormMessages
public FormMessage[] getFormMessages(java.lang.String formName,
java.lang.String fieldName)
- Get form messages for a given form and field.
- Parameters:
formName
- A String with the form name.fieldName
- A String with the field name.- Returns:
- A FormMessage[].
formHasField
private boolean formHasField(java.lang.String formName,
java.lang.String fieldName)
- Check whether a form as a field.
- Parameters:
formName
- A String with the form name.fieldName
- A String with the field name.- Returns:
- True if form has the field.
Copyright © 2000-2002 Apache Software Foundation. All Rights Reserved.