/* * [EmitHTML.java] * * Summary: Tools to Generate HTML, used by phone list. * * Copyright: (c) 2008-2017 Roedy Green, Canadian Mind Products, http://mindprod.com * * Licence: This software may be copied and used freely for any purpose but military. * http://mindprod.com/contact/nonmil.html * * Requires: JDK 1.8+ * * Created with: JetBrains IntelliJ IDEA IDE http://www.jetbrains.com/idea/ * * Version History: * 1.0 2008-02-04 set up with ANT. */ package com.mindprod.phone; import com.mindprod.entities.EntifyStrings; import com.mindprod.fastcat.FastCat; import com.mindprod.htmlmacros.macro.Global; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.PrintStream; /** * Tools to Generate HTML, used by phone list. * * @author Roedy Green, Canadian Mind Products * @version 1.0 2008-02-04 set up with ANT. * @since 2008-02-04 */ @SuppressWarnings( { "WeakerAccess" } ) public class EmitHTML { @SuppressWarnings( { "WeakerAccess" } ) PrintStream out; /** * constructor, opens file * * @param file where to emit the generated html * * @throws IOException if can't open */ public EmitHTML( File file ) throws IOException { out = new PrintStream( new FileOutputStream( file ) ); } /** * produce html for td cell with style. * * @param style style for cell * @param s unentified contents of cell * * @return html from td to /td. */ public String cell( final String style, final String s ) { if ( s == null || s.length() == 0 ) { return ( "