CVS: Tapestry/framework/src/net/sf/tapestry/record MapCopier.java,NONE,1.1.2.1 DefaultValuePersister.java,1.1.2.3,1.1.2.4

Howard Lewis Ship <[email protected]>
Newsgroups gmane.comp.java.tapestry.cvs
Message-ID <[email protected]>
Update of /cvsroot/tapestry/Tapestry/framework/src/net/sf/tapestry/record
In directory sc8-pr-cvs1:/tmp/cvs-serv16017/framework/src/net/sf/tapestry/record

Modified Files:
      Tag: hship-2-3
	DefaultValuePersister.java 
Added Files:
      Tag: hship-2-3
	MapCopier.java 
Log Message:
Add value copier for Map.

--- NEW FILE: MapCopier.java ---
package net.sf.tapestry.record;

import java.util.HashMap;
import java.util.Map;

/**
 *  Copies a {@link java.util.Map} by creating a 
 *  {@link java.util.HashMap}.
 *
 *  @author Howard Lewis Ship
 *  @version $Id: MapCopier.java,v 1.1.2.1 2003/01/02 13:25:18 hship Exp $
 *  @since 2.4
 *
 **/

public class MapCopier implements IValueCopier
{
    public Object makeCopyOfValue(Object value) throws PageRecorderSerializationException
    {
        Map inputMap = (Map)value;
        
        return new HashMap(inputMap);        
    }
}

Index: DefaultValuePersister.java
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/framework/src/net/sf/tapestry/record/Attic/DefaultValuePersister.java,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -C2 -d -r1.1.2.3 -r1.1.2.4
*** DefaultValuePersister.java	2 Jan 2003 03:13:50 -0000	1.1.2.3
--- DefaultValuePersister.java	2 Jan 2003 13:25:18 -0000	1.1.2.4
***************
*** 5,8 ****
--- 5,9 ----
  import java.util.Date;
  import java.util.List;
+ import java.util.Map;
  
  import javax.ejb.EJBObject;
***************
*** 70,73 ****
--- 71,77 ----
       * 
       *  <p>
+      *  An instance of {@link MapCopier} is registered for {@link java.util.Map}.
+      * 
+      *  <p>
       *  An instance of {@link EJBCopier} for {@link EJBObject}, and {@link EJBWrapperCopier}
       *  for {@link EJBWrapper}.
***************
*** 95,100 ****
--- 99,110 ----
  
          registerValueCopier(List.class, new ListCopier());
+         registerValueCopier(Map.class, new MapCopier());
+         
+         // EJBCopier copies an EJBObject as an EJBWrapper
          
          registerValueCopier(EJBObject.class, new EJBCopier());
+         
+         // EJBWrapperCopier restores an EJBWrapper to an EJBObject
+         
          registerValueCopier(EJBWrapper.class, new EJBWrapperCopier());
          



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.