package com.github.aureliano.defero.config;

import java.util.ArrayList;
import java.util.List;

import com.github.aureliano.defero.config.input.IConfigInput;
import com.github.aureliano.defero.config.output.IConfigOutput;
import com.github.aureliano.defero.filter.IEventFielter;
import com.github.aureliano.defero.formatter.IOutputFormatter;
import com.github.aureliano.defero.listener.DataReadingListener;
import com.github.aureliano.defero.listener.DataWritingListener;
import com.github.aureliano.defero.parser.IParser;

public class EventCollectorConfiguration {

	private IConfigInput inputConfig;
	private IConfigOutput outputConfig;
	private IParser<?> parser;
	private IEventFielter filter;
	private IOutputFormatter outputFormatter;
	private List<DataReadingListener> dataReadingListeners;
	private List<DataWritingListener> dataWritingListeners;
	
	public EventCollectorConfiguration() {
		this.dataReadingListeners = new ArrayList<DataReadingListener>();
		this.dataWritingListeners = new ArrayList<DataWritingListener>();
	}

	public IConfigInput getInputConfig() {
		return inputConfig;
	}

	public EventCollectorConfiguration withInputConfig(IConfigInput inputConfig) {
		this.inputConfig = inputConfig;
		return this;
	}
	
	public IConfigOutput getOutputConfig() {
		return outputConfig;
	}
	
	public EventCollectorConfiguration withOutputConfig(IConfigOutput outputConfig) {
		this.outputConfig = outputConfig;
		return this;
	}

	public IParser<?> getParser() {
		return parser;
	}

	public EventCollectorConfiguration withParser(IParser<?> parser) {
		this.parser = parser;
		return this;
	}
	
	public IEventFielter getFilter() {
		return filter;
	}
	
	public EventCollectorConfiguration withFilter(IEventFielter filter) {
		this.filter = filter;
		return this;
	}
	
	public IOutputFormatter getOutputFormatter() {
		return outputFormatter;
	}
	
	public EventCollectorConfiguration withOutputFormatter(IOutputFormatter outputFormatter) {
		this.outputFormatter = outputFormatter;
		return this;
	}

	public List<DataReadingListener> getDataReadingListeners() {
		return dataReadingListeners;
	}

	public EventCollectorConfiguration withDataReadingListeners(List<DataReadingListener> dataReadingListeners) {
		this.dataReadingListeners = dataReadingListeners;
		return this;
	}
	
	public EventCollectorConfiguration addDataReadingListeners(DataReadingListener listener) {
		this.dataReadingListeners.add(listener);
		return this;
	}
	
	public List<DataWritingListener> getDataWritingListeners() {
		return dataWritingListeners;
	}
	
	public EventCollectorConfiguration withDataWritingListeners(List<DataWritingListener> dataWritingListeners) {
		this.dataWritingListeners = dataWritingListeners;
		return this;
	}
	
	public EventCollectorConfiguration addDataWritingListeners(DataWritingListener listener) {
		this.dataWritingListeners.add(listener);
		return this;
	}
}
@@ -198,28 +198,168 @@
 fig.
-output.IConfigOutput
+input.StandardInputConfig;%0Aimport com.github.aureliano.defero.config.output.IConfigOutput;%0Aimport com.github.aureliano.defero.config.output.StandardOutputConfig
 ;%0Aim
@@ -656,16 +656,75 @@
 IParser;
+%0Aimport com.github.aureliano.defero.parser.PlainTextParser;
 %0A%0Apublic
@@ -1051,16 +1051,16 @@
 ners;%0A%09%0A
-
 %09public 
@@ -1087,24 +1087,164 @@
 uration() %7B%0A
+%09%09this.inputConfig = new StandardInputConfig();%0A%09%09this.outputConfig = new StandardOutputConfig();%0A%09%09this.parser = new PlainTextParser();%0A%09%09%0A
 %09%09this.dataR

Configure defaults