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/06/04 02:14:00 UTC

svn commit: r544015 - in /incubator/wicket/trunk: jdk-1.4/wicket/src/main/java/org/apache/wicket/ jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/resolver/ jdk-1.4/wicket/src/main/java/org/apache/wicket/model/ jdk-1.4/wicket/src/main/java/org/apa...

Author: ehillenius
Date: Sun Jun  3 17:13:59 2007
New Revision: 544015

URL: http://svn.apache.org/viewvc?view=rev&rev=544015
Log:
simplified converterlocators by removing IConverterLocatorFactoryLocatorFactoryFactory. We really don't need that much indirection. Application now has overridable method newConverterLocator that is called during startup, and you can ask application to give the converter locator. If, for some super crazy reason, that's not enough indirection, it's easy for people to add a layer themselves.

Removed:
    incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/util/convert/ConverterLocatorFactory.java
    incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/util/convert/IConverterLocatorFactory.java
Modified:
    incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Application.java
    incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Component.java
    incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/IConverterLocator.java
    incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Session.java
    incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/resolver/AutoComponentResolver.java
    incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/model/AbstractPropertyModel.java
    incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/settings/IApplicationSettings.java
    incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/settings/Settings.java
    incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/util/lang/PropertyResolver.java
    incubator/wicket/trunk/jdk-1.5/wicket-jmx/src/main/java/org/apache/wicket/jmx/ApplicationSettings.java
    incubator/wicket/trunk/jdk-1.5/wicket-jmx/src/main/java/org/apache/wicket/jmx/ApplicationSettingsMBean.java

Modified: incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Application.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Application.java?view=diff&rev=544015&r1=544014&r2=544015
==============================================================================
--- incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Application.java (original)
+++ incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Application.java Sun Jun  3 17:13:59 2007
@@ -58,6 +58,7 @@
 import org.apache.wicket.settings.ISecuritySettings;
 import org.apache.wicket.settings.ISessionSettings;
 import org.apache.wicket.settings.Settings;
+import org.apache.wicket.util.convert.ConverterLocator;
 import org.apache.wicket.util.lang.Classes;
 import org.apache.wicket.util.lang.Objects;
 import org.apache.wicket.util.time.Duration;
@@ -212,6 +213,9 @@
 	/** list of {@link IComponentInstantiationListener}s. */
 	private IComponentInstantiationListener[] componentInstantiationListeners = new IComponentInstantiationListener[0];
 
+	/** The converter locator instance. */
+	private IConverterLocator converterLocator;
+
 	/** list of initializers. */
 	private List initializers = new ArrayList();
 
@@ -340,8 +344,8 @@
 		}
 		else
 		{
-			throw new IllegalArgumentException(
-					"Invalid configuration type: '" + configurationType + "'.  Must be \"development\" or \"deployment\".");
+			throw new IllegalArgumentException("Invalid configuration type: '" + configurationType
+					+ "'.  Must be \"development\" or \"deployment\".");
 		}
 	}
 
@@ -368,13 +372,12 @@
 	 * {@link #DEVELOPMENT} or {@link #DEPLOYMENT}.
 	 * 
 	 * 
-	 * The configuration type. Must currently be either DEVELOPMENT
-	 * or DEPLOYMENT. Currently, if the configuration type is
-	 * DEVELOPMENT, resources are polled for changes, component usage
-	 * is checked, wicket tags are not stripped from ouput and a
-	 * detailed exception page is used. If the type is DEPLOYMENT,
-	 * component usage is not checked, wicket tags are stripped from
-	 * output and a non-detailed exception page is used to display
+	 * The configuration type. Must currently be either DEVELOPMENT or
+	 * DEPLOYMENT. Currently, if the configuration type is DEVELOPMENT,
+	 * resources are polled for changes, component usage is checked, wicket tags
+	 * are not stripped from ouput and a detailed exception page is used. If the
+	 * type is DEPLOYMENT, component usage is not checked, wicket tags are
+	 * stripped from output and a non-detailed exception page is used to display
 	 * errors.
 	 * 
 	 * @return configuration
@@ -384,6 +387,14 @@
 	public abstract String getConfigurationType();
 
 	/**
+	 * @return The converter locator for this application
+	 */
+	public final IConverterLocator getConverterLocator()
+	{
+		return converterLocator;
+	}
+
+	/**
 	 * @return Application's debug related settings
 	 * @see IDebugSettings
 	 * @since 1.2
@@ -812,7 +823,7 @@
 	{
 		settingsAccessible = true;
 		IPageSettings pageSettings = getPageSettings();
-		
+
 		// Install default component resolvers
 		pageSettings.addComponentResolver(new ParentResolver());
 		pageSettings.addComponentResolver(new AutoComponentResolver());
@@ -835,6 +846,17 @@
 		applicationKeyToApplication.put(applicationKey, this);
 
 		sessionStore = newSessionStore();
+		converterLocator = newConverterLocator();
+	}
+
+	/**
+	 * Creates and returns a new instance of {@link IConverterLocator}.
+	 * 
+	 * @return A new {@link IConverterLocator} instance
+	 */
+	protected IConverterLocator newConverterLocator()
+	{
+		return new ConverterLocator();
 	}
 
 	/**

Modified: incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Component.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Component.java?view=diff&rev=544015&r1=544014&r2=544015
==============================================================================
--- incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Component.java (original)
+++ incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Component.java Sun Jun  3 17:13:59 2007
@@ -976,7 +976,7 @@
 	 */
 	public IConverter getConverter(Class/* <?> */type)
 	{
-		return getSession().getConverter(type);
+		return getApplication().getConverterLocator().getConverter(type);
 	}
 
 	/**
@@ -2940,8 +2940,13 @@
 			onAttach();
 			if (!getFlag(FLAG_ATTACH_SUPER_CALL_VERIFIED))
 			{
-				throw new IllegalStateException("Component " + this + " of type " + getClass().getName() + " has not been properly attached.  "
-						+ "Something in its class hierarchy has failed to call super.onAttach() in an override of onAttach() method");
+				throw new IllegalStateException(
+						"Component "
+								+ this
+								+ " of type "
+								+ getClass().getName()
+								+ " has not been properly attached.  "
+								+ "Something in its class hierarchy has failed to call super.onAttach() in an override of onAttach() method");
 			}
 			setFlag(FLAG_ATTACHING, false);
 			setFlag(FLAG_ATTACHED, true);

Modified: incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/IConverterLocator.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/IConverterLocator.java?view=diff&rev=544015&r1=544014&r2=544015
==============================================================================
--- incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/IConverterLocator.java (original)
+++ incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/IConverterLocator.java Sun Jun  3 17:13:59 2007
@@ -16,16 +16,14 @@
  */
 package org.apache.wicket;
 
-import org.apache.wicket.settings.IApplicationSettings;
 import org.apache.wicket.util.convert.ConverterLocator;
 import org.apache.wicket.util.convert.IConverter;
-import org.apache.wicket.util.convert.IConverterLocatorFactory;
 
 /**
  * Locates the proper converter instance for a given type. Classes that
  * implement this interface must return the right converter for the given class
- * type. Instances are created by {@link IConverterLocatorFactory}, which can
- * be configured using {@link IApplicationSettings#getConverterLocatorFactory()}.
+ * type. Instances are created by {@link IConverterLocator}, which can be
+ * configured using {@link Application#newConverterLocator()}.
  * 
  * @see ConverterLocator
  * @see IConverterLocatorFactory

Modified: incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Session.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Session.java?view=diff&rev=544015&r1=544014&r2=544015
==============================================================================
--- incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Session.java (original)
+++ incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Session.java Sun Jun  3 17:13:59 2007
@@ -36,7 +36,6 @@
 import org.apache.wicket.feedback.IFeedbackMessageFilter;
 import org.apache.wicket.request.ClientInfo;
 import org.apache.wicket.session.ISessionStore;
-import org.apache.wicket.util.convert.IConverter;
 import org.apache.wicket.util.lang.Objects;
 import org.apache.wicket.util.string.Strings;
 import org.apache.wicket.util.time.Duration;
@@ -121,7 +120,7 @@
  * @author Eelco Hillenius
  * @author Igor Vaynberg (ivaynberg)
  */
-public abstract class Session implements IClusterable, IConverterLocator
+public abstract class Session implements IClusterable
 {
 	/**
 	 * Visitor interface for visiting page maps
@@ -324,9 +323,6 @@
 	 */
 	private ClientInfo clientInfo;
 
-	/** The converter instance. */
-	private transient IConverterLocator converterSupplier;
-
 	/** True if session state has been changed */
 	private transient boolean dirty = false;
 
@@ -556,28 +552,6 @@
 			this.clientInfo = RequestCycle.get().newClientInfo();
 		}
 		return clientInfo;
-	}
-
-	/**
-	 * Gets the converter instance. This method returns the cached converter for
-	 * the current locale. Whenever the locale is changed, the cached value is
-	 * cleared and the converter will be recreated for the new locale on a next
-	 * request.
-	 * 
-	 * @param type
-	 *            TODO
-	 * 
-	 * @return the converter
-	 */
-	public final IConverter getConverter(Class/* <?> */type)
-	{
-		if (converterSupplier == null)
-		{
-			// Let the factory create a new converter
-			converterSupplier = getApplication().getApplicationSettings()
-					.getConverterLocatorFactory().newConverterLocator();
-		}
-		return converterSupplier.getConverter(type);
 	}
 
 	/**

Modified: incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/resolver/AutoComponentResolver.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/resolver/AutoComponentResolver.java?view=diff&rev=544015&r1=544014&r2=544015
==============================================================================
--- incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/resolver/AutoComponentResolver.java (original)
+++ incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/resolver/AutoComponentResolver.java Sun Jun  3 17:13:59 2007
@@ -187,39 +187,33 @@
 		}
 		catch (NoSuchMethodException e)
 		{
-			throw new MarkupException(
-					"Unable to create Component from wicket tag: Cause: "
-							+ e.getMessage());
+			throw new MarkupException("Unable to create Component from wicket tag: Cause: "
+					+ e.getMessage());
 		}
 		catch (InvocationTargetException e)
 		{
-			throw new MarkupException(
-					"Unable to create Component from wicket tag: Cause: "
-							+ e.getMessage());
+			throw new MarkupException("Unable to create Component from wicket tag: Cause: "
+					+ e.getMessage());
 		}
 		catch (IllegalAccessException e)
 		{
-			throw new MarkupException(
-					"Unable to create Component from wicket tag: Cause: "
-							+ e.getMessage());
+			throw new MarkupException("Unable to create Component from wicket tag: Cause: "
+					+ e.getMessage());
 		}
 		catch (InstantiationException e)
 		{
-			throw new MarkupException(
-					"Unable to create Component from wicket tag: Cause: "
-							+ e.getMessage());
+			throw new MarkupException("Unable to create Component from wicket tag: Cause: "
+					+ e.getMessage());
 		}
 		catch (ClassCastException e)
 		{
-			throw new MarkupException(
-					"Unable to create Component from wicket tag: Cause: "
-							+ e.getMessage());
+			throw new MarkupException("Unable to create Component from wicket tag: Cause: "
+					+ e.getMessage());
 		}
 		catch (SecurityException e)
 		{
-			throw new MarkupException(
-					"Unable to create Component from wicket tag: Cause: "
-							+ e.getMessage());
+			throw new MarkupException("Unable to create Component from wicket tag: Cause: "
+					+ e.getMessage());
 		}
 
 		// Get all remaining attributes and invoke the component's setters
@@ -292,8 +286,8 @@
 		final Class paramClass = parameterClasses[0];
 		try
 		{
-			final IConverter converter = Application.get().getApplicationSettings()
-					.getConverterLocatorFactory().newConverterLocator().getConverter(paramClass);
+			final IConverter converter = Application.get().getConverterLocator().getConverter(
+					paramClass);
 			final Object param = converter.convertToObject(value, locale);
 			if (param == null)
 			{

Modified: incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/model/AbstractPropertyModel.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/model/AbstractPropertyModel.java?view=diff&rev=544015&r1=544014&r2=544015
==============================================================================
--- incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/model/AbstractPropertyModel.java (original)
+++ incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/model/AbstractPropertyModel.java Sun Jun  3 17:13:59 2007
@@ -16,6 +16,7 @@
  */
 package org.apache.wicket.model;
 
+import org.apache.wicket.Application;
 import org.apache.wicket.Component;
 import org.apache.wicket.Session;
 import org.apache.wicket.util.lang.PropertyResolver;
@@ -142,7 +143,8 @@
 		else
 		{
 			PropertyResolverConverter prc = null;
-			prc = new PropertyResolverConverter(Session.get(), Session.get().getLocale());
+			prc = new PropertyResolverConverter(Application.get().getConverterLocator(), Session
+					.get().getLocale());
 			PropertyResolver.setValue(expression, getTarget(), object, prc);
 		}
 	}
@@ -191,7 +193,7 @@
 		}
 		return null;
 	}
-	
+
 	/**
 	 * @return The property expression for the component
 	 */

Modified: incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/settings/IApplicationSettings.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/settings/IApplicationSettings.java?view=diff&rev=544015&r1=544014&r2=544015
==============================================================================
--- incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/settings/IApplicationSettings.java (original)
+++ incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/settings/IApplicationSettings.java Sun Jun  3 17:13:59 2007
@@ -17,7 +17,6 @@
 package org.apache.wicket.settings;
 
 import org.apache.wicket.application.IClassResolver;
-import org.apache.wicket.util.convert.IConverterLocatorFactory;
 
 /**
  * Settings interface for application settings.
@@ -53,13 +52,6 @@
 	IClassResolver getClassResolver();
 
 	/**
-	 * Gets the converter locator factory.
-	 * 
-	 * @return the converter locator factory
-	 */
-	IConverterLocatorFactory getConverterLocatorFactory();
-
-	/**
 	 * Gets internal error page class.
 	 * 
 	 * @return Returns the internalErrorPage.
@@ -91,13 +83,6 @@
 	 *            The default class resolver
 	 */
 	void setClassResolver(final IClassResolver defaultClassResolver);
-
-	/**
-	 * Sets the CoverterLocatorFactory
-	 * 
-	 * @param factory
-	 */
-	public void setConverterLocatorFactory(IConverterLocatorFactory factory);
 
 	/**
 	 * Sets internal error page class. The class must be bookmarkable and must

Modified: incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/settings/Settings.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/settings/Settings.java?view=diff&rev=544015&r1=544014&r2=544015
==============================================================================
--- incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/settings/Settings.java (original)
+++ incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/settings/Settings.java Sun Jun  3 17:13:59 2007
@@ -49,8 +49,6 @@
 import org.apache.wicket.session.DefaultPageFactory;
 import org.apache.wicket.session.pagemap.IPageMapEvictionStrategy;
 import org.apache.wicket.session.pagemap.LeastRecentlyAccessedEvictionStrategy;
-import org.apache.wicket.util.convert.ConverterLocatorFactory;
-import org.apache.wicket.util.convert.IConverterLocatorFactory;
 import org.apache.wicket.util.crypt.CachingSunJceCryptFactory;
 import org.apache.wicket.util.crypt.ICryptFactory;
 import org.apache.wicket.util.file.IResourceFinder;
@@ -125,8 +123,6 @@
 	/** True if multiple tabs/spaces should be compressed to a single space */
 	private boolean compressWhitespace = false;
 
-	private IConverterLocatorFactory converterLocatorFactory;
-
 	/** Default values for persistence of form data (by means of cookies) */
 	private CookieValuePersisterSettings cookieValuePersisterSettings = new CookieValuePersisterSettings();
 
@@ -446,18 +442,6 @@
 	{
 		return compressWhitespace;
 	}
-	
-	/**
-	 * @see org.apache.wicket.settings.IApplicationSettings#getConverterLocatorFactory()
-	 */
-	public IConverterLocatorFactory getConverterLocatorFactory()
-	{
-		if (converterLocatorFactory == null)
-		{
-			converterLocatorFactory = new ConverterLocatorFactory();
-		}
-		return converterLocatorFactory;
-	}
 
 	/**
 	 * @see org.apache.wicket.settings.ISecuritySettings#getCookieValuePersisterSettings()
@@ -879,18 +863,6 @@
 	public void setCompressWhitespace(final boolean compressWhitespace)
 	{
 		this.compressWhitespace = compressWhitespace;
-	}
-
-	/**
-	 * @see org.apache.wicket.settings.IApplicationSettings#setConverterLocatorFactory(org.apache.wicket.util.convert.IConverterLocatorFactory)
-	 */
-	public void setConverterLocatorFactory(IConverterLocatorFactory factory)
-	{
-		if (factory == null)
-		{
-			throw new IllegalArgumentException("converter factory cannot be set to null");
-		}
-		this.converterLocatorFactory = factory;
 	}
 
 	/**

Modified: incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/util/lang/PropertyResolver.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/util/lang/PropertyResolver.java?view=diff&rev=544015&r1=544014&r2=544015
==============================================================================
--- incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/util/lang/PropertyResolver.java (original)
+++ incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/util/lang/PropertyResolver.java Sun Jun  3 17:13:59 2007
@@ -23,6 +23,7 @@
 import java.util.List;
 import java.util.Map;
 
+import org.apache.wicket.Application;
 import org.apache.wicket.Session;
 import org.apache.wicket.WicketRuntimeException;
 import org.apache.wicket.util.concurrent.ConcurrentHashMap;
@@ -53,7 +54,7 @@
  * <p>
  * Index or map properties can also be written as: "property[index]" or
  * "property[key]" <p/>
- *
+ * 
  * @author jcompagner
  */
 public final class PropertyResolver
@@ -67,7 +68,7 @@
 	 * Looksup the value from the object with the given expression. If the
 	 * expresion, the object itself or one property evalutes to null then a null
 	 * will be returned.
-	 *
+	 * 
 	 * @param expression
 	 *            The expression string with the property to be lookup.
 	 * @param object
@@ -96,10 +97,10 @@
 	 * can't be evaluated then a WicketRuntimeException will be thrown. If a
 	 * null object is encounted then it will try to generate it by calling the
 	 * default constructor and set it on the object.
-	 *
+	 * 
 	 * The value will be tried to convert to the right type with the given
 	 * converter.
-	 *
+	 * 
 	 * @param expression
 	 *            The expression string with the property to be set.
 	 * @param object
@@ -130,10 +131,10 @@
 			throw new WicketRuntimeException("Null object returned for expression: " + expression
 					+ " for setting value: " + value + " on: " + object);
 		}
-		setter.setValue(value, converter == null ? new PropertyResolverConverter(Session.get(),
-				Session.get().getLocale()) : converter);
+		setter.setValue(value, converter == null ? new PropertyResolverConverter(Application.get()
+				.getConverterLocator(), Session.get().getLocale()) : converter);
 	}
-	
+
 	/**
 	 * @param expression
 	 * @param object
@@ -153,7 +154,8 @@
 	private static ObjectAndGetSetter getObjectAndGetSetter(final String expression,
 			final Object object, boolean tryToCreateNull)
 	{
-		final String expressionBracketsSeperated = Strings.replaceAll(expression, "[", ".[").toString();
+		final String expressionBracketsSeperated = Strings.replaceAll(expression, "[", ".[")
+				.toString();
 		int index = expressionBracketsSeperated.indexOf('.');
 		int lastIndex = 0;
 		Object value = object;
@@ -267,7 +269,8 @@
 						else
 						{
 							throw new WicketRuntimeException("The expression '" + exp
-									+ "' is neither an index nor is it a method for the list " + clz);
+									+ "' is neither an index nor is it a method for the list "
+									+ clz);
 						}
 					}
 				}
@@ -298,7 +301,7 @@
 				else
 				{
 					field = findField(clz, exp);
-					if(field == null)
+					if (field == null)
 					{
 						method = findMethod(clz, exp);
 						if (method == null)
@@ -324,17 +327,19 @@
 								catch (Exception e)
 								{
 									throw new WicketRuntimeException(
-											"no get method defined for class: " + clz + " expression: "
-													+ propertyName);
+											"no get method defined for class: " + clz
+													+ " expression: " + propertyName);
 								}
 							}
 							else
 							{
-								// We do not look for a public FIELD because that is
+								// We do not look for a public FIELD because
+								// that is
 								// not good
 								// programming with beans patterns
-								throw new WicketRuntimeException("No get method defined for class: "
-										+ clz + " expression: " + exp);
+								throw new WicketRuntimeException(
+										"No get method defined for class: " + clz + " expression: "
+												+ exp);
 							}
 						}
 						else
@@ -373,12 +378,12 @@
 		catch (Exception e)
 		{
 			Class tmp = clz;
-			while(tmp != null && tmp != Object.class)
+			while (tmp != null && tmp != Object.class)
 			{
 				Field[] fields = tmp.getDeclaredFields();
 				for (int i = 0; i < fields.length; i++)
 				{
-					if(fields[i].getName().equals(expression))
+					if (fields[i].getName().equals(expression))
 					{
 						fields[i].setAccessible(true);
 						return fields[i];
@@ -442,12 +447,13 @@
 	/**
 	 * Utility class: instantiation not allowed.
 	 */
-	private PropertyResolver() {
+	private PropertyResolver()
+	{
 	}
 
 	/**
 	 * @author jcompagner
-	 *
+	 * 
 	 */
 	private final static class ObjectAndGetSetter
 	{
@@ -481,9 +487,9 @@
 		{
 			return getAndSetter.getValue(value);
 		}
-		
+
 		public Class getTargetClass()
-		{	
+		{
 			return getAndSetter.getTargetClass(this.value);
 		}
 
@@ -495,7 +501,7 @@
 		/**
 		 * @param object
 		 *            The object where the value must be taken from.
-		 *
+		 * 
 		 * @return The value of this property
 		 */
 		public Object getValue(final Object object);
@@ -508,7 +514,7 @@
 		/**
 		 * @param object
 		 *            The object where the new value must be set on.
-		 *
+		 * 
 		 * @return The new value for the property that is set back on that
 		 *         object.
 		 */
@@ -519,7 +525,8 @@
 		 * @param value
 		 * @param converter
 		 */
-		public void setValue(final Object object, final Object value, PropertyResolverConverter converter);
+		public void setValue(final Object object, final Object value,
+				PropertyResolverConverter converter);
 
 	}
 
@@ -558,7 +565,7 @@
 			// map and try to make one of the class if finds?
 			return null;
 		}
-		
+
 		/**
 		 * @see org.apache.wicket.util.lang.PropertyResolver.IGetAndSet#getTargetClass(Object)
 		 */
@@ -620,7 +627,7 @@
 			// list and try to make one of the class if finds?
 			return null;
 		}
-		
+
 		/**
 		 * @see org.apache.wicket.util.lang.PropertyResolver.IGetAndSet#getTargetClass(Object)
 		 */
@@ -676,7 +683,7 @@
 			}
 			return value;
 		}
-		
+
 		/**
 		 * @see org.apache.wicket.util.lang.PropertyResolver.IGetAndSet#getTargetClass(Object)
 		 */
@@ -716,7 +723,7 @@
 		{
 			throw new WicketRuntimeException("Cant get a new value from a length of an array");
 		}
-		
+
 		/**
 		 * @see org.apache.wicket.util.lang.PropertyResolver.IGetAndSet#getTargetClass(java.lang.Object)
 		 */
@@ -815,7 +822,7 @@
 						+ " on object: " + object);
 			}
 		}
-		
+
 		/**
 		 * @see org.apache.wicket.util.lang.PropertyResolver.IGetAndSet#getTargetClass(java.lang.Object)
 		 */
@@ -894,7 +901,8 @@
 		 * @param value
 		 * @param converter
 		 */
-		public final void setValue(final Object object, final Object value, PropertyResolverConverter converter)
+		public final void setValue(final Object object, final Object value,
+				PropertyResolverConverter converter)
 		{
 			if (setMethod == null)
 			{
@@ -903,17 +911,20 @@
 			if (setMethod != null)
 			{
 				Object converted = converter.convert(value, getMethod.getReturnType());
-				if ( converted == null)
+				if (converted == null)
 				{
-					if( value != null )
+					if (value != null)
 					{
-						throw new ConversionException("Can't convert value: " + value + " to class: "
-								+ getMethod.getReturnType() + " for setting it on " + object);
+						throw new ConversionException("Can't convert value: " + value
+								+ " to class: " + getMethod.getReturnType() + " for setting it on "
+								+ object);
 					}
-					else if( getMethod.getReturnType().isPrimitive() )
+					else if (getMethod.getReturnType().isPrimitive())
 					{
-						throw new ConversionException("Can't convert null value to a primitive class: "
-								+ getMethod.getReturnType() + " for setting it on " + object);
+						throw new ConversionException(
+								"Can't convert null value to a primitive class: "
+										+ getMethod.getReturnType() + " for setting it on "
+										+ object);
 					}
 				}
 				try
@@ -1014,7 +1025,7 @@
 
 		/**
 		 * Construct.
-		 *
+		 * 
 		 * @param field
 		 */
 		public FieldGetAndSetter(Field field)
@@ -1076,7 +1087,7 @@
 						+ " on object " + object + ", value " + value, ex);
 			}
 		}
-		
+
 		/**
 		 * @see org.apache.wicket.util.lang.PropertyResolver.IGetAndSet#getTargetClass(java.lang.Object)
 		 */

Modified: incubator/wicket/trunk/jdk-1.5/wicket-jmx/src/main/java/org/apache/wicket/jmx/ApplicationSettings.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.5/wicket-jmx/src/main/java/org/apache/wicket/jmx/ApplicationSettings.java?view=diff&rev=544015&r1=544014&r2=544015
==============================================================================
--- incubator/wicket/trunk/jdk-1.5/wicket-jmx/src/main/java/org/apache/wicket/jmx/ApplicationSettings.java (original)
+++ incubator/wicket/trunk/jdk-1.5/wicket-jmx/src/main/java/org/apache/wicket/jmx/ApplicationSettings.java Sun Jun  3 17:13:59 2007
@@ -54,14 +54,6 @@
 	}
 
 	/**
-	 * @see org.apache.wicket.jmx.ApplicationSettingsMBean#getConverterFactory()
-	 */
-	public String getConverterLocatorFactory()
-	{
-		return Stringz.className(application.getApplicationSettings().getConverterLocatorFactory());
-	}
-
-	/**
 	 * @see org.apache.wicket.jmx.ApplicationSettingsMBean#getInternalErrorPage()
 	 */
 	public String getInternalErrorPage()

Modified: incubator/wicket/trunk/jdk-1.5/wicket-jmx/src/main/java/org/apache/wicket/jmx/ApplicationSettingsMBean.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.5/wicket-jmx/src/main/java/org/apache/wicket/jmx/ApplicationSettingsMBean.java?view=diff&rev=544015&r1=544014&r2=544015
==============================================================================
--- incubator/wicket/trunk/jdk-1.5/wicket-jmx/src/main/java/org/apache/wicket/jmx/ApplicationSettingsMBean.java (original)
+++ incubator/wicket/trunk/jdk-1.5/wicket-jmx/src/main/java/org/apache/wicket/jmx/ApplicationSettingsMBean.java Sun Jun  3 17:13:59 2007
@@ -41,13 +41,6 @@
 	String getClassResolver();
 
 	/**
-	 * Gets the converter factory.
-	 * 
-	 * @return the converter factory
-	 */
-	String getConverterLocatorFactory();
-
-	/**
 	 * Gets internal error page class.
 	 * 
 	 * @return Returns the internalErrorPage.



Re: svn commit: r544015 - in /incubator/wicket/trunk: jdk-1.4/wicket/src/main/java/org/apache/wicket/ jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/resolver/ jdk-1.4/wicket/src/main/java/org/apache/wicket/model/ jdk-1.4/wicket/src/main/java/org/apa...

Posted by Jean-Baptiste Quenot <jb...@apache.org>.
* ehillenius@apache.org:
> Author: ehillenius
> Date: Sun Jun  3 17:13:59 2007
> New Revision: 544015
> 
> URL: http://svn.apache.org/viewvc?view=rev&rev=544015
> Log:
> simplified converterlocators by removing IConverterLocatorFactoryLocatorFactoryFactory.
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Indeed, that seems to be a very complex interface, looking at its
name!!!  ;-) ;-)
-- 
     Jean-Baptiste Quenot
aka  John Banana   Qwerty
http://caraldi.com/jbq/