java/parameter-lister/src/info/glogalcode/parameterLister/modules/TerminalModule.java
author František Kučera <franta-hg@frantovo.cz>
Sun, 11 Sep 2016 19:52:26 +0200
changeset 28 bfef9f34e438
parent 21 7d86d90e6e0e
permissions -rw-r--r--
license: GNU GPL v3
franta-hg@28
     1
/**
franta-hg@28
     2
 * parameter-lister
franta-hg@28
     3
 * Copyright © 2015 František Kučera (frantovo.cz)
franta-hg@28
     4
 *
franta-hg@28
     5
 * This program is free software: you can redistribute it and/or modify
franta-hg@28
     6
 * it under the terms of the GNU General Public License as published by
franta-hg@28
     7
 * the Free Software Foundation, either version 3 of the License, or
franta-hg@28
     8
 * (at your option) any later version.
franta-hg@28
     9
 *
franta-hg@28
    10
 * This program is distributed in the hope that it will be useful,
franta-hg@28
    11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
franta-hg@28
    12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
franta-hg@28
    13
 * GNU General Public License for more details.
franta-hg@28
    14
 *
franta-hg@28
    15
 * You should have received a copy of the GNU General Public License
franta-hg@28
    16
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
franta-hg@28
    17
 */
franta-hg@21
    18
package info.glogalcode.parameterLister.modules;
franta-hg@21
    19
franta-hg@21
    20
import info.glogalcode.parameterLister.OutputModule;
franta-hg@21
    21
import info.glogalcode.parameterLister.OutputModuleException;
franta-hg@21
    22
import java.io.OutputStream;
franta-hg@21
    23
import java.io.PrintWriter;
franta-hg@21
    24
import java.util.List;
franta-hg@21
    25
franta-hg@21
    26
/**
franta-hg@21
    27
 *
franta-hg@21
    28
 * @author Ing. František Kučera (frantovo.cz)
franta-hg@21
    29
 */
franta-hg@21
    30
public class TerminalModule implements OutputModule {
franta-hg@21
    31
franta-hg@21
    32
	@Override
franta-hg@21
    33
	public void process(OutputStream output, List<String> parameters) throws OutputModuleException {
franta-hg@21
    34
		try (PrintWriter out = new PrintWriter(output)) {
franta-hg@21
    35
			for (String parameter : parameters) {
franta-hg@21
    36
				out.println(parameter);
franta-hg@21
    37
				out.flush();
franta-hg@21
    38
			}
franta-hg@21
    39
		}
franta-hg@21
    40
	}
franta-hg@21
    41
franta-hg@21
    42
}