package main.java;

//holds business logic behind the exporter
public class ExporterCore {
	private String format;
	private int limit;
	private int maxTime;
	private boolean stream;

	private final String[] supportedFormats = { "gexfl", "graphml", "graphson" };

	public ExporterCore() {
	}

	public String getFormat() {
		return format;
	}

	public void setFormat(String format) throws Exception {
		String lowercaseFormat = format.toLowerCase();
		// check wether the format is supported or not
		for (String supported : supportedFormats) {
			if (lowercaseFormat == supported) {
				this.format = lowercaseFormat;
				break;
			}
		}
		if (this.format == null) {
			throw new Exception("Format not supported: " + format);
		}
	}

	public int getLimit() {
		return limit;
	}

	public void setLimit(int limit) {
		this.limit = limit;
	}

	public void setLimit(String limit) {
		// convert to integer
	}

	public int getMaxTime() {
		return maxTime;
	}

	public void setMaxTime(int maxTime) {
		this.maxTime = maxTime;
	}

	public void setMaxTime(String maxTime) {
		// convert to integer
	}

	public boolean isStream() {
		return stream;
	}

	public void setStream(boolean stream) {
		this.stream = stream;
	}

	public void setStream(String stream) {
		// convert to boolean
	}

}

@@ -872,37 +872,50 @@
 it) %7B%0A%09%09
-// convert to integer
+setLimit(Integer.parseInt(limit));
 %0A%09%7D%0A%0A%09pu
@@ -1077,29 +1077,46 @@
 %7B%0A%09%09
-// convert to integer
+setMaxTime(Integer.parseInt(maxTime));
 %0A%09%7D%0A
@@ -1277,33 +1277,283 @@
 am) 
-%7B%0A%09%09// convert to boolean
+throws Exception %7B%0A%09%09String lowercaseStream = stream.toLowerCase();%0A%09%09if (lowercaseStream.equals(%22yes%22)) %7B%0A%09%09%09this.stream = true;%0A%09%09%7D else if (lowercaseStream.equals(%22no%22)) %7B%0A%09%09%09this.stream = false;%0A%09%09%7D else %7B%0A%09%09%09throw new Exception(%22Stream flag requires 'yes' or 'no'%22);%0A%09%09%7D
 %0A%09%7D%0A

Improve getters and setters on ExporterCore