You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by jr...@apache.org on 2010/06/25 22:37:52 UTC

svn commit: r958107 - /wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/model/Model.java

Author: jrthomerson
Date: Fri Jun 25 20:37:51 2010
New Revision: 958107

URL: http://svn.apache.org/viewvc?rev=958107&view=rev
Log:
fixes WICKET-2925 in 1.4.x

Modified:
    wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/model/Model.java

Modified: wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/model/Model.java
URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/model/Model.java?rev=958107&r1=958106&r2=958107&view=diff
==============================================================================
--- wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/model/Model.java (original)
+++ wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/model/Model.java Fri Jun 25 20:37:51 2010
@@ -16,14 +16,21 @@
  */
 package org.apache.wicket.model;
 
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
 import org.apache.wicket.Component;
 import org.apache.wicket.WicketRuntimeException;
-import org.apache.wicket.model.util.*;
+import org.apache.wicket.model.util.MapModel;
+import org.apache.wicket.model.util.WildcardCollectionModel;
+import org.apache.wicket.model.util.WildcardListModel;
+import org.apache.wicket.model.util.WildcardSetModel;
 import org.apache.wicket.util.lang.Objects;
 
-import java.io.Serializable;
-import java.util.*;
-
 
 /**
  * <code>Model</code> is the basic implementation of an <code>IModel</code>. It just wraps a simple
@@ -112,7 +119,7 @@ public class Model<T extends Serializabl
 	/**
 	 * Factory method for models that contain lists. This factory method will automatically rebuild
 	 * a nonserializable <code>list</code> into a serializable one.
-	 *
+	 * 
 	 * @param <C>
 	 *            model type
 	 * @param list
@@ -182,7 +189,7 @@ public class Model<T extends Serializabl
 	/**
 	 * Factory method for models that contain sets. This factory method will automatically rebuild a
 	 * nonserializable <code>set</code> into a serializable one.
-	 *
+	 * 
 	 * @param <C>
 	 *            model type
 	 * @param set
@@ -211,7 +218,7 @@ public class Model<T extends Serializabl
 
 
 	/**
-	 * Factory methods for Model which uses type inference to make code shorter. Eqivalent to
+	 * Factory methods for Model which uses type inference to make code shorter. Equivalent to
 	 * <code>new Model<TypeOfObject>(object)</code>.
 	 * 
 	 * @param <T>
@@ -224,6 +231,19 @@ public class Model<T extends Serializabl
 	}
 
 	/**
+	 * Factory methods for Model which uses type inference to make code shorter. Equivalent to
+	 * <code>new Model<TypeOfObject>()</code>.
+	 * 
+	 * @param <T>
+	 * @param object
+	 * @return Model that contains <code>object</code>
+	 */
+	public static <T extends Serializable> Model<T> of()
+	{
+		return new Model<T>();
+	}
+
+	/**
 	 * @see org.apache.wicket.model.IModel#getObject()
 	 */
 	public T getObject()