jimm.datavision.layout
Class CharSepLE

java.lang.Object
  extended by jimm.datavision.layout.LayoutEngine
      extended by jimm.datavision.layout.SortedLayoutEngine
          extended by jimm.datavision.layout.CharSepLE

public class CharSepLE
extends SortedLayoutEngine

CharSepLE is a layout engine that outputs text data files. Output is one line per row of data. Column data is separated by a user-specified character.

Author:
Jim Menard, jimm@io.com

Field Summary
protected  boolean first
           
protected  char sepChar
           
 
Fields inherited from class jimm.datavision.layout.SortedLayoutEngine
comp, sectionFields
 
Fields inherited from class jimm.datavision.layout.LayoutEngine
currentSection, newPage, out, pageHeight, pageHeightUsed, pageNumber, pageWidth, POINTS_PER_INCH, previousSectionArea, report, SECT_DETAIL, SECT_GROUP_FOOTER, SECT_GROUP_HEADER, SECT_PAGE_FOOTER, SECT_PAGE_HEADER, SECT_REPORT_FOOTER, SECT_REPORT_HEADER, wantsMoreData
 
Constructor Summary
CharSepLE(java.io.PrintWriter out, char sepChar)
          Constructor.
 
Method Summary
protected  java.lang.String asSafeSepString(java.lang.String str)
          Return a string that's safe to use in a comma-delimited data file.
protected  void doOutputField(Field field)
          This override handles output of a field.
protected  void doOutputImage(ImageField image)
          Called by outputImage as a chance to insert behavior when a image is output.
protected  void doOutputLine(Line line)
          Ignores line output.
protected  void doOutputSection(Section sect)
          This override handles output of a section.
 
Methods inherited from class jimm.datavision.layout.SortedLayoutEngine
buildSectionFields
 
Methods inherited from class jimm.datavision.layout.LayoutEngine
calcDetailHeight, calcPageFooterHeight, calcReportFooterHeight, calcSectionHeights, cancel, checkRemainingPageLength, closeOutput, currentSectionTypeAsString, detail, doEnd, doEndPage, doStart, doStartPage, end, endPage, groupFooters, groupHeaders, outputField, outputImage, outputLine, outputSection, pageHeight, pageNumber, pageWidth, setReport, start, startPage, wantsMoreData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sepChar

protected char sepChar

first

protected boolean first
Constructor Detail

CharSepLE

public CharSepLE(java.io.PrintWriter out,
                 char sepChar)
Constructor.

Parameters:
out - the output writer
sepChar - the character used to separate column data
Method Detail

doOutputSection

protected void doOutputSection(Section sect)
This override handles output of a section.

Overrides:
doOutputSection in class SortedLayoutEngine
Parameters:
sect - section

doOutputField

protected void doOutputField(Field field)
This override handles output of a field.

Specified by:
doOutputField in class LayoutEngine
Parameters:
field - a field

doOutputImage

protected void doOutputImage(ImageField image)
Description copied from class: LayoutEngine
Called by outputImage as a chance to insert behavior when a image is output.

Specified by:
doOutputImage in class LayoutEngine
Parameters:
image - an image field

doOutputLine

protected void doOutputLine(Line line)
Ignores line output.

Specified by:
doOutputLine in class LayoutEngine
Parameters:
line - a line

asSafeSepString

protected java.lang.String asSafeSepString(java.lang.String str)
Return a string that's safe to use in a comma-delimited data file. Returns a new string with all double quotes replaced by two double quotes. If there are any double quotes, commas, or newlines in the string, the returned string will be surrounded by double quotes.

Parameters:
str - a string to be used in a comma-delimited data file
Returns:
a new string that's safe for use in a comma-delimited data file