myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mat...@apache.org
Subject svn commit: r801555 - /myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/context/AccessibilityProfile.java
Date Thu, 06 Aug 2009 09:21:11 GMT
Author: matzew
Date: Thu Aug  6 09:21:10 2009
New Revision: 801555

URL: http://svn.apache.org/viewvc?rev=801555&view=rev
Log:
TRINIDAD-1543 - AccessibilityProfile is not Serializable

Thanks to Dave Robinson  for the patch!

Modified:
    myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/context/AccessibilityProfile.java

Modified: myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/context/AccessibilityProfile.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/context/AccessibilityProfile.java?rev=801555&r1=801554&r2=801555&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/context/AccessibilityProfile.java
(original)
+++ myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/context/AccessibilityProfile.java
Thu Aug  6 09:21:10 2009
@@ -18,16 +18,18 @@
  */
 package org.apache.myfaces.trinidad.context;
 
+import java.io.Serializable;
+
 /**
  * Specifies a set of accessibility-related properties that are applied
  * to the current request.
- * 
- * AccessibilityProfile instances are obtained by the getInstance() 
+ *
+ * AccessibilityProfile instances are obtained by the getInstance()
  * factory method.
- * 
+ *
  * AccessibilityProfile instances are immutable.
  */
-public class AccessibilityProfile
+public class AccessibilityProfile 
 {
   /**
    * Color contrast values
@@ -82,7 +84,7 @@
   {    
     // Note: we could cache and share AccessibilityProfile instances
     // here if that seems useful.
-    return new AccessibilityProfile(colorContrast, fontSize);
+    return new SerializableAccessibilityProfile(colorContrast, fontSize);
   }
 
   /**
@@ -132,15 +134,31 @@
     FontSize      fontSize
     )
   {
-
     _colorContrast = (colorContrast == null) ? ColorContrast.STANDARD : colorContrast;
     _fontSize = (fontSize == null) ? FontSize.MEDIUM : fontSize;
   }
 
   private final ColorContrast _colorContrast;
   private final FontSize      _fontSize;
-  
+
   // Default instance
   private static final AccessibilityProfile _sDefaultInstance =
     AccessibilityProfile.getInstance(ColorContrast.STANDARD, FontSize.MEDIUM);
+  
+  
+  /**
+   * We maintain a private internal serializable class for our singleton instance.
+   */
+  private static final class SerializableAccessibilityProfile extends AccessibilityProfile
implements Serializable
+  {
+    public SerializableAccessibilityProfile(
+      ColorContrast colorContrast,
+      FontSize      fontSize
+      )
+    {
+      super(colorContrast, fontSize);
+    }
+    
+    private static final long serialVersionUID = 1L;
+  }
 }



Mime
View raw message