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

svn commit: r520973 - /incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/request/RequestParameters.java

Author: ehillenius
Date: Wed Mar 21 12:17:24 2007
New Revision: 520973

URL: http://svn.apache.org/viewvc?view=rev&rev=520973
Log:
toString improvement for array values

Modified:
    incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/request/RequestParameters.java

Modified: incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/request/RequestParameters.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/request/RequestParameters.java?view=diff&rev=520973&r1=520972&r2=520973
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/request/RequestParameters.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/request/RequestParameters.java Wed Mar 21 12:17:24 2007
@@ -90,24 +90,23 @@
 	}
 
 	/**
-	 * Gets any bookmarkable page class.
+	 * Gets the component registration id of any behavior.
 	 * 
-	 * @return any bookmarkable page class
+	 * @return behaviorId the id
 	 */
-	public String getBookmarkablePageClass()
+	public String getBehaviorId()
 	{
-		return bookmarkablePageClass;
+		return behaviorId;
 	}
 
 	/**
-	 * Sets any bookmarkable page class.
+	 * Gets any bookmarkable page class.
 	 * 
-	 * @param bookmarkablePageClass
-	 *            any bookmarkable page class
+	 * @return any bookmarkable page class
 	 */
-	public void setBookmarkablePageClass(String bookmarkablePageClass)
+	public String getBookmarkablePageClass()
 	{
-		this.bookmarkablePageClass = bookmarkablePageClass;
+		return bookmarkablePageClass;
 	}
 
 	/**
@@ -121,17 +120,6 @@
 	}
 
 	/**
-	 * Sets any id of a non-page target component.
-	 * 
-	 * @param componentId
-	 *            any id of a non-page target component
-	 */
-	public void setComponentId(String componentId)
-	{
-		this.componentId = componentId;
-	}
-
-	/**
 	 * Gets the full path to a component (might be just the page)..
 	 * 
 	 * @return the full path to a component (might be just the page).
@@ -142,17 +130,6 @@
 	}
 
 	/**
-	 * Sets the full path to a component (might be just the page)..
-	 * 
-	 * @param componentPath
-	 *            the full path to a component (might be just the page).
-	 */
-	public void setComponentPath(String componentPath)
-	{
-		this.componentPath = componentPath;
-	}
-
-	/**
 	 * @return The interface named by these request parameters
 	 */
 	public RequestListenerInterface getInterface()
@@ -171,17 +148,6 @@
 	}
 
 	/**
-	 * Sets any callable interface name (e.g. {@link ILinkListener}).
-	 * 
-	 * @param interfaceName
-	 *            any callable interface name (e.g. {@link ILinkListener})
-	 */
-	public void setInterfaceName(String interfaceName)
-	{
-		this.interfaceName = interfaceName;
-	}
-
-	/**
 	 * Gets any name of the page map.
 	 * 
 	 * @return any name of the page map
@@ -192,17 +158,6 @@
 	}
 
 	/**
-	 * Sets any name of the page map.
-	 * 
-	 * @param pageMapName
-	 *            any name of the page map
-	 */
-	public void setPageMapName(String pageMapName)
-	{
-		this.pageMapName = pageMapName;
-	}
-
-	/**
 	 * Gets free-to-use map of non-reserved parameters.
 	 * 
 	 * @return free-to-use map of non-reserved parameters
@@ -213,14 +168,13 @@
 	}
 
 	/**
-	 * Sets free-to-use map of non-reserved parameters.
+	 * Gets path info.
 	 * 
-	 * @param parameters
-	 *            free-to-use map of non-reserved parameters
+	 * @return path info
 	 */
-	public void setParameters(Map parameters)
+	public String getPath()
 	{
-		this.parameters = parameters;
+		return path;
 	}
 
 	/**
@@ -234,17 +188,6 @@
 	}
 
 	/**
-	 * Sets any resource key.
-	 * 
-	 * @param resourceKey
-	 *            any resource key
-	 */
-	public void setResourceKey(String resourceKey)
-	{
-		this.resourceKey = resourceKey;
-	}
-
-	/**
 	 * Gets any version information string.
 	 * 
 	 * @return any version information string
@@ -255,70 +198,71 @@
 	}
 
 	/**
-	 * Sets any version information string.
+	 * Tells wicket whether this request should only be processed if the page +
+	 * version specified are pointing to the last page the user accessed.
 	 * 
-	 * @param versionNumber
-	 *            any version information string
+	 * @see WebRequestCodingStrategy#IGNORE_IF_NOT_ACTIVE_PARAMETER_NAME
+	 * 
+	 * @return the only-process-if-path-active flag
 	 */
-	public void setVersionNumber(int versionNumber)
+	public boolean isOnlyProcessIfPathActive()
 	{
-		this.versionNumber = versionNumber;
+		return onlyProcessIfPathActive;
 	}
 
 	/**
-	 * Gets path info.
+	 * Sets the component registration id of any behavior.
 	 * 
-	 * @return path info
+	 * @param behaviorId
+	 *            the id
 	 */
-	public String getPath()
+	public void setBehaviorId(String behaviorId)
 	{
-		return path;
+		this.behaviorId = behaviorId;
 	}
 
 	/**
-	 * Sets path info.
+	 * Sets any bookmarkable page class.
 	 * 
-	 * @param pathInfo
-	 *            path info
+	 * @param bookmarkablePageClass
+	 *            any bookmarkable page class
 	 */
-	public void setPath(String pathInfo)
+	public void setBookmarkablePageClass(String bookmarkablePageClass)
 	{
-		this.path = pathInfo;
+		this.bookmarkablePageClass = bookmarkablePageClass;
 	}
 
 	/**
-	 * Gets the component registration id of any behavior.
+	 * Sets any id of a non-page target component.
 	 * 
-	 * @return behaviorId the id
+	 * @param componentId
+	 *            any id of a non-page target component
 	 */
-	public String getBehaviorId()
+	public void setComponentId(String componentId)
 	{
-		return behaviorId;
+		this.componentId = componentId;
 	}
 
 	/**
-	 * Sets the component registration id of any behavior.
+	 * Sets the full path to a component (might be just the page)..
 	 * 
-	 * @param behaviorId
-	 *            the id
+	 * @param componentPath
+	 *            the full path to a component (might be just the page).
 	 */
-	public void setBehaviorId(String behaviorId)
+	public void setComponentPath(String componentPath)
 	{
-		this.behaviorId = behaviorId;
+		this.componentPath = componentPath;
 	}
 
-
 	/**
-	 * Tells wicket whether this request should only be processed if the page +
-	 * version specified are pointing to the last page the user accessed.
-	 * 
-	 * @see WebRequestCodingStrategy#IGNORE_IF_NOT_ACTIVE_PARAMETER_NAME
+	 * Sets any callable interface name (e.g. {@link ILinkListener}).
 	 * 
-	 * @return the only-process-if-path-active flag
+	 * @param interfaceName
+	 *            any callable interface name (e.g. {@link ILinkListener})
 	 */
-	public boolean isOnlyProcessIfPathActive()
+	public void setInterfaceName(String interfaceName)
 	{
-		return onlyProcessIfPathActive;
+		this.interfaceName = interfaceName;
 	}
 
 	/**
@@ -334,6 +278,62 @@
 	}
 
 	/**
+	 * Sets any name of the page map.
+	 * 
+	 * @param pageMapName
+	 *            any name of the page map
+	 */
+	public void setPageMapName(String pageMapName)
+	{
+		this.pageMapName = pageMapName;
+	}
+
+	/**
+	 * Sets free-to-use map of non-reserved parameters.
+	 * 
+	 * @param parameters
+	 *            free-to-use map of non-reserved parameters
+	 */
+	public void setParameters(Map parameters)
+	{
+		this.parameters = parameters;
+	}
+
+	/**
+	 * Sets path info.
+	 * 
+	 * @param pathInfo
+	 *            path info
+	 */
+	public void setPath(String pathInfo)
+	{
+		this.path = pathInfo;
+	}
+
+
+	/**
+	 * Sets any resource key.
+	 * 
+	 * @param resourceKey
+	 *            any resource key
+	 */
+	public void setResourceKey(String resourceKey)
+	{
+		this.resourceKey = resourceKey;
+	}
+
+	/**
+	 * Sets any version information string.
+	 * 
+	 * @param versionNumber
+	 *            any version information string
+	 */
+	public void setVersionNumber(int versionNumber)
+	{
+		this.versionNumber = versionNumber;
+	}
+
+	/**
 	 * @see java.lang.Object#toString()
 	 */
 	public String toString()
@@ -358,7 +358,33 @@
 			for (Iterator i = getParameters().entrySet().iterator(); i.hasNext();)
 			{
 				Entry entry = (Entry)i.next();
-				b.append(entry.getKey()).append("=").append(entry.getValue());
+				Object value = entry.getValue();
+				b.append(entry.getKey()).append("=");
+				if (value != null && value instanceof Object[])
+				{
+					Object[] values = (Object[])value;
+					if (values.length > 1)
+					{
+						b.append("{");
+						for (int j = 0; j < values.length; j++)
+						{
+							b.append(values[j]);
+							if (j < values.length)
+							{
+								b.append(",");
+							}
+						}
+						b.append("}");
+					}
+					else
+					{
+						b.append((values.length == 1) ? values[0] : "");
+					}
+				}
+				else
+				{
+					b.append(value);
+				}
 				if (i.hasNext())
 				{
 					b.append(",");