You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2006/01/12 18:13:34 UTC

svn commit: r368410 [2/10] - in /jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry: ./ bean/ binding/ callback/ coerce/ components/ describe/ engine/ engine/state/ enhance/ error/ event/ form/ form/translator/ form/validator/ html/ link/ li...

Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/StaleLinkException.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/StaleLinkException.java?rev=368410&r1=368409&r2=368410&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/StaleLinkException.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/StaleLinkException.java Thu Jan 12 09:12:21 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005, 2006 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.
@@ -17,45 +17,39 @@
 import org.apache.hivemind.ApplicationRuntimeException;
 
 /**
- *  Exception thrown by an {@link org.apache.tapestry.engine.IEngineService} when it discovers that
- *  the an action link was for an out-of-date version of the page.
- *
- *  <p>The application should redirect to the StaleLink page.
- *
- *
- *  @author Howard Lewis Ship
+ * Exception thrown by an {@link org.apache.tapestry.engine.IEngineService} when
+ * it discovers that the an action link was for an out-of-date version of the
+ * page.
+ * <p>
+ * The application should redirect to the StaleLink page.
  * 
- **/
+ * @author Howard Lewis Ship
+ */
 
 public class StaleLinkException extends ApplicationRuntimeException
 {
+
     private static final long serialVersionUID = -1266992401198999606L;
-    
-	private transient IPage _page;
-    private String _pageName;
-    private String _targetIdPath;
-    private String _targetActionId;
 
-    public StaleLinkException()
-    {
-        super(null, null, null, null);
-    }
+    private final transient IPage _page;
+    private final String _pageName;
+    private final String _targetIdPath;
+    private final String _targetActionId;
+
+    // public StaleLinkException()
+    // {
+    // super(null, null, null, null);
+    //    }
 
     /**
-     *  Constructor used when the action id is found, but the target id path
-     *  did not match the actual id path.
-     *
-     **/
+     * Constructor used when the action id is found, but the target id path did
+     * not match the actual id path.
+     */
 
     public StaleLinkException(IComponent component, String targetActionId, String targetIdPath)
     {
-        super(
-            Tapestry.format(
-                "StaleLinkException.action-mismatch",
-                new String[] { targetActionId, component.getIdPath(), targetIdPath }),
-            component,
-            null,
-            null);
+        super(Tapestry.format("StaleLinkException.action-mismatch", new String[] { targetActionId,
+                component.getIdPath(), targetIdPath }), component, null, null);
 
         _page = component.getPage();
         _pageName = _page.getPageName();
@@ -65,46 +59,40 @@
     }
 
     /**
-     *  Constructor used when the target action id is not found.
-     *
-     **/
+     * Constructor used when the target action id is not found.
+     */
 
     public StaleLinkException(IPage page, String targetActionId, String targetIdPath)
     {
-        this(
-            Tapestry.format(
-                "StaleLinkException.component-mismatch",
-                targetActionId,
-                targetIdPath),
-            page);
-
-        _targetActionId = targetActionId;
-        _targetIdPath = targetIdPath;
+        this(Tapestry.format("StaleLinkException.component-mismatch", targetActionId, targetIdPath), page);
     }
 
     public StaleLinkException(String message, IComponent component)
     {
         super(message, component, null, null);
+        
+        _targetActionId = null;
+        _targetIdPath = null;
+        _page = null;
+        _pageName = null;
     }
 
-
-
+     
     public String getPageName()
     {
         return _pageName;
     }
 
     /**
-     *  Returns the page referenced by the service URL, if known, 
-     *  or null otherwise.
-     *
-     **/
+     * Returns the page referenced by the service URL, if known, or null
+     * otherwise.
+     */
 
     public IPage getPage()
     {
         return _page;
     }
-    
+
     public String getTargetActionId()
     {
         return _targetActionId;
@@ -115,4 +103,4 @@
         return _targetIdPath;
     }
 
-}
\ No newline at end of file
+}

Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/StaleSessionException.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/StaleSessionException.java?rev=368410&r1=368409&r2=368410&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/StaleSessionException.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/StaleSessionException.java Thu Jan 12 09:12:21 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005, 2006 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.
@@ -17,24 +17,22 @@
 import org.apache.hivemind.ApplicationRuntimeException;
 
 /**
- *  Exception thrown by an {@link org.apache.tapestry.engine.IEngineService} when it discovers that
- *  the {@link javax.servlet.http.HttpSession}
- *  has timed out (and been replaced by a new, empty
- *  one).
- *
- *  <p>The application should redirect to the stale-session page.
- *
- *
- *  @author Howard Lewis Ship
- *
- **/
+ * Exception thrown by an {@link org.apache.tapestry.engine.IEngineService} when
+ * it discovers that the {@link javax.servlet.http.HttpSession} has timed out
+ * (and been replaced by a new, empty one).
+ * <p>
+ * The application should redirect to the stale-session page.
+ * 
+ * @author Howard Lewis Ship
+ */
 
 public class StaleSessionException extends ApplicationRuntimeException
 {
+
     private static final long serialVersionUID = 6733303549871198597L;
-    
-	private transient IPage _page;
-    private String _pageName;
+
+    private final transient IPage _page;
+    private final String _pageName;
 
     public StaleSessionException()
     {
@@ -46,8 +44,7 @@
         super(message, page, null, null);
         _page = page;
 
-        if (page != null)
-            _pageName = page.getPageName();
+        _pageName = (page == null) ? null : page.getPageName();
     }
 
     public String getPageName()
@@ -56,12 +53,12 @@
     }
 
     /**
-     *  Returns the page referenced by the service URL, if known, or null otherwise.
-     *
-     **/
+     * Returns the page referenced by the service URL, if known, or null
+     * otherwise.
+     */
 
     public IPage getPage()
     {
         return _page;
     }
-}
\ No newline at end of file
+}

Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/Tapestry.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/Tapestry.java?rev=368410&r1=368409&r2=368410&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/Tapestry.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/Tapestry.java Thu Jan 12 09:12:21 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005, 2006 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.
@@ -39,8 +39,8 @@
 import org.apache.tapestry.util.StringSplitter;
 
 /**
- * A placeholder for a number of (static) methods that don't belong elsewhere, as well as a global
- * location for static constants.
+ * A placeholder for a number of (static) methods that don't belong elsewhere,
+ * as well as a global location for static constants.
  * 
  * @since 1.0.1
  * @author Howard Lewis Ship
@@ -48,62 +48,77 @@
 
 public final class Tapestry
 {
+
     /**
-     * The name ("action") of a service that allows behavior to be associated with an
-     * {@link IAction} component, such as {@link org.apache.tapestry.link.ActionLink }or
+     * The version of the framework; this is updated for major releases.
+     */
+
+    public static final String VERSION;
+
+    /**
+     * The name ("action") of a service that allows behavior to be associated
+     * with an {@link IAction} component, such as
+     * {@link org.apache.tapestry.link.ActionLink }or
      * {@link org.apache.tapestry.form.Form}.
      * <p>
-     * This service is used with actions that are tied to the dynamic state of the page, and which
-     * require a rewind of the page.
+     * This service is used with actions that are tied to the dynamic state of
+     * the page, and which require a rewind of the page.
      */
 
-    public final static String ACTION_SERVICE = "action";
+    public static final String ACTION_SERVICE = "action";
 
     /**
-     * The name ("direct") of a service that allows stateless behavior for an {@link
-     * org.apache.tapestry.link.DirectLink} component.
+     * The name ("direct") of a service that allows stateless behavior for an
+     * {@link org.apache.tapestry.link.DirectLink} component.
      * <p>
-     * This service rolls back the state of the page but doesn't rewind the the dynamic state of the
-     * page the was the action service does, which is more efficient but less powerful.
+     * This service rolls back the state of the page but doesn't rewind the the
+     * dynamic state of the page the was the action service does, which is more
+     * efficient but less powerful.
      * <p>
-     * An array of String parameters may be included with the service URL; these will be made
-     * available to the {@link org.apache.tapestry.link.DirectLink} component's listener.
+     * An array of String parameters may be included with the service URL; these
+     * will be made available to the {@link org.apache.tapestry.link.DirectLink}
+     * component's listener.
      */
 
-    public final static String DIRECT_SERVICE = "direct";
+    public static final String DIRECT_SERVICE = "direct";
 
     /**
-     * The name ("external") of a service that a allows {@link IExternalPage} to be selected.
-     * Associated with a {@link org.apache.tapestry.link.ExternalLink} component.
+     * The name ("external") of a service that a allows {@link IExternalPage} to
+     * be selected. Associated with a
+     * {@link org.apache.tapestry.link.ExternalLink} component.
      * <p>
-     * This service enables {@link IExternalPage}s to be accessed via a URL. External pages may be
-     * booked marked using their URL for future reference.
+     * This service enables {@link IExternalPage}s to be accessed via a URL.
+     * External pages may be booked marked using their URL for future reference.
      * <p>
-     * An array of Object parameters may be included with the service URL; these will be passed to
-     * the {@link IExternalPage#activateExternalPage(Object[], IRequestCycle)} method.
+     * An array of Object parameters may be included with the service URL; these
+     * will be passed to the
+     * {@link IExternalPage#activateExternalPage(Object[], IRequestCycle)}
+     * method.
      */
 
-    public final static String EXTERNAL_SERVICE = "external";
+    public static final String EXTERNAL_SERVICE = "external";
 
     /**
-     * The name ("page") of a service that allows a new page to be selected. Associated with a
-     * {@link org.apache.tapestry.link.PageLink} component.
+     * The name ("page") of a service that allows a new page to be selected.
+     * Associated with a {@link org.apache.tapestry.link.PageLink} component.
      * <p>
      * The service requires a single parameter: the name of the target page.
      */
 
-    public final static String PAGE_SERVICE = "page";
+    public static final String PAGE_SERVICE = "page";
 
     /**
-     * The name ("home") of a service that jumps to the home page. A stand-in for when no service is
-     * provided, which is typically the entrypoint to the application.
+     * The name ("home") of a service that jumps to the home page. A stand-in
+     * for when no service is provided, which is typically the entrypoint to the
+     * application.
      */
 
-    public final static String HOME_SERVICE = "home";
+    public static final String HOME_SERVICE = "home";
 
     /**
-     * The name ("restart") of a service that invalidates the session and restarts the application.
-     * Typically used just to recover from an exception.
+     * The name ("restart") of a service that invalidates the session and
+     * restarts the application. Typically used just to recover from an
+     * exception.
      */
 
     public static final String RESTART_SERVICE = "restart";
@@ -115,13 +130,15 @@
     public static final String ASSET_SERVICE = "asset";
 
     /**
-     * The name ("reset") of a service used to clear cached template and specification data and
-     * remove all pooled pages. This is only used when debugging as a quick way to clear the out
-     * cached data, to allow updated versions of specifications and templates to be loaded (without
-     * stopping and restarting the servlet container).
+     * The name ("reset") of a service used to clear cached template and
+     * specification data and remove all pooled pages. This is only used when
+     * debugging as a quick way to clear the out cached data, to allow updated
+     * versions of specifications and templates to be loaded (without stopping
+     * and restarting the servlet container).
      * <p>
      * This service is only available if the Java system property
-     * <code>org.apache.tapestry.enable-reset-service</code> is set to <code>true</code>.
+     * <code>org.apache.tapestry.enable-reset-service</code> is set to
+     * <code>true</code>.
      */
 
     public static final String RESET_SERVICE = "reset";
@@ -131,30 +148,33 @@
      * 
      * @since 1.0.3
      * @deprecated To be removed in 4.1. Use
-     *             {@link org.apache.tapestry.services.ServiceConstants#SERVICE} instead.
+     *             {@link org.apache.tapestry.services.ServiceConstants#SERVICE}
+     *             instead.
      */
 
     public static final String SERVICE_QUERY_PARAMETER_NAME = ServiceConstants.SERVICE;
 
     /**
-     * The query parameter for application specific parameters to the service (this is used with the
-     * direct service). Each of these values is encoded with
-     * {@link java.net.URLEncoder#encode(String)} before being added to the URL. Multiple values are
-     * handle by repeatedly establishing key/value pairs (this is a change from behavior in 2.1 and
-     * earlier).
+     * The query parameter for application specific parameters to the service
+     * (this is used with the direct service). Each of these values is encoded
+     * with {@link java.net.URLEncoder#encode(String)} before being added to the
+     * URL. Multiple values are handle by repeatedly establishing key/value
+     * pairs (this is a change from behavior in 2.1 and earlier).
      * 
      * @since 1.0.3
      * @deprecated To be removed in 4.1. Use
-     *             {@link org.apache.tapestry.services.ServiceConstants#PARAMETER} instead.
+     *             {@link org.apache.tapestry.services.ServiceConstants#PARAMETER}
+     *             instead.
      */
 
     public static final String PARAMETERS_QUERY_PARAMETER_NAME = ServiceConstants.PARAMETER;
 
     /**
-     * Property name used to get the extension used for templates. This may be set in the page or
-     * component specification, or in the page (or component's) immediate container (library or
-     * application specification). Unlike most properties, value isn't inherited all the way up the
-     * chain. The default template extension is "html".
+     * Property name used to get the extension used for templates. This may be
+     * set in the page or component specification, or in the page (or
+     * component's) immediate container (library or application specification).
+     * Unlike most properties, value isn't inherited all the way up the chain.
+     * The default template extension is "html".
      * 
      * @since 3.0
      */
@@ -162,16 +182,17 @@
     public static final String TEMPLATE_EXTENSION_PROPERTY = "org.apache.tapestry.template-extension";
 
     /**
-     * The name of an {@link org.apache.tapestry.IRequestCycle} attribute in which the currently
-     * rendering {@link org.apache.tapestry.components.ILinkComponent} is stored. Link components do
-     * not nest.
+     * The name of an {@link org.apache.tapestry.IRequestCycle} attribute in
+     * which the currently rendering
+     * {@link org.apache.tapestry.components.ILinkComponent} is stored. Link
+     * components do not nest.
      */
 
     public static final String LINK_COMPONENT_ATTRIBUTE_NAME = "org.apache.tapestry.active-link-component";
 
     /**
-     * Suffix appended to a parameter name to form the name of a property that stores the binding
-     * for the parameter.
+     * Suffix appended to a parameter name to form the name of a property that
+     * stores the binding for the parameter.
      * 
      * @since 3.0
      */
@@ -179,8 +200,9 @@
     public static final String PARAMETER_PROPERTY_NAME_SUFFIX = "Binding";
 
     /**
-     * Key used to obtain an extension from the application specification. The extension, if it
-     * exists, implements {@link org.apache.tapestry.request.IRequestDecoder}.
+     * Key used to obtain an extension from the application specification. The
+     * extension, if it exists, implements
+     * {@link org.apache.tapestry.request.IRequestDecoder}.
      * 
      * @since 2.2
      */
@@ -188,9 +210,10 @@
     public static final String REQUEST_DECODER_EXTENSION_NAME = "org.apache.tapestry.request-decoder";
 
     /**
-     * Name of optional application extension for the multipart decoder used by the application. The
-     * extension must implement {@link org.apache.tapestry.multipart.IMultipartDecoder} (and is
-     * generally a configured instance of
+     * Name of optional application extension for the multipart decoder used by
+     * the application. The extension must implement
+     * {@link org.apache.tapestry.multipart.IMultipartDecoder} (and is generally
+     * a configured instance of
      * {@link org.apache.tapestry.multipart.DefaultMultipartDecoder}).
      * 
      * @since 3.0
@@ -199,7 +222,8 @@
     public static final String MULTIPART_DECODER_EXTENSION_NAME = "org.apache.tapestry.multipart-decoder";
 
     /**
-     * Method id used to check that {@link IPage#validate(IRequestCycle)} is invoked.
+     * Method id used to check that {@link IPage#validate(IRequestCycle)} is
+     * invoked.
      * 
      * @see #checkMethodInvocation(Object, String, Object)
      * @since 3.0
@@ -217,9 +241,10 @@
     public static final String ABSTRACTPAGE_DETACH_METHOD_ID = "AbstractPage.detach()";
 
     /**
-     * Regular expression defining a simple property name. Used by several different parsers. Simple
-     * property names match Java variable names; a leading letter (or underscore), followed by
-     * letters, numbers and underscores.
+     * Regular expression defining a simple property name. Used by several
+     * different parsers. Simple property names match Java variable names; a
+     * leading letter (or underscore), followed by letters, numbers and
+     * underscores.
      * 
      * @since 3.0
      */
@@ -228,8 +253,8 @@
 
     /**
      * Name of an application extension used as a factory for
-     * {@link org.apache.tapestry.engine.IMonitor}instances. The extension must implement
-     * {@link org.apache.tapestry.engine.IMonitorFactory}.
+     * {@link org.apache.tapestry.engine.IMonitor}instances. The extension must
+     * implement {@link org.apache.tapestry.engine.IMonitorFactory}.
      * 
      * @since 3.0
      */
@@ -237,24 +262,19 @@
     public static final String MONITOR_FACTORY_EXTENSION_NAME = "org.apache.tapestry.monitor-factory";
 
     /**
-     * Class name of an {@link ognl.TypeConverter}implementing class to use as a type converter for
-     * {@link org.apache.tapestry.binding.ExpressionBinding}
+     * Class name of an {@link ognl.TypeConverter}implementing class to use as
+     * a type converter for
+     * {@link org.apache.tapestry.binding.ExpressionBinding}.
      */
     public static final String OGNL_TYPE_CONVERTER = "org.apache.tapestry.ognl-type-converter";
 
     /**
-     * Prevent instantiation.
+     * Used for tracking if a particular super-class method has been invoked.
      */
 
-    private Tapestry()
-    {
-    }
-
-    /**
-     * The version of the framework; this is updated for major releases.
-     */
+    private static final ThreadLocal INVOKED_METHOD_IDS_HOLDER = new ThreadLocal();
 
-    public static final String VERSION = readVersion();
+    private static final String UNKNOWN_VERSION = "Unknown";
 
     /**
      * Contains strings loaded from TapestryStrings.properties.
@@ -265,46 +285,50 @@
     private static ResourceBundle _strings;
 
     /**
-     * A {@link Map}that links Locale names (as in {@link Locale#toString()}to {@link Locale}
-     * instances. This prevents needless duplication of Locales.
+     * A {@link Map}that links Locale names (as in {@link Locale#toString()}to
+     * {@link Locale} instances. This prevents needless duplication of Locales.
      */
 
-    private static final Map _localeMap = new HashMap();
+    private static final Map LOCALE_MAP = new HashMap();
 
     static
     {
+        VERSION = readVersion();
+
         Locale[] locales = Locale.getAvailableLocales();
-        for (int i = 0; i < locales.length; i++)
+        for(int i = 0; i < locales.length; i++)
         {
-            _localeMap.put(locales[i].toString(), locales[i]);
+            LOCALE_MAP.put(locales[i].toString(), locales[i]);
         }
     }
 
     /**
-     * Used for tracking if a particular super-class method has been invoked.
+     * Prevent instantiation.
      */
 
-    private static final ThreadLocal _invokedMethodIds = new ThreadLocal();
+    private Tapestry()
+    {
+    }
 
     /**
-     * Copys all informal {@link IBinding bindings}from a source component to the destination
-     * component. Informal bindings are bindings for informal parameters. This will overwrite
-     * parameters (formal or informal) in the destination component if there is a naming conflict.
+     * Copys all informal {@link IBinding bindings}from a source component to
+     * the destination component. Informal bindings are bindings for informal
+     * parameters. This will overwrite parameters (formal or informal) in the
+     * destination component if there is a naming conflict.
      */
 
     public static void copyInformalBindings(IComponent source, IComponent destination)
     {
         Collection names = source.getBindingNames();
 
-        if (names == null)
-            return;
+        if (names == null) return;
 
         IComponentSpecification specification = source.getSpecification();
         Iterator i = names.iterator();
 
-        while (i.hasNext())
+        while(i.hasNext())
         {
-            String name = (String) i.next();
+            String name = (String)i.next();
 
             // If not a formal parameter, then copy it over.
 
@@ -319,17 +343,17 @@
 
     /**
      * Gets the {@link Locale}for the given string, which is the result of
-     * {@link Locale#toString()}. If no such locale is already registered, a new instance is
-     * created, registered and returned.
+     * {@link Locale#toString()}. If no such locale is already registered, a
+     * new instance is created, registered and returned.
      */
 
     public static Locale getLocale(String s)
     {
         Locale result = null;
 
-        synchronized (_localeMap)
+        synchronized(LOCALE_MAP)
         {
-            result = (Locale) _localeMap.get(s);
+            result = (Locale)LOCALE_MAP.get(s);
         }
 
         if (result == null)
@@ -337,31 +361,31 @@
             StringSplitter splitter = new StringSplitter('_');
             String[] terms = splitter.splitToArray(s);
 
-            switch (terms.length)
+            switch(terms.length)
             {
-                case 1:
+            case 1:
 
-                    result = new Locale(terms[0], "");
-                    break;
+                result = new Locale(terms[0], "");
+                break;
 
-                case 2:
+            case 2:
 
-                    result = new Locale(terms[0], terms[1]);
-                    break;
+                result = new Locale(terms[0], terms[1]);
+                break;
 
-                case 3:
+            case 3:
 
-                    result = new Locale(terms[0], terms[1], terms[2]);
-                    break;
+                result = new Locale(terms[0], terms[1], terms[2]);
+                break;
 
-                default:
+            default:
 
-                    throw new IllegalArgumentException("Unable to convert '" + s + "' to a Locale.");
+                throw new IllegalArgumentException("Unable to convert '" + s + "' to a Locale.");
             }
 
-            synchronized (_localeMap)
+            synchronized(LOCALE_MAP)
             {
-                _localeMap.put(s, result);
+                LOCALE_MAP.put(s, result);
             }
 
         }
@@ -392,21 +416,20 @@
     }
 
     /**
-     * Gets a string from the TapestryStrings resource bundle. The string in the bundle is treated
-     * as a pattern for {@link MessageFormat#format(java.lang.String, java.lang.Object[])}.
+     * Gets a string from the TapestryStrings resource bundle. The string in the
+     * bundle is treated as a pattern for
+     * {@link MessageFormat#format(java.lang.String, java.lang.Object[])}.
      * 
      * @since 1.0.8
      */
 
     public static String format(String key, Object[] args)
     {
-        if (_strings == null)
-            _strings = ResourceBundle.getBundle("org.apache.tapestry.TapestryStrings");
+        if (_strings == null) _strings = ResourceBundle.getBundle("org.apache.tapestry.TapestryStrings");
 
         String pattern = _strings.getString(key);
 
-        if (args == null)
-            return pattern;
+        if (args == null) return pattern;
 
         return MessageFormat.format(pattern, args);
     }
@@ -430,8 +453,7 @@
 
     public static String format(String key, Object arg)
     {
-        return format(key, new Object[]
-        { arg });
+        return format(key, new Object[] { arg });
     }
 
     /**
@@ -442,8 +464,7 @@
 
     public static String format(String key, Object arg1, Object arg2)
     {
-        return format(key, new Object[]
-        { arg1, arg2 });
+        return format(key, new Object[] { arg1, arg2 });
     }
 
     /**
@@ -454,17 +475,14 @@
 
     public static String format(String key, Object arg1, Object arg2, Object arg3)
     {
-        return format(key, new Object[]
-        { arg1, arg2, arg3 });
+        return format(key, new Object[] { arg1, arg2, arg3 });
     }
 
-    private static final String UNKNOWN_VERSION = "Unknown";
-
     /**
      * Invoked when the class is initialized to read the current version file.
      */
 
-    private static final String readVersion()
+    private static String readVersion()
     {
         Properties props = new Properties();
 
@@ -472,8 +490,7 @@
         {
             InputStream in = Tapestry.class.getResourceAsStream("version.properties");
 
-            if (in == null)
-                return UNKNOWN_VERSION;
+            if (in == null) return UNKNOWN_VERSION;
 
             props.load(in);
 
@@ -496,8 +513,7 @@
 
     public static int size(Collection c)
     {
-        if (c == null)
-            return 0;
+        if (c == null) return 0;
 
         return c.size();
     }
@@ -510,8 +526,7 @@
 
     public static int size(Object[] array)
     {
-        if (array == null)
-            return 0;
+        if (array == null) return 0;
 
         return array.length;
     }
@@ -539,21 +554,22 @@
     }
 
     /**
-     * Converts a {@link Map} to an even-sized array of key/value pairs. This may be useful when
-     * using a Map as service parameters (with {@link org.apache.tapestry.link.DirectLink}.
-     * Assuming the keys and values are simple objects (String, Boolean, Integer, etc.), then the
+     * Converts a {@link Map} to an even-sized array of key/value pairs. This
+     * may be useful when using a Map as service parameters (with
+     * {@link org.apache.tapestry.link.DirectLink}. Assuming the keys and
+     * values are simple objects (String, Boolean, Integer, etc.), then the
      * representation as an array will encode more efficiently (via
-     * {@link org.apache.tapestry.util.io.DataSqueezerImpl} than serializing the Map and its
-     * contents.
+     * {@link org.apache.tapestry.util.io.DataSqueezerImpl} than serializing the
+     * Map and its contents.
      * 
-     * @return the array of keys and values, or null if the input Map is null or empty
+     * @return the array of keys and values, or null if the input Map is null or
+     *         empty
      * @since 2.2
      */
 
     public static Object[] convertMapToArray(Map map)
     {
-        if (isEmpty(map))
-            return null;
+        if (isEmpty(map)) return null;
 
         Set entries = map.entrySet();
 
@@ -561,9 +577,9 @@
         int x = 0;
 
         Iterator i = entries.iterator();
-        while (i.hasNext())
+        while(i.hasNext())
         {
-            Map.Entry entry = (Map.Entry) i.next();
+            Map.Entry entry = (Map.Entry)i.next();
 
             result[x++] = entry.getKey();
             result[x++] = entry.getValue();
@@ -582,16 +598,14 @@
 
     public static Map convertArrayToMap(Object[] array)
     {
-        if (array == null || array.length == 0)
-            return null;
+        if (array == null || array.length == 0) return null;
 
-        if (array.length % 2 != 0)
-            throw new IllegalArgumentException(getMessage("Tapestry.even-sized-array"));
+        if (array.length % 2 != 0) throw new IllegalArgumentException(getMessage("Tapestry.even-sized-array"));
 
         Map result = new HashMap();
 
         int x = 0;
-        while (x < array.length)
+        while(x < array.length)
         {
             Object key = array[x++];
             Object value = array[x++];
@@ -603,8 +617,8 @@
     }
 
     /**
-     * Given a Class, creates a presentable name for the class, even if the class is a scalar type
-     * or Array type.
+     * Given a Class, creates a presentable name for the class, even if the
+     * class is a scalar type or Array type.
      * 
      * @since 3.0
      * @deprecated To be removed in 4.1.
@@ -628,31 +642,28 @@
 
     /** @since 3.0 * */
 
-    public static ApplicationRuntimeException createNoSuchComponentException(IComponent component,
-            String id, Location location)
+    public static ApplicationRuntimeException createNoSuchComponentException(IComponent component, String id,
+            Location location)
     {
-        return new ApplicationRuntimeException(format("no-such-component", component
-                .getExtendedId(), id), component, location, null);
+        return new ApplicationRuntimeException(format("no-such-component", component.getExtendedId(), id), component,
+                location, null);
     }
 
     /** @since 3.0 * */
 
-    public static BindingException createRequiredParameterException(IComponent component,
-            String parameterName)
+    public static BindingException createRequiredParameterException(IComponent component, String parameterName)
     {
-        return new BindingException(format("required-parameter", parameterName, component
-                .getExtendedId()), component, null, component.getBinding(parameterName), null);
+        return new BindingException(format("required-parameter", parameterName, component.getExtendedId()), component,
+                null, component.getBinding(parameterName), null);
     }
 
     /** @since 3.0 * */
 
-    public static ApplicationRuntimeException createRenderOnlyPropertyException(
-            IComponent component, String propertyName)
+    public static ApplicationRuntimeException createRenderOnlyPropertyException(IComponent component,
+            String propertyName)
     {
-        return new ApplicationRuntimeException(format(
-                "render-only-property",
-                propertyName,
-                component.getExtendedId()), component, null, null);
+        return new ApplicationRuntimeException(format("render-only-property", propertyName, component.getExtendedId()),
+                component, null, null);
     }
 
     /**
@@ -664,12 +675,12 @@
 
     public static void clearMethodInvocations()
     {
-        _invokedMethodIds.set(null);
+        INVOKED_METHOD_IDS_HOLDER.set(null);
     }
 
     /**
-     * Adds a method invocation to the list of invocations. This is done in a super-class
-     * implementations.
+     * Adds a method invocation to the list of invocations. This is done in a
+     * super-class implementations.
      * 
      * @see #checkMethodInvocation(Object, String, Object)
      * @since 3.0
@@ -677,46 +688,47 @@
 
     public static void addMethodInvocation(Object methodId)
     {
-        List methodIds = (List) _invokedMethodIds.get();
+        List methodIds = (List)INVOKED_METHOD_IDS_HOLDER.get();
 
         if (methodIds == null)
         {
             methodIds = new ArrayList();
-            _invokedMethodIds.set(methodIds);
+            INVOKED_METHOD_IDS_HOLDER.set(methodIds);
         }
 
         methodIds.add(methodId);
     }
 
     /**
-     * Checks to see if a particular method has been invoked. The method is identified by a methodId
-     * (usually a String). The methodName and object are used to create an error message.
+     * Checks to see if a particular method has been invoked. The method is
+     * identified by a methodId (usually a String). The methodName and object
+     * are used to create an error message.
      * <p>
-     * The caller should invoke {@link #clearMethodInvocations()}, then invoke a method on the
-     * object. The super-class implementation should invoke {@link #addMethodInvocation(Object)} to
-     * indicate that it was, in fact, invoked. The caller then invokes this method to validate that
-     * the super-class implementation was invoked.
+     * The caller should invoke {@link #clearMethodInvocations()}, then invoke
+     * a method on the object. The super-class implementation should invoke
+     * {@link #addMethodInvocation(Object)} to indicate that it was, in fact,
+     * invoked. The caller then invokes this method to validate that the
+     * super-class implementation was invoked.
      * <p>
-     * The list of method invocations is stored in a {@link ThreadLocal} variable.
+     * The list of method invocations is stored in a {@link ThreadLocal}
+     * variable.
      * 
      * @since 3.0
      */
 
     public static void checkMethodInvocation(Object methodId, String methodName, Object object)
     {
-        List methodIds = (List) _invokedMethodIds.get();
+        List methodIds = (List)INVOKED_METHOD_IDS_HOLDER.get();
 
-        if (methodIds != null && methodIds.contains(methodId))
-            return;
+        if (methodIds != null && methodIds.contains(methodId)) return;
 
-        throw new ApplicationRuntimeException(Tapestry.format(
-                "Tapestry.missing-method-invocation",
-                object.getClass().getName(),
-                methodName));
+        throw new ApplicationRuntimeException(Tapestry.format("Tapestry.missing-method-invocation", object.getClass()
+                .getName(), methodName));
     }
 
     /**
-     * Method used by pages and components to send notifications about property changes.
+     * Method used by pages and components to send notifications about property
+     * changes.
      * 
      * @param component
      *            the component containing the property
@@ -730,8 +742,7 @@
     {
         ChangeObserver observer = component.getPage().getChangeObserver();
 
-        if (observer == null)
-            return;
+        if (observer == null) return;
 
         ObservedChangeEvent event = new ObservedChangeEvent(component, propertyName, newValue);
 
@@ -741,12 +752,13 @@
     /**
      * Returns true if the input is null or contains only whitespace.
      * <p>
-     * Note: Yes, you'd think we'd use <code>StringUtils</code>, but with the change in names and
-     * behavior between releases, it is smarter to just implement our own little method!
+     * Note: Yes, you'd think we'd use <code>StringUtils</code>, but with the
+     * change in names and behavior between releases, it is smarter to just
+     * implement our own little method!
      * 
      * @since 3.0
-     * @deprecated To be removed in Tapestry 4.1. Use {@link HiveMind#isBlank(java.lang.String)}
-     *             instead.
+     * @deprecated To be removed in Tapestry 4.1. Use
+     *             {@link HiveMind#isBlank(java.lang.String)} instead.
      */
 
     public static boolean isBlank(String input)
@@ -758,12 +770,12 @@
      * Returns true if the input is not null and not empty (or only whitespace).
      * 
      * @since 3.0
-     * @deprecated To be removed in Tapestry 4.1. Use {@link HiveMind#isNonBlank(java.lang.String)}
-     *             instead.
+     * @deprecated To be removed in Tapestry 4.1. Use
+     *             {@link HiveMind#isNonBlank(java.lang.String)} instead.
      */
 
     public static boolean isNonBlank(String input)
     {
         return HiveMind.isNonBlank(input);
     }
-}
\ No newline at end of file
+}

Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/TapestryConstants.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/TapestryConstants.java?rev=368410&r1=368409&r2=368410&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/TapestryConstants.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/TapestryConstants.java Thu Jan 12 09:12:21 2006
@@ -1,4 +1,4 @@
-// Copyright 2005 The Apache Software Foundation
+// Copyright 2005, 2006 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.
@@ -18,10 +18,12 @@
  * @author Howard M. Lewis Ship
  * @since 4.0
  */
-public class TapestryConstants
+public final class TapestryConstants
 {
+
     /**
-     * Name of the cookie written to the client web browser to identify the locale.
+     * Name of the cookie written to the client web browser to identify the
+     * locale.
      */
 
     public static final String LOCALE_COOKIE_NAME = "org.apache.tapestry.locale";
@@ -33,8 +35,8 @@
     public static final String PAGE_CLASS_NAME = "org.apache.tapestry.default-page-class";
 
     /**
-     * Name of meta-data property used to determine the default binding prefix. The meta default for
-     * this is "ognl".
+     * Name of meta-data property used to determine the default binding prefix.
+     * The meta default for this is "ognl".
      */
 
     public static final String DEFAULT_BINDING_PREFIX_NAME = "org.apache.tapestry.default-binding-prefix";
@@ -42,4 +44,4 @@
     private TapestryConstants()
     {
     }
-}
\ No newline at end of file
+}

Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/TapestryMessages.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/TapestryMessages.java?rev=368410&r1=368409&r2=368410&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/TapestryMessages.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/TapestryMessages.java Thu Jan 12 09:12:21 2006
@@ -14,62 +14,65 @@
 
 package org.apache.tapestry;
 
+import org.apache.hivemind.Messages;
 import org.apache.hivemind.impl.MessageFormatter;
 
 /**
  * @author Howard Lewis Ship
  * @since 4.0
  */
-class TapestryMessages
+final class TapestryMessages
 {
-    private final static MessageFormatter _formatter = new MessageFormatter(TapestryMessages.class,
-            "TapestryStrings2");
+
+    private static final Messages MESSAGES = new MessageFormatter(TapestryMessages.class, "TapestryStrings2");
+
+    /** @since 4.1 */
+    private TapestryMessages()
+    {
+    }
 
     static String servletInitFailure(Throwable cause)
     {
-        return _formatter.format("servlet-init-failure", cause);
+        return MESSAGES.format("servlet-init-failure", cause);
     }
 
     static String componentIsLocked(IComponent component)
     {
-        return _formatter.format("component-is-locked", component.getExtendedId());
+        return MESSAGES.format("component-is-locked", component.getExtendedId());
     }
 
     static String servletInit(String name, long elapsedToRegistry, long elapsedOverall)
     {
-        return _formatter.format("servlet-init", name, new Long(elapsedToRegistry), new Long(
-                elapsedOverall));
+        return MESSAGES.format("servlet-init", name, new Long(elapsedToRegistry), new Long(elapsedOverall));
     }
 
     static String nonUniqueAttribute(Object newInstance, String key, Object existingInstance)
     {
-        return _formatter.format("non-unique-attribute", newInstance, key, existingInstance);
+        return MESSAGES.format("non-unique-attribute", newInstance, key, existingInstance);
     }
 
     static String noPageRenderSupport(IComponent component)
     {
-        return _formatter.format("no-page-render-support", component.getExtendedId());
+        return MESSAGES.format("no-page-render-support", component.getExtendedId());
     }
 
     static String noForm(IComponent component)
     {
-        return _formatter.format("no-form", component.getExtendedId());
+        return MESSAGES.format("no-form", component.getExtendedId());
     }
 
     static String providedByEnhancement(String methodName)
     {
-        return _formatter.format("provided-by-enhancement", methodName);
+        return MESSAGES.format("provided-by-enhancement", methodName);
     }
 
     static String attemptToChangeContainedComponent(IComponent component)
     {
-        return _formatter
-                .format("attempt-to-change-contained-component", component.getExtendedId());
+        return MESSAGES.format("attempt-to-change-contained-component", component.getExtendedId());
     }
 
     static String componentWrongType(IComponent component, Class expectedType)
     {
-        return _formatter.format("component-wrong-type", component.getExtendedId(), expectedType
-                .getName());
+        return MESSAGES.format("component-wrong-type", component.getExtendedId(), expectedType.getName());
     }
-}
\ No newline at end of file
+}

Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/TapestryUtils.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/TapestryUtils.java?rev=368410&r1=368409&r2=368410&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/TapestryUtils.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/TapestryUtils.java Thu Jan 12 09:12:21 2006
@@ -1,4 +1,4 @@
-// Copyright 2005 The Apache Software Foundation
+// Copyright 2005, 2006 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.
@@ -28,17 +28,27 @@
  * @author Howard M. Lewis Ship
  * @since 4.0
  */
-public class TapestryUtils
+public final class TapestryUtils
 {
+
+    public static final String PAGE_RENDER_SUPPORT_ATTRIBUTE = "org.apache.tapestry.PageRenderSupport";
+
+    public static final String FORM_ATTRIBUTE = "org.apache.tapestry.Form";
+
     private static final char QUOTE = '\'';
 
     private static final char BACKSLASH = '\\';
 
     private static final String EMPTY_QUOTES = "''";
 
+    /** @since 4.1 */
+    private TapestryUtils()
+    {
+    }
+
     /**
-     * Stores an attribute into the request cycle, verifying that no object with that key is already
-     * present.
+     * Stores an attribute into the request cycle, verifying that no object with
+     * that key is already present.
      * 
      * @param cycle
      *            the cycle to store the attribute into
@@ -47,7 +57,8 @@
      * @param object
      *            the attribute value to store
      * @throws IllegalStateException
-     *             if a non-null value has been stored into the cycle with the provided key.
+     *             if a non-null value has been stored into the cycle with the
+     *             provided key.
      */
 
     public static void storeUniqueAttribute(IRequestCycle cycle, String key, Object object)
@@ -58,20 +69,14 @@
 
         Object existing = cycle.getAttribute(key);
         if (existing != null)
-            throw new IllegalStateException(TapestryMessages.nonUniqueAttribute(
-                    object,
-                    key,
-                    existing));
+            throw new IllegalStateException(TapestryMessages.nonUniqueAttribute(object, key, existing));
 
         cycle.setAttribute(key, object);
     }
 
-    public static final String PAGE_RENDER_SUPPORT_ATTRIBUTE = "org.apache.tapestry.PageRenderSupport";
-
-    public static final String FORM_ATTRIBUTE = "org.apache.tapestry.Form";
-
     /**
-     * Stores the support object using {@link #storeUniqueAttribute(IRequestCycle, String, Object)}.
+     * Stores the support object using
+     * {@link #storeUniqueAttribute(IRequestCycle, String, Object)}.
      */
 
     public static void storePageRenderSupport(IRequestCycle cycle, PageRenderSupport support)
@@ -80,7 +85,8 @@
     }
 
     /**
-     * Store the IForm instance using {@link #storeUniqueAttribute(IRequestCycle, String, Object)}.
+     * Store the IForm instance using
+     * {@link #storeUniqueAttribute(IRequestCycle, String, Object)}.
      */
 
     public static void storeForm(IRequestCycle cycle, IForm form)
@@ -94,7 +100,8 @@
      * @param cycle
      *            the request cycle storing the support object
      * @param component
-     *            the component which requires the support (used to report exceptions)
+     *            the component which requires the support (used to report
+     *            exceptions)
      * @throws ApplicationRuntimeException
      *             if no support object has been stored
      */
@@ -105,8 +112,8 @@
 
         PageRenderSupport result = getOptionalPageRenderSupport(cycle);
         if (result == null)
-            throw new ApplicationRuntimeException(TapestryMessages.noPageRenderSupport(component),
-                    component.getLocation(), null);
+            throw new ApplicationRuntimeException(TapestryMessages.noPageRenderSupport(component), component
+                    .getLocation(), null);
 
         return result;
     }
@@ -117,7 +124,8 @@
      * @param cycle
      *            the request cycle storing the support object
      * @param component
-     *            the component which requires the form (used to report exceptions)
+     *            the component which requires the form (used to report
+     *            exceptions)
      * @throws ApplicationRuntimeException
      *             if no form object has been stored
      */
@@ -126,11 +134,10 @@
         Defense.notNull(cycle, "cycle");
         Defense.notNull(component, "component");
 
-        IForm result = (IForm) cycle.getAttribute(FORM_ATTRIBUTE);
+        IForm result = (IForm)cycle.getAttribute(FORM_ATTRIBUTE);
 
         if (result == null)
-            throw new ApplicationRuntimeException(TapestryMessages.noForm(component), component
-                    .getLocation(), null);
+            throw new ApplicationRuntimeException(TapestryMessages.noForm(component), component.getLocation(), null);
 
         return result;
     }
@@ -146,15 +153,16 @@
     }
 
     /**
-     * Returns the {@link PageRenderSupport}&nbsp;object if previously stored, or null otherwise.
-     * This is used in the rare case that a component wishes to adjust its behavior based on whether
-     * the page render support services are avaiable (typically, adjust for whether enclosed by a
-     * Body component, or not).
+     * Returns the {@link PageRenderSupport}&nbsp;object if previously stored,
+     * or null otherwise. This is used in the rare case that a component wishes
+     * to adjust its behavior based on whether the page render support services
+     * are avaiable (typically, adjust for whether enclosed by a Body component,
+     * or not).
      */
 
     public static PageRenderSupport getOptionalPageRenderSupport(IRequestCycle cycle)
     {
-        return (PageRenderSupport) cycle.getAttribute(PAGE_RENDER_SUPPORT_ATTRIBUTE);
+        return (PageRenderSupport)cycle.getAttribute(PAGE_RENDER_SUPPORT_ATTRIBUTE);
     }
 
     /**
@@ -167,13 +175,13 @@
     }
 
     /**
-     * Splits a single string into an array of strings, using a specific delimiter character.
+     * Splits a single string into an array of strings, using a specific
+     * delimiter character.
      */
 
     public static String[] split(String input, char delimiter)
     {
-        if (HiveMind.isBlank(input))
-            return new String[0];
+        if (HiveMind.isBlank(input)) return new String[0];
 
         List strings = new ArrayList();
 
@@ -182,7 +190,7 @@
         int start = 0;
         int length = 0;
 
-        for (int i = 0; i < buffer.length; i++)
+        for(int i = 0; i < buffer.length; i++)
         {
             if (buffer[i] != delimiter)
             {
@@ -203,28 +211,24 @@
         // If the string contains no delimiters, then
         // wrap it an an array and return it.
 
-        if (start == 0 && length == buffer.length)
-        {
-            return new String[]
-            { input };
-        }
+        if (start == 0 && length == buffer.length) { return new String[] { input }; }
 
         // The final token.
         String token = new String(buffer, start, length);
         strings.add(token);
 
-        return (String[]) strings.toArray(new String[strings.size()]);
+        return (String[])strings.toArray(new String[strings.size()]);
     }
 
     /**
-     * Enquotes a string within single quotes, ready for insertion as part of a block of JavaScript.
-     * Single quotes and backslashes within the input string are properly escaped.
+     * Enquotes a string within single quotes, ready for insertion as part of a
+     * block of JavaScript. Single quotes and backslashes within the input
+     * string are properly escaped.
      */
 
     public static String enquote(String input)
     {
-        if (input == null)
-            return EMPTY_QUOTES;
+        if (input == null) return EMPTY_QUOTES;
 
         char[] chars = input.toCharArray();
 
@@ -234,12 +238,11 @@
 
         buffer.append(QUOTE);
 
-        for (int i = 0; i < chars.length; i++)
+        for(int i = 0; i < chars.length; i++)
         {
             char ch = chars[i];
 
-            if (ch == QUOTE || ch == BACKSLASH)
-                buffer.append(BACKSLASH);
+            if (ch == QUOTE || ch == BACKSLASH) buffer.append(BACKSLASH);
 
             buffer.append(ch);
         }
@@ -250,16 +253,17 @@
     }
 
     /**
-     * A Tapestry component id is a little more liberal than an XML NMTOKEN. NMTOKEN must be
-     * [A-Za-z][A-Za-z0-9:_.-]*, but a component id might include a leading dollar sign (for an
-     * anonymous component with a fabricated id).
+     * A Tapestry component id is a little more liberal than an XML NMTOKEN.
+     * NMTOKEN must be [A-Za-z][A-Za-z0-9:_.-]*, but a component id might
+     * include a leading dollar sign (for an anonymous component with a
+     * fabricated id).
      */
 
     public static String convertTapestryIdToNMToken(String baseId)
     {
         String result = baseId.replace('$', '_');
 
-        while (result.startsWith("_"))
+        while(result.startsWith("_"))
             result = result.substring(1);
 
         return result;
@@ -278,11 +282,12 @@
     }
 
     /**
-     * Used by some generated code; obtains a component and ensures it is of the correct type.
+     * Used by some generated code; obtains a component and ensures it is of the
+     * correct type.
      */
 
-    public static IComponent getComponent(IComponent container, String componentId,
-            Class expectedType, Location location)
+    public static IComponent getComponent(IComponent container, String componentId, Class expectedType,
+            Location location)
     {
         Defense.notNull(container, "container");
         Defense.notNull(componentId, "componentId");
@@ -301,10 +306,9 @@
         }
 
         if (!expectedType.isAssignableFrom(component.getClass()))
-            throw new ApplicationRuntimeException(TapestryMessages.componentWrongType(
-                    component,
-                    expectedType), location, null);
+            throw new ApplicationRuntimeException(TapestryMessages.componentWrongType(component, expectedType),
+                    location, null);
 
         return component;
     }
-}
\ No newline at end of file
+}

Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/bean/AbstractBeanInitializer.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/bean/AbstractBeanInitializer.java?rev=368410&r1=368409&r2=368410&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/bean/AbstractBeanInitializer.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/bean/AbstractBeanInitializer.java Thu Jan 12 09:12:21 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005, 2006 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.
@@ -26,8 +26,9 @@
  * @since 1.0.5
  */
 
-abstract public class AbstractBeanInitializer extends BaseLocatable implements IBeanInitializer
-{
+public abstract class AbstractBeanInitializer extends BaseLocatable implements
+        IBeanInitializer {
+
     protected String _propertyName;
 
     public String getPropertyName()
@@ -44,20 +45,15 @@
 
     protected void setBeanProperty(Object bean, Object value)
     {
-        try
-        {
+        try {
             PropertyUtils.write(bean, _propertyName, value);
-        }
-        catch (ApplicationRuntimeException ex)
-        {
+        } catch (ApplicationRuntimeException ex) {
             String message = Tapestry.format(
                     "AbstractBeanInitializer.unable-to-set-property",
-                    _propertyName,
-                    bean,
-                    value);
+                    _propertyName, bean, value);
 
             throw new ApplicationRuntimeException(message, getLocation(), ex);
         }
 
     }
-}
\ No newline at end of file
+}

Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/bean/BeanMessages.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/bean/BeanMessages.java?rev=368410&r1=368409&r2=368410&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/bean/BeanMessages.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/bean/BeanMessages.java Thu Jan 12 09:12:21 2006
@@ -1,4 +1,4 @@
-// Copyright 2005 The Apache Software Foundation
+// Copyright 2005, 2006 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.
@@ -14,6 +14,7 @@
 
 package org.apache.tapestry.bean;
 
+import org.apache.hivemind.Messages;
 import org.apache.hivemind.impl.MessageFormatter;
 import org.apache.tapestry.IComponent;
 
@@ -21,38 +22,41 @@
  * @author Howard M. Lewis Ship
  * @since 4.0
  */
-class BeanMessages
+final class BeanMessages
 {
-    private final static MessageFormatter _formatter = new MessageFormatter(BeanMessages.class);
+    private final static Messages MESSAGES = new MessageFormatter(BeanMessages.class);
 
+    /** @since 4.1 */
+    private BeanMessages(){}
+    
     static String propertyInitializerName(String propertyName)
     {
-        return _formatter.format("property-initializer-name", propertyName);
+        return MESSAGES.format("property-initializer-name", propertyName);
     }
 
     static String beanNotDefined(IComponent component, String name)
     {
-        return _formatter.format("bean-not-defined", component.getExtendedId(), name);
+        return MESSAGES.format("bean-not-defined", component.getExtendedId(), name);
     }
 
     static String instantiationError(String name, IComponent component, Class beanClass,
             Throwable cause)
     {
-        return _formatter.format("instantiation-error", new Object[]
+        return MESSAGES.format("instantiation-error", new Object[]
         { name, component.getExtendedId(), beanClass.getName(), cause });
     }
 
     static String initializationError(IComponent component, String beanName, String propertyName,
             Throwable cause)
     {
-        return _formatter.format("initialization-error", new Object[]
+        return MESSAGES.format("initialization-error", new Object[]
         { propertyName, beanName, component.getExtendedId(), cause });
     }
 
     static String missingBeanClass(IComponent component, String beanName, String className,
             String packageList)
     {
-        return _formatter.format("missing-bean-class", new Object[]
+        return MESSAGES.format("missing-bean-class", new Object[]
         { beanName, component.getExtendedId(), className, packageList });
     }
 }

Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/bean/EvenOdd.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/bean/EvenOdd.java?rev=368410&r1=368409&r2=368410&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/bean/EvenOdd.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/bean/EvenOdd.java Thu Jan 12 09:12:21 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005, 2006 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.
@@ -15,24 +15,23 @@
 package org.apache.tapestry.bean;
 
 /**
- *  Used to emit a stream of alterating string values: "even", "odd", etc.  This
- *  is often used in the Inspector pages to make the class of a &lt;tr&gt; alternate
- *  for presentation reasons.
- *
- *  @author Howard Lewis Ship
- *
- **/
+ * Used to emit a stream of alterating string values: "even", "odd", etc. This
+ * is often used in the Inspector pages to make the class of a &lt;tr&gt;
+ * alternate for presentation reasons.
+ * 
+ * @author Howard Lewis Ship
+ */
 
 public class EvenOdd
 {
+
     private boolean even = true;
 
     /**
-     *  Returns "even" or "odd".  Whatever it returns on one invocation, it will
-     *  return the opposite on the next.  By default, the first value
-     *  returned is "even".
-     *
-     **/
+     * Returns "even" or "odd". Whatever it returns on one invocation, it will
+     * return the opposite on the next. By default, the first value returned is
+     * "even".
+     */
 
     public String getNext()
     {
@@ -42,19 +41,18 @@
 
         return result;
     }
-    
+
     public boolean isEven()
     {
         return even;
     }
 
-	/**
-	 *  Overrides the even flag.
-	 * 
-	 **/
-	
+    /**
+     * Overrides the even flag.
+     */
+
     public void setEven(boolean value)
     {
         even = value;
     }
-}
\ No newline at end of file
+}

Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/binding/AbstractBinding.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/binding/AbstractBinding.java?rev=368410&r1=368409&r2=368410&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/binding/AbstractBinding.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/binding/AbstractBinding.java Thu Jan 12 09:12:21 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005, 2006 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.
@@ -26,8 +26,8 @@
  * @author Howard Lewis Ship
  */
 
-public abstract class AbstractBinding implements IBinding
-{
+public abstract class AbstractBinding implements IBinding {
+
     /** @since 4.0 */
 
     private final String _description;
@@ -42,7 +42,8 @@
 
     /** @since 3.0 */
 
-    protected AbstractBinding(String description, ValueConverter valueConverter, Location location)
+    protected AbstractBinding(String description,
+            ValueConverter valueConverter, Location location)
     {
         Defense.notNull(description, "description");
         Defense.notNull(valueConverter, "valueConverter");
@@ -86,21 +87,20 @@
 
         Object raw = getObject();
 
-        try
-        {
+        try {
             return _valueConverter.coerceValue(raw, type);
-        }
-        catch (Exception ex)
-        {
+        } catch (Exception ex) {
             String message = BindingMessages.convertObjectError(this, ex);
 
-            throw new BindingException(message, getComponent(), _location, this, ex);
+            throw new BindingException(message, getComponent(), _location,
+                    this, ex);
         }
     }
 
     /**
-     * Returns the component to which this binding is connected; this is currently only used when
-     * building certain exceptions. This implementation returns null.
+     * Returns the component to which this binding is connected; this is
+     * currently only used when building certain exceptions. This implementation
+     * returns null.
      * 
      * @since 4.0
      */
@@ -114,7 +114,8 @@
 
     protected BindingException createReadOnlyBindingException(IBinding binding)
     {
-        return new BindingException(BindingMessages.readOnlyBinding(binding), binding);
+        return new BindingException(BindingMessages.readOnlyBinding(binding),
+                binding);
     }
 
     /** @since 4.0 */
@@ -155,4 +156,4 @@
     {
 
     }
-}
\ No newline at end of file
+}

Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/binding/AbstractBindingFactory.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/binding/AbstractBindingFactory.java?rev=368410&r1=368409&r2=368410&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/binding/AbstractBindingFactory.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/binding/AbstractBindingFactory.java Thu Jan 12 09:12:21 2006
@@ -17,15 +17,15 @@
 import org.apache.tapestry.coerce.ValueConverter;
 
 /**
- * Base class for {@link org.apache.tapestry.binding.BindingFactory}s. Manages a
- * {@link #getValueConverter() valueConverter property}, as all binding instances will need such a
- * value injected.
+ * Base class for {@link org.apache.tapestry.binding.BindingFactory}s. Manages
+ * a {@link #getValueConverter() valueConverter property}, as all binding
+ * instances will need such a value injected.
  * 
  * @author Howard M. Lewis Ship
  * @since 4.0
  */
-public abstract class AbstractBindingFactory implements BindingFactory
-{
+public abstract class AbstractBindingFactory implements BindingFactory {
+
     private ValueConverter _valueConverter;
 
     public ValueConverter getValueConverter()
@@ -38,4 +38,4 @@
         _valueConverter = valueConverter;
     }
 
-}
\ No newline at end of file
+}

Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/binding/BindingMessages.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/binding/BindingMessages.java?rev=368410&r1=368409&r2=368410&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/binding/BindingMessages.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/binding/BindingMessages.java Thu Jan 12 09:12:21 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005, 2006 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.
@@ -14,6 +14,7 @@
 
 package org.apache.tapestry.binding;
 
+import org.apache.hivemind.Messages;
 import org.apache.hivemind.impl.MessageFormatter;
 import org.apache.tapestry.IBinding;
 import org.apache.tapestry.IComponent;
@@ -22,31 +23,33 @@
  * @author Howard M. Lewis Ship
  * @since 4.0
  */
-class BindingMessages
+final class BindingMessages
 {
-    private final static MessageFormatter _formatter = new MessageFormatter(BindingMessages.class);
+
+    private final static Messages MESSAGES = new MessageFormatter(BindingMessages.class);
+
+    /** @since 4.1 */
+    private BindingMessages()
+    {
+    }
 
     static String convertObjectError(IBinding binding, Throwable cause)
     {
-        return _formatter.format("convert-object-error", binding.getDescription(), cause);
+        return MESSAGES.format("convert-object-error", binding.getDescription(), cause);
     }
 
     static String readOnlyBinding(IBinding binding)
     {
-        return _formatter.format("read-only-binding", binding.getDescription(), binding);
+        return MESSAGES.format("read-only-binding", binding.getDescription(), binding);
     }
 
     static String missingAsset(IComponent component, String assetName)
     {
-        return _formatter.format("missing-asset", component.getExtendedId(), assetName);
+        return MESSAGES.format("missing-asset", component.getExtendedId(), assetName);
     }
 
     static String listenerMethodFailure(IComponent component, String methodName, Throwable cause)
     {
-        return _formatter.format(
-                "listener-method-failure",
-                methodName,
-                component.getExtendedId(),
-                cause);
+        return MESSAGES.format("listener-method-failure", methodName, component.getExtendedId(), cause);
     }
-}
\ No newline at end of file
+}

Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/callback/CallbackMessages.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/callback/CallbackMessages.java?rev=368410&r1=368409&r2=368410&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/callback/CallbackMessages.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/callback/CallbackMessages.java Thu Jan 12 09:12:21 2006
@@ -1,4 +1,4 @@
-// Copyright 2005 The Apache Software Foundation
+// Copyright 2005, 2006 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.
@@ -14,6 +14,7 @@
 
 package org.apache.tapestry.callback;
 
+import org.apache.hivemind.Messages;
 import org.apache.hivemind.impl.MessageFormatter;
 import org.apache.tapestry.IComponent;
 
@@ -21,17 +22,23 @@
  * @author Howard M. Lewis Ship
  * @since 4.0
  */
-class CallbackMessages
+final class CallbackMessages
 {
-    private final static MessageFormatter _formatter = new MessageFormatter(CallbackMessages.class);
+
+    private final static Messages MESSAGES = new MessageFormatter(CallbackMessages.class);
+
+    /** @since 4.1 */
+    private CallbackMessages()
+    {
+    }
 
     static String pageNotExternal(String pageName)
     {
-        return _formatter.format("page-not-external", pageName);
+        return MESSAGES.format("page-not-external", pageName);
     }
 
     static String componentNotDirect(IComponent component)
     {
-        return _formatter.format("component-not-direct", component.getExtendedId());
+        return MESSAGES.format("component-not-direct", component.getExtendedId());
     }
 }

Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/coerce/CoerceMessages.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/coerce/CoerceMessages.java?rev=368410&r1=368409&r2=368410&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/coerce/CoerceMessages.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/coerce/CoerceMessages.java Thu Jan 12 09:12:21 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005, 2006 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.
@@ -14,6 +14,7 @@
 
 package org.apache.tapestry.coerce;
 
+import org.apache.hivemind.Messages;
 import org.apache.hivemind.impl.MessageFormatter;
 import org.apache.hivemind.service.ClassFabUtils;
 
@@ -21,21 +22,23 @@
  * @author Howard M. Lewis Ship
  * @since 4.0
  */
-class CoerceMessages
+final class CoerceMessages
 {
-    private final static MessageFormatter _formatter = new MessageFormatter(CoerceMessages.class);
+
+    private final static Messages MESSAGES = new MessageFormatter(CoerceMessages.class);
+
+    /** @since 4.1 */
+    private CoerceMessages()
+    {
+    }
 
     static String noConverter(Class desiredType)
     {
-        return _formatter.format("no-converter", ClassFabUtils.getJavaClassName(desiredType));
+        return MESSAGES.format("no-converter", ClassFabUtils.getJavaClassName(desiredType));
     }
 
     static String stringToNumberConversionError(String value, Class targetClass, Throwable cause)
     {
-        return _formatter.format(
-                "string-to-number-conversion-error",
-                value,
-                targetClass.getName(),
-                cause);
+        return MESSAGES.format("string-to-number-conversion-error", value, targetClass.getName(), cause);
     }
-}
\ No newline at end of file
+}

Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/coerce/IteratorToListConverter.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/coerce/IteratorToListConverter.java?rev=368410&r1=368409&r2=368410&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/coerce/IteratorToListConverter.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/coerce/IteratorToListConverter.java Thu Jan 12 09:12:21 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005, 2006 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.
@@ -27,11 +27,11 @@
 
     public Object convertValue(Object value)
     {
-        Iterator it = (Iterator) value;
+        Iterator it = (Iterator)value;
         List list = new ArrayList();
-        while (it.hasNext())
-        	list.add(it.next());
+        while(it.hasNext())
+            list.add(it.next());
         return list;
     }
 
-}
\ No newline at end of file
+}

Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/coerce/StringConvertedPropertySelectionModel.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/coerce/StringConvertedPropertySelectionModel.java?rev=368410&r1=368409&r2=368410&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/coerce/StringConvertedPropertySelectionModel.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/coerce/StringConvertedPropertySelectionModel.java Thu Jan 12 09:12:21 2006
@@ -1,4 +1,4 @@
-// Copyright 2005 The Apache Software Foundation
+// Copyright 2005, 2006 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.
@@ -21,7 +21,8 @@
 import org.apache.tapestry.form.IPropertySelectionModel;
 
 /**
- * {@link org.apache.tapestry.form.IPropertySelectionModel} created from a comma-seperated string by
+ * {@link org.apache.tapestry.form.IPropertySelectionModel} created from a
+ * comma-seperated string by
  * {@link org.apache.tapestry.coerce.StringToPropertySelectionModelConverter}.
  * 
  * @author Howard M. Lewis Ship
@@ -29,8 +30,11 @@
  */
 public final class StringConvertedPropertySelectionModel implements IPropertySelectionModel
 {
+
+    /** Stores a single label/value pair. */
     private static class Entry
     {
+
         String _label;
 
         String _value;
@@ -62,7 +66,7 @@
 
         _entries = new ArrayList(terms.length);
 
-        for (int i = 0; i < terms.length; i++)
+        for(int i = 0; i < terms.length; i++)
         {
             _entries.add(new Entry(terms[i]));
         }
@@ -75,7 +79,7 @@
 
     private Entry getEntry(int index)
     {
-        return (Entry) _entries.get(index);
+        return (Entry)_entries.get(index);
     }
 
     public Object getOption(int index)
@@ -96,7 +100,8 @@
 
     public Object translateValue(String value)
     {
-        // Values are the same on the client and the server, so no translation needed.
+        // Values are the same on the client and the server, so no translation
+        // needed.
         return value;
     }
 

Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/coerce/TypeConverter.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/coerce/TypeConverter.java?rev=368410&r1=368409&r2=368410&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/coerce/TypeConverter.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/coerce/TypeConverter.java Thu Jan 12 09:12:21 2006
@@ -14,7 +14,7 @@
 
 package org.apache.tapestry.coerce;
 
-/** 
+/**
  * Converts a value to a specific (implicit) type.
  * 
  * @author Howard M. Lewis Ship
@@ -22,13 +22,16 @@
  */
 public interface TypeConverter
 {
+
     /**
      * Converts the value.
      * 
-     * @param value the value to be converted (which may be null)
-     * @return the value converted to a specific type; different implementations of TypeConverter
-     * will return different types.
-     * @throws org.apache.hivemind.ApplicationRuntimeException if the value can not be converted
+     * @param value
+     *            the value to be converted (which may be null)
+     * @return the value converted to a specific type; different implementations
+     *         of TypeConverter will return different types.
+     * @throws org.apache.hivemind.ApplicationRuntimeException
+     *             if the value can not be converted
      */
-    public Object convertValue(Object value);
+    Object convertValue(Object value);
 }

Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/coerce/TypeConverterContribution.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/coerce/TypeConverterContribution.java?rev=368410&r1=368409&r2=368410&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/coerce/TypeConverterContribution.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/coerce/TypeConverterContribution.java Thu Jan 12 09:12:21 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005, 2006 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.
@@ -23,6 +23,7 @@
  */
 public final class TypeConverterContribution
 {
+
     private TypeConverter _converter;
 
     private Class _subjectClass;
@@ -47,4 +48,4 @@
         _subjectClass = subjectClass;
     }
 
-}
\ No newline at end of file
+}

Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/coerce/TypeConverterWrapper.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/coerce/TypeConverterWrapper.java?rev=368410&r1=368409&r2=368410&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/coerce/TypeConverterWrapper.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/coerce/TypeConverterWrapper.java Thu Jan 12 09:12:21 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005, 2006 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.
@@ -22,16 +22,18 @@
 
 /**
  * A service implementation that works around an
- * {@link org.apache.hivemind.lib.util.StrategyRegistry}. The registry is contructed from a
- * configuration that follows the <code>tapestry.coerce.Converters</code> schema (a List of
- * {@link org.apache.tapestry.coerce.TypeConverterContribution}plus an additional converter for
- * nulls.
+ * {@link org.apache.hivemind.lib.util.StrategyRegistry}. The registry is
+ * contructed from a configuration that follows the
+ * <code>tapestry.coerce.Converters</code> schema (a List of
+ * {@link org.apache.tapestry.coerce.TypeConverterContribution}plus an
+ * additional converter for nulls.
  * 
  * @author Howard M. Lewis Ship
  * @since 4.0
  */
 public final class TypeConverterWrapper implements TypeConverter
 {
+
     private StrategyRegistry _registry = new StrategyRegistryImpl();
 
     private List _contributions;
@@ -42,9 +44,9 @@
     {
         Iterator i = _contributions.iterator();
 
-        while (i.hasNext())
+        while(i.hasNext())
         {
-            TypeConverterContribution c = (TypeConverterContribution) i.next();
+            TypeConverterContribution c = (TypeConverterContribution)i.next();
 
             _registry.register(c.getSubjectClass(), c.getConverter());
         }
@@ -54,19 +56,19 @@
     {
         if (value == null)
         {
-            if (_nullConverter == null)
-                return null;
+            if (_nullConverter == null) return null;
 
             return _nullConverter.convertValue(null);
         }
 
-        TypeConverter delegate = (TypeConverter) _registry.getStrategy(value.getClass());
+        TypeConverter delegate = (TypeConverter)_registry.getStrategy(value.getClass());
 
         return delegate.convertValue(value);
     }
 
     /**
-     * Sets the List of {@link org.apache.tapestry.coerce.TypeConverterContribution}s.
+     * Sets the List of
+     * {@link org.apache.tapestry.coerce.TypeConverterContribution}s.
      */
 
     public void setContributions(List contributions)
@@ -82,4 +84,4 @@
     {
         _nullConverter = nullConverter;
     }
-}
\ No newline at end of file
+}

Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/coerce/ValueConverter.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/coerce/ValueConverter.java?rev=368410&r1=368409&r2=368410&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/coerce/ValueConverter.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/coerce/ValueConverter.java Thu Jan 12 09:12:21 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005, 2006 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.
@@ -15,19 +15,20 @@
 package org.apache.tapestry.coerce;
 
 /**
- * Converts a value (possibly null) to an alternate data type; typically from String to boolean or a
- * number type.
+ * Converts a value (possibly null) to an alternate data type; typically from
+ * String to boolean or a number type.
  * <p>
  * Typically, a ValueConverter will select a particular
- * {@link org.apache.tapestry.coerce.TypeConverter}to perform the conversion. The
- * {@link org.apache.tapestry.coerce.ValueConverterImpl}implementation also makes use of built-in
- * {@link java.beans.PropertyEditor}s.
+ * {@link org.apache.tapestry.coerce.TypeConverter} to perform the conversion.
+ * The {@link org.apache.tapestry.coerce.ValueConverterImpl} implementation also
+ * makes use of built-in {@link java.beans.PropertyEditor}s.
  * 
  * @author Howard M. Lewis Ship
  * @since 4.0
  */
 public interface ValueConverter
 {
+
     /**
      * Performs a conversion of a value to a particular type.
      * 
@@ -35,10 +36,10 @@
      *            The value to be converted (may be null)
      * @param desiredType
      *            the type that will be converted to
-     * @returns the value converted to the indicated type. May return the input value if it is
-     *          already assignable to the desiredType.
+     * @returns the value converted to the indicated type. May return the input
+     *          value if it is already assignable to the desiredType.
      * @throws org.apache.hivemind.ApplicationRuntimeException
      *             if the value can not be converted
      */
-    public Object coerceValue(Object value, Class desiredType);
-}
\ No newline at end of file
+    Object coerceValue(Object value, Class desiredType);
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org