001    package org.picocontainer.converters;
002    
003    import org.picocontainer.PicoCompositionException;
004    
005    import java.net.MalformedURLException;
006    import java.net.URL;
007    
008    /**
009     * Converts values to URL data type objects
010     * 
011     * @author Paul Hammant
012     * @author Michael Rimov
013     */
014    public class UrlConverter implements Converter<URL> {
015    
016        public URL convert(String paramValue) {
017            try {
018                return new URL(paramValue);
019            } catch (MalformedURLException e) {
020                throw new PicoCompositionException(e);
021            }
022        }
023    }