java/parameter-lister/src/info/glogalcode/parameterLister/modules/XmlModule.java
author František Kučera <franta-hg@frantovo.cz>
Sat, 10 Sep 2016 23:08:58 +0200
changeset 22 91e52083f255
parent 21 java/parameter-lister/src/info/glogalcode/parameterLister/modules/TerminalModule.java@7d86d90e6e0e
child 23 4ad40aaed4bb
permissions -rw-r--r--
java: XML module skeleton
franta-hg@21
     1
package info.glogalcode.parameterLister.modules;
franta-hg@21
     2
franta-hg@21
     3
import info.glogalcode.parameterLister.OutputModule;
franta-hg@21
     4
import info.glogalcode.parameterLister.OutputModuleException;
franta-hg@21
     5
import java.io.OutputStream;
franta-hg@21
     6
import java.io.PrintWriter;
franta-hg@21
     7
import java.util.List;
franta-hg@21
     8
franta-hg@21
     9
/**
franta-hg@21
    10
 *
franta-hg@21
    11
 * @author Ing. František Kučera (frantovo.cz)
franta-hg@21
    12
 */
franta-hg@22
    13
public class XmlModule implements OutputModule {
franta-hg@21
    14
franta-hg@21
    15
	@Override
franta-hg@21
    16
	public void process(OutputStream output, List<String> parameters) throws OutputModuleException {
franta-hg@21
    17
		try (PrintWriter out = new PrintWriter(output)) {
franta-hg@21
    18
			for (String parameter : parameters) {
franta-hg@22
    19
				out.print("xml> ");
franta-hg@21
    20
				out.println(parameter);
franta-hg@21
    21
				out.flush();
franta-hg@21
    22
			}
franta-hg@21
    23
		}
franta-hg@21
    24
	}
franta-hg@21
    25
franta-hg@21
    26
}