Skip to content
Snippets Groups Projects
Commit 1a4d6ff3 authored by Richeeyyy's avatar Richeeyyy
Browse files

Get rid of jcommander dependency

parent ca3f79f4
No related branches found
No related tags found
1 merge request!11Feat/csv data importer overhaul
...@@ -40,8 +40,7 @@ dependencies { ...@@ -40,8 +40,7 @@ dependencies {
compile group: 'tec.units', name: 'unit-ri', version: '1.0.3' compile group: 'tec.units', name: 'unit-ri', version: '1.0.3'
compile "com.opencsv:opencsv:4.0" compile "com.opencsv:opencsv:4.0"
// https://mvnrepository.com/artifact/com.beust/jcommander
compile group: 'com.beust', name: 'jcommander', version: '1.64'
// https://mvnrepository.com/artifact/org.slf4j/slf4j-api // https://mvnrepository.com/artifact/org.slf4j/slf4j-api
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.24' compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.24'
} }
......
package de.tudresden.inf.mci.brailleplot.csvparser; package de.tudresden.inf.mci.brailleplot.csvparser;
import com.beust.jcommander.IStringConverter;
/** /**
* Enumeration of the two possible CSV orientations. * Enumeration of the two possible CSV orientations.
*/ */
...@@ -25,13 +23,17 @@ public enum CsvOrientation { ...@@ -25,13 +23,17 @@ public enum CsvOrientation {
/** /**
* Converter class that converts strings to CsvOrientation. * Converter class that converts strings to CsvOrientation.
*/ */
public static class CsvOrientationConverter implements IStringConverter<CsvOrientation> { public static class CsvOrientationConverter {
public CsvOrientationConverter() { public CsvOrientationConverter() {
super(); super();
} }
@Override /**
* Converts a String value into the corresponding CsvOrientation.
* @param value String
* @return CsvOrientation
*/
public CsvOrientation convert(final String value) { public CsvOrientation convert(final String value) {
CsvOrientation convertedValue = CsvOrientation.fromString(value); CsvOrientation convertedValue = CsvOrientation.fromString(value);
return convertedValue; return convertedValue;
......
package de.tudresden.inf.mci.brailleplot.csvparser; package de.tudresden.inf.mci.brailleplot.csvparser;
import com.beust.jcommander.IStringConverter;
/** /**
* Determines what data is represented how by the CSV file. The values are * Determines what data is represented how by the CSV file. The values are
* structural properties, whereas the {@link XType} held by every value * structural properties, whereas the {@link XType} held by every value
...@@ -39,13 +37,17 @@ public enum CsvType { ...@@ -39,13 +37,17 @@ public enum CsvType {
/** /**
* Converter class that converts strings to CsvType. * Converter class that converts strings to CsvType.
*/ */
public static class CsvTypeConverter implements IStringConverter<CsvType> { public static class CsvTypeConverter {
public CsvTypeConverter() { public CsvTypeConverter() {
super(); super();
} }
@Override /**
* Converts a String value into the corresponding CsvType.
* @param value String
* @return CsvType
*/
public CsvType convert(final String value) { public CsvType convert(final String value) {
CsvType convertedValue = CsvType.fromString(value); CsvType convertedValue = CsvType.fromString(value);
return convertedValue; return convertedValue;
......
...@@ -2,8 +2,6 @@ package de.tudresden.inf.mci.brailleplot.csvparser; ...@@ -2,8 +2,6 @@ package de.tudresden.inf.mci.brailleplot.csvparser;
import org.w3c.dom.Element; import org.w3c.dom.Element;
import com.beust.jcommander.IStringConverter;
/** /**
* A point in a coordinate system specified by an mX and mY coordinate. Can also * A point in a coordinate system specified by an mX and mY coordinate. Can also
...@@ -159,15 +157,15 @@ public class Point implements Comparable<Point> { ...@@ -159,15 +157,15 @@ public class Point implements Comparable<Point> {
* Converts a string value to the corresponding point object. * Converts a string value to the corresponding point object.
* *
*/ */
public static class Converter implements IStringConverter<Point> { public static class Converter {
/** /**
* Convert a formatted string to a point. The format is: * Convert a formatted string to a point. The format is:
* {@code [<mX>][,<mY>]} Omitted values will default to 0. * {@code [<mX>][,<mY>]} Omitted values will default to 0.
* *
* @param value * @param value
* | formatted string * | formatted string
* @return converted Range
*/ */
@Override
public Point convert(final String value) { public Point convert(final String value) {
String[] s = value.split(","); String[] s = value.split(",");
double x; double x;
......
...@@ -4,8 +4,6 @@ import java.util.ArrayList; ...@@ -4,8 +4,6 @@ import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import com.beust.jcommander.IStringConverter;
/** /**
* *
* @author Gregor Harlan, Jens Bornschein Idea and supervising by Jens * @author Gregor Harlan, Jens Bornschein Idea and supervising by Jens
...@@ -125,8 +123,13 @@ public class PointListList extends ArrayList<PointListList.PointList> { ...@@ -125,8 +123,13 @@ public class PointListList extends ArrayList<PointListList.PointList> {
/** /**
* Converts a string value to a corresponding PointListList. * Converts a string value to a corresponding PointListList.
*/ */
public static class Converter implements IStringConverter<PointListList> { public static class Converter {
@Override
/**
* Converts a String value into the corresponding PointListList.
* @param value String
* @return PointListList
*/
public PointListList convert(final String value) { public PointListList convert(final String value) {
return new PointListList(value); return new PointListList(value);
} }
...@@ -323,8 +326,13 @@ public class PointListList extends ArrayList<PointListList.PointList> { ...@@ -323,8 +326,13 @@ public class PointListList extends ArrayList<PointListList.PointList> {
/** /**
* Converts a string value to the corresponding PointList. * Converts a string value to the corresponding PointList.
*/ */
public class Converter implements IStringConverter<PointList> { public class Converter {
@Override
/**
* Converts a String value into the corresponding PointList.
* @param value String
* @return PointList
*/
public PointList convert(final String value) { public PointList convert(final String value) {
return new PointList(value.trim()); return new PointList(value.trim());
} }
......
package de.tudresden.inf.mci.brailleplot.csvparser; package de.tudresden.inf.mci.brailleplot.csvparser;
import com.beust.jcommander.IStringConverter;
/** /**
* *
* @author Gregor Harlan, Jens Bornschein * @author Gregor Harlan, Jens Bornschein
...@@ -56,7 +55,7 @@ public class Range { ...@@ -56,7 +55,7 @@ public class Range {
/** /**
* Converter class for parsing ranges mFrom strings. * Converter class for parsing ranges mFrom strings.
*/ */
public static class Converter implements IStringConverter<Range> { public static class Converter {
/** /**
* Converts a range specified by a string mTo a {@link Range} instance. * Converts a range specified by a string mTo a {@link Range} instance.
* The syntax is: {@code [["]<mName>["]::]<mFrom>:<mTo>[:<mName>]}. * The syntax is: {@code [["]<mName>["]::]<mFrom>:<mTo>[:<mName>]}.
...@@ -64,8 +63,8 @@ public class Range { ...@@ -64,8 +63,8 @@ public class Range {
* The mFrom and mTo parameters should be parsable as Double. * The mFrom and mTo parameters should be parsable as Double.
* *
* @param value | correctly formatted range string * @param value | correctly formatted range string
* @return converted Range
*/ */
@Override
public Range convert(final String value) { public Range convert(final String value) {
String[] parts = value.split("::"); String[] parts = value.split("::");
String[] s; String[] s;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment