You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by jc...@apache.org on 2007/03/20 14:43:39 UTC

svn commit: r520387 - /incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/model/AbstractWrapModel.java

Author: jcompagner
Date: Tue Mar 20 06:43:38 2007
New Revision: 520387

URL: http://svn.apache.org/viewvc?view=rev&rev=520387
Log:
simple helper/base class to quickly create WrapModels if you don't need to implement all (get/set/detach) methods
 

Added:
    incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/model/AbstractWrapModel.java   (with props)

Added: incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/model/AbstractWrapModel.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/model/AbstractWrapModel.java?view=auto&rev=520387
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/model/AbstractWrapModel.java (added)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/model/AbstractWrapModel.java Tue Mar 20 06:43:38 2007
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package wicket.model;
+
+/**
+ * Simple base class for IWrapModel objects see {@link IAssignmentAwareModel}
+ * or {@link IInheritableModel} so that you don't have to have empty methods
+ * like detach or setObject() when not used in the wrapper. 
+ * 
+ * @author jcompagner
+ */
+public abstract class AbstractWrapModel implements IWrapModel
+{
+	/**
+	 * @see wicket.model.IModel#getObject()
+	 */
+	public Object getObject()
+	{
+		return null;
+	}
+
+	/**
+	 * @see wicket.model.IModel#setObject(java.lang.Object)
+	 */
+	public void setObject(Object object)
+	{
+	}
+
+	/**
+	 * @see wicket.model.IDetachable#detach()
+	 */
+	public void detach()
+	{
+	}
+
+}

Propchange: incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/model/AbstractWrapModel.java
------------------------------------------------------------------------------
    svn:eol-style = native