Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 40865 invoked from network); 29 Apr 2003 02:33:20 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 29 Apr 2003 02:33:20 -0000 Received: (qmail 3146 invoked by uid 97); 29 Apr 2003 02:35:28 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@nagoya.betaversion.org Received: (qmail 3139 invoked from network); 29 Apr 2003 02:35:27 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 29 Apr 2003 02:35:27 -0000 Received: (qmail 40643 invoked by uid 500); 29 Apr 2003 02:33:18 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 40631 invoked by uid 500); 29 Apr 2003 02:33:18 -0000 Received: (qmail 40628 invoked from network); 29 Apr 2003 02:33:18 -0000 Received: from icarus.apache.org (208.185.179.13) by daedalus.apache.org with SMTP; 29 Apr 2003 02:33:18 -0000 Received: (qmail 1789 invoked by uid 1581); 29 Apr 2003 02:33:17 -0000 Date: 29 Apr 2003 02:33:17 -0000 Message-ID: <20030429023317.1788.qmail@icarus.apache.org> From: dgraham@apache.org To: jakarta-commons-cvs@apache.org Subject: cvs commit: jakarta-commons/validator/src/share/org/apache/commons/validator FormSet.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N dgraham 2003/04/28 19:33:17 Modified: validator/src/share/org/apache/commons/validator FormSet.java Log: Minor documentation changes and field renames. Revision Changes Path 1.7 +44 -49 jakarta-commons/validator/src/share/org/apache/commons/validator/FormSet.java Index: FormSet.java =================================================================== RCS file: /home/cvs/jakarta-commons/validator/src/share/org/apache/commons/validator/FormSet.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- FormSet.java 30 Mar 2002 04:33:17 -0000 1.6 +++ FormSet.java 29 Apr 2003 02:33:17 -0000 1.7 @@ -7,7 +7,7 @@ * * The Apache Software License, Version 1.1 * - * Copyright (c) 1999-2002 The Apache Software Foundation. All rights + * Copyright (c) 1999-2003 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without @@ -76,23 +76,23 @@ * * @author David Winterfeldt * @version $Revision$ $Date$ -*/ + */ public class FormSet implements Serializable { /** * Whether or not the this FormSet was processed * for replacing variables in strings with their values. - */ - private boolean bProcessed = false; + */ + private boolean processed = false; /** * Language component of Locale (required). - */ + */ private String language = null; /** * Country component of Locale (optional). - */ + */ private String country = null; /** @@ -103,33 +103,33 @@ /** * A FastHashMap of Forms * using the name field of the Form as the key. - */ - private FastHashMap hForms = new FastHashMap(); + */ + private FastHashMap forms = new FastHashMap(); /** * A FastHashMap of Constants * using the name field of the Constant as the key. - */ - private FastHashMap hConstants = new FastHashMap(); + */ + private FastHashMap constants = new FastHashMap(); /** * Whether or not the this FormSet was processed * for replacing variables in strings with their values. - */ + */ public boolean isProcessed() { - return bProcessed; + return processed; } /** * Gets the equivalent of the language component of Locale. - */ + */ public String getLanguage() { return language; } /** * Sets the equivalent of the language component of Locale. - */ + */ public void setLanguage(String language) { this.language = language; } @@ -143,93 +143,88 @@ /** * Sets the equivalent of the country component of Locale. - */ + */ public void setCountry(String country) { this.country = country; } /** * Gets the equivalent of the variant component of Locale. - */ + */ public String getVariant() { return variant; } /** * Sets the equivalent of the variant component of Locale. - */ + */ public void setVariant(String variant) { this.variant = variant; } /** * Add a Constant (locale level). - */ + */ public void addConstant(Constant c) { if (c.getName() != null && c.getName().length() > 0 && c.getValue() != null && c.getValue().length() > 0) { - hConstants.put(c.getName(), c.getValue()); + + constants.put(c.getName(), c.getValue()); } } /** * Add a Constant to the locale level. - */ + */ public void addConstantParam(String name, String value) { if (name != null && name.length() > 0 && value != null && value.length() > 0) { - hConstants.put(name, value); + + constants.put(name, value); } } /** * Add a Form to the FormSet. - */ + */ public void addForm(Form f) { - hForms.put(f.getName(), f); + forms.put(f.getName(), f); } /** * Retrieve a Form based on the form name. - */ + */ public Form getForm(Object key) { - Form f = null; - Object o = hForms.get(key); - - if (o != null) { - f = (Form)o; - } - - return f; + return (Form) forms.get(key); } /** * A Map of Forms is returned as an * unmodifiable Map with the key based on the form name. - */ + */ public Map getForms() { - return Collections.unmodifiableMap(hForms); + return Collections.unmodifiableMap(forms); } /** * Processes all of the Forms, set FastHashMaps * to 'fast' mode. - */ + */ public synchronized void process(Map globalConstants) { - for (Iterator i = hForms.values().iterator(); i.hasNext(); ) { - Form f = (Form)i.next(); - f.process(globalConstants, hConstants); - } - - hForms.setFast(true); - hConstants.setFast(true); - - bProcessed = true; + for (Iterator i = forms.values().iterator(); i.hasNext();) { + Form f = (Form) i.next(); + f.process(globalConstants, constants); + } + + forms.setFast(true); + constants.setFast(true); + + processed = true; } /** * Returns a string representation of the object. - */ + */ public String toString() { StringBuffer results = new StringBuffer(); --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org