1 52 53 package com.lowagie.text.rtf; 54 55 import java.io.IOException ; 56 import java.io.OutputStream ; 57 58 import com.lowagie.text.Font; 59 60 61 73 public class GenericRtfField extends AbstractRtfField { 74 77 protected String fieldInst; 78 79 82 protected String fieldResult; 83 84 94 public GenericRtfField(final String fieldInst, final String fieldResult) { 95 super("x", new Font()); 96 this.fieldInst = fieldInst; 97 this.fieldResult = fieldResult; 98 } 99 100 111 public GenericRtfField(final String fieldInst, final String fieldResult, Font font) { 112 super("x", font); 113 this.fieldInst = fieldInst; 114 this.fieldResult = fieldResult; 115 } 116 117 123 public void writeRtfFieldInitializationStuff(OutputStream out) throws IOException { 124 out.write(fieldInst.trim().getBytes()); 125 out.write(RtfWriter.delimiter); 126 } 127 128 134 public void writeRtfFieldResultStuff(OutputStream out) throws IOException { 135 if (null != fieldResult) { 136 out.write(fieldResult.trim().getBytes()); 137 } 138 } 139 } 140 | Popular Tags |