|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.csv.writer.CSVConfig
public class CSVConfig
The CSVConfig is used to configure the CSV writer
Field Summary | |
---|---|
private char |
delimiter
The seperator character. |
private boolean |
endTrimmed
Specifies if the end of the line needs to be trimmed |
private boolean |
fieldHeader
Specifies if we want to use a field header |
private java.util.List |
fields
list of fields |
private int |
fill
The fill pattern |
private char |
fillChar
The fill char. |
static int |
FILLLEFT
Fill content the the left. |
static int |
FILLNONE
Do no do any filling |
static int |
FILLRIGHT
Fill content to the right. |
private boolean |
fixedWidth
specifies if it is a fixed width csv file |
private boolean |
ignoreDelimiter
Should we ignore the delimiter. |
private boolean |
ignoreValueDelimiter
Should we ignore the value delimiter. |
private char |
valueDelimiter
the value delimiter. |
Constructor Summary | |
---|---|
CSVConfig()
|
Method Summary | |
---|---|
void |
addField(CSVField field)
|
boolean |
equals(java.lang.Object obj)
TODO.. |
char |
getDelimiter()
|
CSVField |
getField(java.lang.String name)
|
CSVField[] |
getFields()
|
int |
getFill()
|
char |
getFillChar()
|
char |
getValueDelimiter()
|
static CSVConfig |
guessConfig(java.io.InputStream inputStream)
Creates a config based on a stream. |
boolean |
isDelimiterIgnored()
|
boolean |
isEndTrimmed()
|
boolean |
isFieldHeader()
|
boolean |
isFixedWidth()
|
boolean |
isValueDelimiterIgnored()
|
void |
setDelimiter(char delimiter)
Set the delimiter to use |
void |
setEndTrimmed(boolean endTrimmed)
Specify if the end of the line needs to be trimmed. |
void |
setFieldHeader(boolean fieldHeader)
Specify if you want to use a field header. |
void |
setFields(java.util.Collection csvField)
Set the fields that should be used by the writer |
void |
setFields(CSVField[] csvFields)
Set the fields that should be used by the writer. |
void |
setFill(int fill)
Set the fill pattern. |
void |
setFillChar(char fillChar)
Set the fill char |
void |
setFixedWidth(boolean fixedWidth)
Specify if the CSV file is fixed width. |
void |
setIgnoreDelimiter(boolean ignoreDelimiter)
Specify if the writer should ignore the delimiter. |
void |
setIgnoreValueDelimiter(boolean ignoreValueDelimiter)
Specify if the writer should ignore the value delimiter. |
void |
setValueDelimiter(char valueDelimiter)
Set the value delimiter to use |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private boolean fixedWidth
private java.util.List fields
public static final int FILLNONE
public static final int FILLLEFT
public static final int FILLRIGHT
private int fill
private char fillChar
private char delimiter
private boolean ignoreDelimiter
private char valueDelimiter
private boolean ignoreValueDelimiter
private boolean fieldHeader
private boolean endTrimmed
Constructor Detail |
---|
public CSVConfig()
Method Detail |
---|
public boolean isFixedWidth()
public void setFixedWidth(boolean fixedWidth)
fixedWidth
- the fixedwidthpublic void addField(CSVField field)
public void setFields(CSVField[] csvFields)
csvFields
- the csvfields array. If null it will do nothingpublic void setFields(java.util.Collection csvField)
csvField
- a collection with fields. If null it will do nothingpublic CSVField[] getFields()
public CSVField getField(java.lang.String name)
public int getFill()
public void setFill(int fill)
FILLNONE
FILLLEFT
and FILLRIGHT
fill
- the fill pattern.public char getFillChar()
public void setFillChar(char fillChar)
fillChar
- the fill charpublic char getDelimiter()
public void setDelimiter(char delimiter)
delimiter
- the delimiter character.public boolean isDelimiterIgnored()
public void setIgnoreDelimiter(boolean ignoreDelimiter)
ignoreDelimiter
- defaults to false.public char getValueDelimiter()
public void setValueDelimiter(char valueDelimiter)
valueDelimiter
- the value delimiter character.public boolean isValueDelimiterIgnored()
public void setIgnoreValueDelimiter(boolean ignoreValueDelimiter)
ignoreValueDelimiter
- defaults to false.public boolean isFieldHeader()
public void setFieldHeader(boolean fieldHeader)
fieldHeader
- true or false.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public static CSVConfig guessConfig(java.io.InputStream inputStream)
inputStream
- the inputstream.
public boolean isEndTrimmed()
public void setEndTrimmed(boolean endTrimmed)
endTrimmed
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |