View Javadoc
1   package net.sf.jpkgmk;
2   
3   import java.io.IOException;
4   import java.io.Writer;
5   
6   import org.apache.commons.logging.Log;
7   import org.apache.commons.logging.LogFactory;
8   
9   /**
10   * @author gommma (gommma AT users.sourceforge.net)
11   * @author Last changed by: $Author: gommma $
12   * @version $Revision: 2 $ $Date: 2008-08-20 21:14:19 +0200 (Mi, 20 Aug 2008) $
13   * @since 1.0
14   */
15  public abstract class AbstractLineProvider implements LineProvider
16  {
17  	private Log log = LogFactory.getLog(AbstractLineProvider.class);
18  	
19  	/**
20  	 * Writes this entry line to the given writer
21  	 * @param writer
22  	 * @throws IOException
23  	 */
24  	public void write(Writer writer) throws IOException {
25  		String line = this.getLine();
26  		if(log.isDebugEnabled()) {
27  			log.debug("Writing line:  " + line);
28  		}
29  		writer.write(line);
30  		writer.write(PkgInfo.LINE_SEPARATOR);
31  	}
32  
33  }