Package com.univocity.parsers.tsv
Class TsvFormat
- java.lang.Object
-
- com.univocity.parsers.common.Format
-
- com.univocity.parsers.tsv.TsvFormat
-
- All Implemented Interfaces:
java.lang.Cloneable
public class TsvFormat extends Format
The TSV format configuration, for tab-separated inputs. It offers the options in the default configuration inFormat
, as well as theescapeChar
character for escaping \t, \n, \r and \ in TSV values. Delimiters are defined as tab characters '\t'- See Also:
Format
-
-
Field Summary
Fields Modifier and Type Field Description private char
escapeChar
private char
escapedTabChar
-
Constructor Summary
Constructors Constructor Description TsvFormat()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TsvFormat
clone()
protected java.util.TreeMap<java.lang.String,java.lang.Object>
getConfiguration()
char
getEscapeChar()
Returns the character used for escaping special characters in TSV inputs: \t, \n, \r and \char
getEscapedTabChar()
Returns the character that should be used to represent an escaped tab, i.e.boolean
isEscapeChar(char ch)
Identifies whether or not a given character is used for escaping special characters in TSV (\t, \n, \r and \).void
setEscapeChar(char escapeChar)
Defines the character used for escaping special characters in TSV inputs: \t, \n, \r and \ .void
setEscapedTabChar(char escapedTabChar)
Defines the character that should be used to represent an escaped tab, i.e.-
Methods inherited from class com.univocity.parsers.common.Format
getComment, getLineSeparator, getLineSeparatorString, getNormalizedNewline, getSystemLineSeparator, isComment, isNewLine, setComment, setLineSeparator, setLineSeparator, setNormalizedNewline, toString
-
-
-
-
Method Detail
-
setEscapeChar
public void setEscapeChar(char escapeChar)
Defines the character used for escaping special characters in TSV inputs: \t, \n, \r and \ . Defaults to '\\'- Parameters:
escapeChar
- the escape character
-
getEscapeChar
public char getEscapeChar()
Returns the character used for escaping special characters in TSV inputs: \t, \n, \r and \- Returns:
- the escape character.
-
getEscapedTabChar
public char getEscapedTabChar()
Returns the character that should be used to represent an escaped tab, i.e. the character before the definedgetEscapeChar()
. For example, ifgetEscapeChar()
== '\\' and== 'X'
, the sequence'\X'
will identify a tab. Defaults to't'
.- Returns:
- the character following the
getEscapeChar()
that represents an escaped tab.
-
setEscapedTabChar
public void setEscapedTabChar(char escapedTabChar)
Defines the character that should be used to represent an escaped tab, i.e. the character before the definedgetEscapeChar()
. For example, ifgetEscapeChar()
== '\\' and== 'X'
, the sequence'\X'
will identify a tab. Defaults to't'
.- Parameters:
escapedTabChar
- the character following thegetEscapeChar()
that represents an escaped tab.
-
isEscapeChar
public boolean isEscapeChar(char ch)
Identifies whether or not a given character is used for escaping special characters in TSV (\t, \n, \r and \).- Parameters:
ch
- the character to be verified- Returns:
- true if the given character is escape character, false otherwise
-
getConfiguration
protected java.util.TreeMap<java.lang.String,java.lang.Object> getConfiguration()
- Specified by:
getConfiguration
in classFormat
-
-