summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTKlerx <timok@mail.upb.de>2015-03-13 10:01:51 +0100
committerTKlerx <timok@mail.upb.de>2015-03-13 10:01:51 +0100
commit495a006cacb2a62449b74474fc57ca2e1b37d85d (patch)
tree0335c7b586c95dd9d0a27e798a1bb436e56ee616
parent78c4431a617cc9d3c9561ef1b5f111febf15f720 (diff)
downloadplatform_external_jcommander-495a006cacb2a62449b74474fc57ca2e1b37d85d.tar.gz
platform_external_jcommander-495a006cacb2a62449b74474fc57ca2e1b37d85d.tar.bz2
platform_external_jcommander-495a006cacb2a62449b74474fc57ca2e1b37d85d.zip
Added default converters for Path, URI and URL
-rw-r--r--src/main/java/com/beust/jcommander/internal/DefaultConverterFactory.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/com/beust/jcommander/internal/DefaultConverterFactory.java b/src/main/java/com/beust/jcommander/internal/DefaultConverterFactory.java
index f98a111..2b8a10c 100644
--- a/src/main/java/com/beust/jcommander/internal/DefaultConverterFactory.java
+++ b/src/main/java/com/beust/jcommander/internal/DefaultConverterFactory.java
@@ -29,10 +29,16 @@ import com.beust.jcommander.converters.ISO8601DateConverter;
import com.beust.jcommander.converters.IntegerConverter;
import com.beust.jcommander.converters.LongConverter;
import com.beust.jcommander.converters.StringConverter;
+import com.beust.jcommander.converters.PathConverter;
+import com.beust.jcommander.converters.URIConverter;
+import com.beust.jcommander.converters.URLConverter;
import java.io.File;
import java.math.BigDecimal;
import java.util.Date;
+import java.net.URI;
+import java.net.URL;
+import java.nio.file.Path;
import java.util.Map;
public class DefaultConverterFactory implements IStringConverterFactory {
@@ -57,6 +63,9 @@ public class DefaultConverterFactory implements IStringConverterFactory {
m_classConverters.put(File.class, FileConverter.class);
m_classConverters.put(BigDecimal.class, BigDecimalConverter.class);
m_classConverters.put(Date.class, ISO8601DateConverter.class);
+ m_classConverters.put(Path.class, PathConverter.class);
+ m_classConverters.put(URI.class, URIConverter.class);
+ m_classConverters.put(URL.class, URLConverter.class);
}
public Class<? extends IStringConverter<?>> getConverter(Class forType) {