01: /* Copyright (c) 2001 - 2007 TOPP - www.openplans.org. All rights reserved.
02: * This code is licensed under the GPL 2.0 license, availible at the root
03: * application directory.
04: */
05: package org.geoserver.platform.util;
06:
07: import org.geotools.util.Version;
08: import java.beans.PropertyEditorManager;
09: import java.beans.PropertyEditorSupport;
10:
11: /**
12: * Property editor for the {@link Version} class.
13: * <p>
14: * Registering this property editor allows versions to be used in a spring
15: * context like:
16: * <pre>
17: * <code>
18: * <bean id="..." class="...">
19: * <constructor-arg value="1.0.0"/>
20: * <bean>
21: * </code>
22: * </pre>
23: * </p>
24: * @author Justin Deoliveira, The Open Planning Project, jdeolive@openplans.org
25: *
26: */
27: public class VersionPropertyEditor extends PropertyEditorSupport {
28: public void setAsText(String text) throws IllegalArgumentException {
29: setValue(new Version(text));
30: }
31: }
|