BeanIO 1.2.3

org.beanio.stream.delimited
Class DelimitedWriterFactory

java.lang.Object
  extended by org.beanio.stream.delimited.DelimitedWriterFactory
All Implemented Interfaces:
RecordWriterFactory

public class DelimitedWriterFactory
extends Object
implements RecordWriterFactory

This record writer factory is used to create and configure a DelimitedWriter.

Since:
1.0
Author:
Kevin Seim
See Also:
DelimitedWriter

Constructor Summary
DelimitedWriterFactory()
           
 
Method Summary
 RecordWriter createWriter(Writer out)
          Creates a new RecordWriter to write to an output stream.
 char getDelimiter()
          Returns the field delimiter.
 Character getEscape()
          Returns the escape character.
 String getLineSeparator()
          Deprecated.  
 String getRecordTerminator()
          Returns the text used to terminate a record.
 boolean isEscapeEnabled()
          Returns whether escaping is enabled.
 void setDelimiter(char c)
          Sets the field delimiter.
 void setEscape(Character c)
          Sets the escape character.
 void setLineSeparator(String lineSeparator)
          Deprecated.  
 void setRecordTerminator(String recordTerminator)
          Sets the text used to terminate a record.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelimitedWriterFactory

public DelimitedWriterFactory()
Method Detail

createWriter

public RecordWriter createWriter(Writer out)
Description copied from interface: RecordWriterFactory
Creates a new RecordWriter to write to an output stream.

Specified by:
createWriter in interface RecordWriterFactory
Parameters:
out - the output stream to write to
Returns:
the new RecordWriter

setDelimiter

public void setDelimiter(char c)
Sets the field delimiter. By default, the delimiter is a comma.

Parameters:
c - the character used to delimit fields

getDelimiter

public char getDelimiter()
Returns the field delimiter. By default, the delimiter is a comma.

Returns:
the character used to delimit fields

isEscapeEnabled

public boolean isEscapeEnabled()
Returns whether escaping is enabled. By default, escaping is disabled.

Returns:
boolean true if escaping is enabled
See Also:
getEscape()

setEscape

public void setEscape(Character c)
Sets the escape character. The escape character can only be used to escape the delimiter or itself. Set to null to disable escaping.

Parameters:
c - the new escape character

getEscape

public Character getEscape()
Returns the escape character.

Returns:
the escape character or null if escaping is disabled

getRecordTerminator

public String getRecordTerminator()
Returns the text used to terminate a record. By default, the record terminator is set to the value of the line.separator system property.

Returns:
the record termination text

setRecordTerminator

public void setRecordTerminator(String recordTerminator)
Sets the text used to terminate a record. If set to null, the the value of the line.separator system property is used to terminate records.

Parameters:
recordTerminator - the record termination text

getLineSeparator

public String getLineSeparator()
Deprecated. 

Returns the text used to terminate a record. By default, the line separator is set using the 'line.separator' system property.

Returns:
the line separation text

setLineSeparator

public void setLineSeparator(String lineSeparator)
Deprecated. 

Sets the text used to terminate a record. If set to null, the default line separator is used based on the 'line.separator' system property.

Parameters:
lineSeparator - the line separation text

BeanIO 1.2.3

Copyright © 2010-2012 Kevin Seim