org.aludratest.content.separated.webdecs
Class WebdecsSeparatedContent

java.lang.Object
  extended by org.aludratest.content.separated.webdecs.WebdecsSeparatedContent
All Implemented Interfaces:
ContentHandler, SeparatedContent

public class WebdecsSeparatedContent
extends Object
implements SeparatedContent

Webdecs-based content handler for separated files

Author:
Volker Bergmann

Constructor Summary
WebdecsSeparatedContent()
          Constructor.
 
Method Summary
 void closeReader(Object readerId)
          Closes a reader.
 void closeWriter(Object writerId)
          Closes the writer and returns its content as string.
<T extends SeparatedFileBeanData>
Object
createReader(Reader source, Class<T> rowType, char separator)
          Creates a reader object for reading JavaBeans.
 Object createWriter(Writer out, Class<? extends SeparatedFileBeanData> beanClass, char separator, String header)
          Creates a writer for persisting SeparatedFileBeans or JavaBean data structures.
 String readHeader(Object readerId)
          Reads a file header row.
 SeparatedFileBeanData readRow(Object readerId)
          Reads a separated file row and provides it as Java object.
 void writeRow(SeparatedFileBeanData rowBean, Object writerId)
          Appends a row to the separated file writer denoted by the writerId.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebdecsSeparatedContent

public WebdecsSeparatedContent()
Constructor.

Method Detail

createWriter

public Object createWriter(Writer out,
                           Class<? extends SeparatedFileBeanData> beanClass,
                           char separator,
                           String header)
Creates a writer for persisting SeparatedFileBeans or JavaBean data structures.

Specified by:
createWriter in interface SeparatedContent
Parameters:
out - the writer to use for persisting the separated file content
separator -
beanClass -
header -
Returns:
the id of the new writer

writeRow

public void writeRow(SeparatedFileBeanData rowBean,
                     Object writerId)
Appends a row to the separated file writer denoted by the writerId.

Specified by:
writeRow in interface SeparatedContent
Parameters:
rowBean - the SeparatedFileBean holding the data
writerId - the id of the writer with which to store the formatted text

closeWriter

public void closeWriter(Object writerId)
Closes the writer and returns its content as string.

Specified by:
closeWriter in interface SeparatedContent
Parameters:
writerId - the id of the writer to close

createReader

public <T extends SeparatedFileBeanData> Object createReader(Reader source,
                                                             Class<T> rowType,
                                                             char separator)
Creates a reader object for reading JavaBeans.

Specified by:
createReader in interface SeparatedContent
Parameters:
source - the source reader that provides the separated file's character data
Returns:
the id of the writer

readHeader

public String readHeader(Object readerId)
Description copied from interface: SeparatedContent
Reads a file header row.

Specified by:
readHeader in interface SeparatedContent
Returns:
the content of the file header

readRow

public SeparatedFileBeanData readRow(Object readerId)
Reads a separated file row and provides it as Java object.

Specified by:
readRow in interface SeparatedContent
Parameters:
readerId - the id of the reader
Returns:
the id of the new reader

closeReader

public void closeReader(Object readerId)
Closes a reader.

Specified by:
closeReader in interface SeparatedContent
Parameters:
readerId - the id of the reader to close


Copyright © 2015 aludratest.org. All rights reserved.