websphinx
Class RecordTransformer

java.lang.Object
  |
  +--websphinx.HTMLTransformer
        |
        +--websphinx.LinkTransformer
              |
              +--websphinx.RewritableLinkTransformer
                    |
                    +--websphinx.RecordTransformer

public class RecordTransformer
extends RewritableLinkTransformer


Field Summary
(package private)  java.lang.String epilog
           
(package private)  java.lang.String fieldDivider
           
(package private)  java.lang.String fieldEnd
           
(package private)  java.lang.String fieldStart
           
(package private)  int nRecords
           
(package private)  java.lang.String prolog
           
(package private)  java.lang.String recordDivider
           
(package private)  java.lang.String recordEnd
           
(package private)  java.lang.String recordStart
           
 
Fields inherited from class websphinx.RewritableLinkTransformer
BUFFER_SIZE, closed, file, head, PLACEHOLDER, tail
 
Fields inherited from class websphinx.LinkTransformer
base, emitBaseElement, map, needToEmitBase
 
Fields inherited from class websphinx.HTMLTransformer
content, emitEnd, emitStart, next, openedStream, readwrite, stream, transformEnd
 
Constructor Summary
RecordTransformer(java.lang.String filename)
           
 
Method Summary
private  void emitTemplate(java.lang.String template, java.net.URL url, int record)
           
 void flush()
          Flush the record page to disk.
 java.lang.String getEpilog()
           
 java.lang.String getFieldDivider()
           
 java.lang.String getFieldEnd()
           
 java.lang.String getFieldStart()
           
 java.lang.String getProlog()
           
 int getRecordCount()
           
 java.lang.String getRecordDivider()
           
 java.lang.String getRecordEnd()
           
 java.lang.String getRecordStart()
           
 void setEpilog(java.lang.String epilog)
           
 void setFieldDivider(java.lang.String fieldDivider)
           
 void setFieldEnd(java.lang.String fieldEnd)
           
 void setFieldStart(java.lang.String fieldStart)
           
 void setProlog(java.lang.String prolog)
           
 void setRecordDivider(java.lang.String recordDivider)
           
 void setRecordEnd(java.lang.String recordEnd)
           
 void setRecordStart(java.lang.String recordStart)
           
private  java.net.URL urlOfFirstRegion(java.lang.Object[] fields)
           
 void writeRecord(java.lang.Object[] fields, boolean asText)
           
 
Methods inherited from class websphinx.RewritableLinkTransformer
addURL, close, handleLink, rewrite
 
Methods inherited from class websphinx.LinkTransformer
getBase, getEmitBaseElement, handleBase, handleElement, isMapped, lookup, map, map, setBase, setEmitBaseElement, writePage
 
Methods inherited from class websphinx.HTMLTransformer
emit, emit, emitInternal, emitPendingRegion, finalize, getFilePointer, getOutput, getRandomAccessFile, openFile, processElementsInRegion, seek, setOutput, setOutput, setRandomAccessFile, transformContents, transformElement, write, write, writeStream
 
Methods inherited from class java.lang.Object
, clone, equals, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

prolog

java.lang.String prolog

epilog

java.lang.String epilog

recordStart

java.lang.String recordStart

recordEnd

java.lang.String recordEnd

recordDivider

java.lang.String recordDivider

fieldStart

java.lang.String fieldStart

fieldEnd

java.lang.String fieldEnd

fieldDivider

java.lang.String fieldDivider

nRecords

int nRecords
Constructor Detail

RecordTransformer

public RecordTransformer(java.lang.String filename)
                  throws java.io.IOException
Method Detail

setProlog

public void setProlog(java.lang.String prolog)

getProlog

public java.lang.String getProlog()

setEpilog

public void setEpilog(java.lang.String epilog)

getEpilog

public java.lang.String getEpilog()

setRecordStart

public void setRecordStart(java.lang.String recordStart)

getRecordStart

public java.lang.String getRecordStart()

setRecordEnd

public void setRecordEnd(java.lang.String recordEnd)

getRecordEnd

public java.lang.String getRecordEnd()

setRecordDivider

public void setRecordDivider(java.lang.String recordDivider)

getRecordDivider

public java.lang.String getRecordDivider()

setFieldStart

public void setFieldStart(java.lang.String fieldStart)

getFieldStart

public java.lang.String getFieldStart()

setFieldEnd

public void setFieldEnd(java.lang.String fieldEnd)

getFieldEnd

public java.lang.String getFieldEnd()

setFieldDivider

public void setFieldDivider(java.lang.String fieldDivider)

getFieldDivider

public java.lang.String getFieldDivider()

flush

public void flush()
           throws java.io.IOException
Flush the record page to disk. Temporarily writes the epilog.
Overrides:
flush in class HTMLTransformer

getRecordCount

public int getRecordCount()

writeRecord

public void writeRecord(java.lang.Object[] fields,
                        boolean asText)
                 throws java.io.IOException

urlOfFirstRegion

private java.net.URL urlOfFirstRegion(java.lang.Object[] fields)

emitTemplate

private void emitTemplate(java.lang.String template,
                          java.net.URL url,
                          int record)
                   throws java.io.IOException