You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by sk...@apache.org on 2008/02/16 21:33:46 UTC

svn commit: r628377 - /myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/lib/jsf/SerializableConverter.java

Author: skitching
Date: Sat Feb 16 12:33:46 2008
New Revision: 628377

URL: http://svn.apache.org/viewvc?rev=628377&view=rev
Log:
Add docs, remove unneeded code.

Modified:
    myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/lib/jsf/SerializableConverter.java

Modified: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/lib/jsf/SerializableConverter.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/lib/jsf/SerializableConverter.java?rev=628377&r1=628376&r2=628377&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/lib/jsf/SerializableConverter.java (original)
+++ myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/lib/jsf/SerializableConverter.java Sat Feb 16 12:33:46 2008
@@ -27,11 +27,29 @@
 import java.io.Serializable;
 
 /**
- * Wraps a converter and serialize just its id to make it serializable.
+ * Wraps a converter so that when the parent component is serialized,
+ * just the beanName of the component is saved.
+ * <p>
+ * When the parent component is recreated, this wrapper will then
+ * refetch the converter using the saved beanName. This will discard
+ * all state that the converter instance has, but for most converters
+ * that doesn't matter.
+ * <p>
+ * This wrapper is of course applicable only to converters that are
+ * fetched using an EL expression. It cannot be applied to converters
+ * that are retrieved via Application.createConverter(id), ie where
+ * a new instance is created directly from a Class that was registered
+ * with the JSF framework.
+ * <p>
+ * To use this class, a component in a page should specify
+ * <code>converter="#{someBeanName}"</code>. The definition for bean
+ * "someBeanName" should specify a non-singleton instance of this class.
+ * The constructor should be passed a string which specifies the name of
+ * the real Constructor implementation that is to be used.
  */
 public class SerializableConverter implements Converter, Serializable
 {
-	private static final long serialVersionUID = 1L;
+	private static final long serialVersionUID = 2L;
 
 	private final String converterId;
 	private transient Converter converter;
@@ -39,12 +57,6 @@
 	public SerializableConverter(String converterId)
 	{
 		this.converterId = converterId;
-	}
-
-	public SerializableConverter(String converterId, Converter converter)
-	{
-		this(converterId);
-		this.converter = converter;
 	}
 
 	protected Converter getConverter()