001package org.unix4j.processor;
002
003import org.unix4j.io.Input;
004import org.unix4j.line.Line;
005
006/**
007 * The {@code DefaultInputProcessor} simply writes every line passed to
008 * {@link #processLine(Input, Line, LineProcessor)} to the output. Subclasses
009 * often override some of the methods to enhance or modify this default 
010 * behavior.
011 */
012public class DefaultInputProcessor implements InputProcessor {
013
014        @Override
015        public void begin(Input input, LineProcessor output) {
016                // default: no op
017        }
018
019        @Override
020        public boolean processLine(Input input, Line line, LineProcessor output) {
021                output.processLine(line);
022                return true;// we want all lines for this default implementation
023        }
024
025        @Override
026        public void finish(Input input, LineProcessor output) {
027                output.finish();
028        }
029
030}