Author: niallp Date: Sat Mar 13 13:50:46 2010 New Revision: 922570 URL: http://svn.apache.org/viewvc?rev=922570&view=rev Log: Set eol-style to native
Modified: commons/sandbox/convert/trunk/src/java/org/apache/commons/convert/GenericSingletonToList.java (contents, props changed) commons/sandbox/convert/trunk/src/java/org/apache/commons/convert/GenericSingletonToSet.java (contents, props changed) commons/sandbox/convert/trunk/src/java/org/apache/commons/convert/NetConverters.java (contents, props changed) Modified: commons/sandbox/convert/trunk/src/java/org/apache/commons/convert/GenericSingletonToList.java URL: http://svn.apache.org/viewvc/commons/sandbox/convert/trunk/src/java/org/apache/commons/convert/GenericSingletonToList.java?rev=922570&r1=922569&r2=922570&view=diff ============================================================================== --- commons/sandbox/convert/trunk/src/java/org/apache/commons/convert/GenericSingletonToList.java (original) +++ commons/sandbox/convert/trunk/src/java/org/apache/commons/convert/GenericSingletonToList.java Sat Mar 13 13:50:46 2010 @@ -1,34 +1,34 @@ -/******************************************************************************* - * 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 org.apache.commons.convert; - -import java.util.ArrayList; -import java.util.List; - -public class GenericSingletonToList<T> extends AbstractConverter<T, List<T>> { - public GenericSingletonToList(Class<T> sourceClass) { - super(sourceClass, List.class); - } - - public List<T> convert(T obj) throws ConversionException { - List<T> tempList = new ArrayList<T>(); - tempList.add(obj); - return tempList; - } -} +/******************************************************************************* + * 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 org.apache.commons.convert; + +import java.util.ArrayList; +import java.util.List; + +public class GenericSingletonToList<T> extends AbstractConverter<T, List<T>> { + public GenericSingletonToList(Class<T> sourceClass) { + super(sourceClass, List.class); + } + + public List<T> convert(T obj) throws ConversionException { + List<T> tempList = new ArrayList<T>(); + tempList.add(obj); + return tempList; + } +} Propchange: commons/sandbox/convert/trunk/src/java/org/apache/commons/convert/GenericSingletonToList.java ------------------------------------------------------------------------------ svn:eol-style = native Modified: commons/sandbox/convert/trunk/src/java/org/apache/commons/convert/GenericSingletonToSet.java URL: http://svn.apache.org/viewvc/commons/sandbox/convert/trunk/src/java/org/apache/commons/convert/GenericSingletonToSet.java?rev=922570&r1=922569&r2=922570&view=diff ============================================================================== --- commons/sandbox/convert/trunk/src/java/org/apache/commons/convert/GenericSingletonToSet.java (original) +++ commons/sandbox/convert/trunk/src/java/org/apache/commons/convert/GenericSingletonToSet.java Sat Mar 13 13:50:46 2010 @@ -1,34 +1,34 @@ -/******************************************************************************* - * 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 org.apache.commons.convert; - -import java.util.HashSet; -import java.util.Set; - -public class GenericSingletonToSet<T> extends AbstractConverter<T, Set<T>> { - public GenericSingletonToSet(Class<T> sourceClass) { - super(sourceClass, Set.class); - } - - public Set<T> convert(T obj) throws ConversionException { - Set<T> tempSet = new HashSet<T>(); - tempSet.add(obj); - return tempSet; - } -} +/******************************************************************************* + * 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 org.apache.commons.convert; + +import java.util.HashSet; +import java.util.Set; + +public class GenericSingletonToSet<T> extends AbstractConverter<T, Set<T>> { + public GenericSingletonToSet(Class<T> sourceClass) { + super(sourceClass, Set.class); + } + + public Set<T> convert(T obj) throws ConversionException { + Set<T> tempSet = new HashSet<T>(); + tempSet.add(obj); + return tempSet; + } +} Propchange: commons/sandbox/convert/trunk/src/java/org/apache/commons/convert/GenericSingletonToSet.java ------------------------------------------------------------------------------ svn:eol-style = native Modified: commons/sandbox/convert/trunk/src/java/org/apache/commons/convert/NetConverters.java URL: http://svn.apache.org/viewvc/commons/sandbox/convert/trunk/src/java/org/apache/commons/convert/NetConverters.java?rev=922570&r1=922569&r2=922570&view=diff ============================================================================== --- commons/sandbox/convert/trunk/src/java/org/apache/commons/convert/NetConverters.java (original) +++ commons/sandbox/convert/trunk/src/java/org/apache/commons/convert/NetConverters.java Sat Mar 13 13:50:46 2010 @@ -1,137 +1,137 @@ -/******************************************************************************* - * 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 org.apache.commons.convert; - -import java.io.IOException; -import java.net.InetAddress; -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URL; - -/** Net Converter classes. */ -public class NetConverters implements ConverterLoader { - public static final String module = NetConverters.class.getName(); - - public static class StringToInetAddress extends AbstractConverter<String, InetAddress> { - public StringToInetAddress() { - super(String.class, InetAddress.class); - } - - public InetAddress convert(String obj) throws ConversionException { - try { - return InetAddress.getByName(obj); - } catch (IOException e) { - throw (ConversionException) new ConversionException(e.getMessage()).initCause(e); - } - } - } - - public static class InetAddressToString extends AbstractConverter<InetAddress, String> { - public InetAddressToString() { - super(InetAddress.class, String.class); - } - - public String convert(InetAddress obj) throws ConversionException { - String hostName = obj.getHostName(); - if (hostName != null) return hostName; - return obj.getHostAddress(); - } - } - - public static class StringToURI extends AbstractConverter<String, URI> { - public StringToURI() { - super(String.class, URI.class); - } - - public URI convert(String obj) throws ConversionException { - try { - return new URI(obj); - } catch (URISyntaxException e) { - throw (ConversionException) new ConversionException(e.getMessage()).initCause(e); - } - } - } - - public static class URIToString extends AbstractConverter<URI, String> { - public URIToString() { - super(URI.class, String.class); - } - - public String convert(URI obj) throws ConversionException { - return obj.toString(); - } - } - - public static class StringToURL extends AbstractConverter<String, URL> { - public StringToURL() { - super(String.class, URL.class); - } - - public URL convert(String obj) throws ConversionException { - try { - return new URL(obj); - } catch (MalformedURLException e) { - throw (ConversionException) new ConversionException(e.getMessage()).initCause(e); - } - } - } - - public static class URLToString extends AbstractConverter<URL, String> { - public URLToString() { - super(URL.class, String.class); - } - - public String convert(URL obj) throws ConversionException { - return obj.toString(); - } - } - - public static class URIToURL extends AbstractConverter<URI, URL> { - public URIToURL() { - super(URI.class, URL.class); - } - - public URL convert(URI obj) throws ConversionException { - try { - return obj.toURL(); - } catch (MalformedURLException e) { - throw (ConversionException) new ConversionException(e.getMessage()).initCause(e); - } - } - } - - public static class URLToURI extends AbstractConverter<URL, URI> { - public URLToURI() { - super(URL.class, URI.class); - } - - public URI convert(URL obj) throws ConversionException { - try { - return obj.toURI(); - } catch (URISyntaxException e) { - throw (ConversionException) new ConversionException(e.getMessage()).initCause(e); - } - } - } - - public void loadConverters() { - Converters.loadContainedConverters(NetConverters.class); - } -} +/******************************************************************************* + * 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 org.apache.commons.convert; + +import java.io.IOException; +import java.net.InetAddress; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; + +/** Net Converter classes. */ +public class NetConverters implements ConverterLoader { + public static final String module = NetConverters.class.getName(); + + public static class StringToInetAddress extends AbstractConverter<String, InetAddress> { + public StringToInetAddress() { + super(String.class, InetAddress.class); + } + + public InetAddress convert(String obj) throws ConversionException { + try { + return InetAddress.getByName(obj); + } catch (IOException e) { + throw (ConversionException) new ConversionException(e.getMessage()).initCause(e); + } + } + } + + public static class InetAddressToString extends AbstractConverter<InetAddress, String> { + public InetAddressToString() { + super(InetAddress.class, String.class); + } + + public String convert(InetAddress obj) throws ConversionException { + String hostName = obj.getHostName(); + if (hostName != null) return hostName; + return obj.getHostAddress(); + } + } + + public static class StringToURI extends AbstractConverter<String, URI> { + public StringToURI() { + super(String.class, URI.class); + } + + public URI convert(String obj) throws ConversionException { + try { + return new URI(obj); + } catch (URISyntaxException e) { + throw (ConversionException) new ConversionException(e.getMessage()).initCause(e); + } + } + } + + public static class URIToString extends AbstractConverter<URI, String> { + public URIToString() { + super(URI.class, String.class); + } + + public String convert(URI obj) throws ConversionException { + return obj.toString(); + } + } + + public static class StringToURL extends AbstractConverter<String, URL> { + public StringToURL() { + super(String.class, URL.class); + } + + public URL convert(String obj) throws ConversionException { + try { + return new URL(obj); + } catch (MalformedURLException e) { + throw (ConversionException) new ConversionException(e.getMessage()).initCause(e); + } + } + } + + public static class URLToString extends AbstractConverter<URL, String> { + public URLToString() { + super(URL.class, String.class); + } + + public String convert(URL obj) throws ConversionException { + return obj.toString(); + } + } + + public static class URIToURL extends AbstractConverter<URI, URL> { + public URIToURL() { + super(URI.class, URL.class); + } + + public URL convert(URI obj) throws ConversionException { + try { + return obj.toURL(); + } catch (MalformedURLException e) { + throw (ConversionException) new ConversionException(e.getMessage()).initCause(e); + } + } + } + + public static class URLToURI extends AbstractConverter<URL, URI> { + public URLToURI() { + super(URL.class, URI.class); + } + + public URI convert(URL obj) throws ConversionException { + try { + return obj.toURI(); + } catch (URISyntaxException e) { + throw (ConversionException) new ConversionException(e.getMessage()).initCause(e); + } + } + } + + public void loadConverters() { + Converters.loadContainedConverters(NetConverters.class); + } +} Propchange: commons/sandbox/convert/trunk/src/java/org/apache/commons/convert/NetConverters.java ------------------------------------------------------------------------------ svn:eol-style = native