Top Description Fields Constructors Methods
com.univocity.parsers.tsv

public Class TsvFormat

extends Format
Class Inheritance
Imports
com.univocity.parsers.common.*, java.util.*

The TSV format configuration, for tab-separated inputs. It offers the options in the default configuration in Format, as well as the escapeChar character for escaping \t, \n, \r and \ in TSV values. Delimiters are defined as tab characters '\t'
Author
Univocity Software Pty Ltd - [email protected]
See Also
com.univocity.parsers.common.Format

Field Summary

Modifier and TypeField and Description
private char
private char

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public final TsvFormat
clone()

Overrides com.univocity.parsers.common.Format.clone.

Creates and returns a copy of this object.
protected TreeMap<String, Object>
public char

Returns:

the escape character.
getEscapeChar
()

Returns the character used for escaping special characters in TSV inputs: \t, \n, \r and \

public char

Returns:

the character following the getEscapeChar() that represents an escaped tab.
getEscapedTabChar
()

Returns the character that should be used to represent an escaped tab, i.e. the character before the defined getEscapeChar().

public boolean

Returns:

true if the given character is escape character, false otherwise
isEscapeChar
(char
the character to be verified
ch
)

Identifies whether or not a given character is used for escaping special characters in TSV (\t, \n, \r and \).

public void
setEscapeChar(char
the escape character
escapeChar
)

Defines the character used for escaping special characters in TSV inputs: \t, \n, \r and \ .

public void
setEscapedTabChar(char
the character following the getEscapeChar() that represents an escaped tab.
escapedTabChar
)

Defines the character that should be used to represent an escaped tab, i.e. the character before the defined getEscapeChar().

Inherited from com.univocity.parsers.common.Format:
getCommentgetLineSeparatorgetLineSeparatorStringgetNormalizedNewlinegetSystemLineSeparatorisCommentisNewLinesetCommentsetLineSeparatorsetLineSeparatorsetNormalizedNewlinetoString

Field Detail

escapeCharback to summary
private char escapeChar
escapedTabCharback to summary
private char escapedTabChar

Constructor Detail

TsvFormatback to summary
public TsvFormat()

Method Detail

cloneback to summary
public final TsvFormat clone()

Overrides com.univocity.parsers.common.Format.clone.

Doc from java.lang.Object.clone.

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

Returns:TsvFormat

a clone of this instance.

Annotations
@Override
getConfigurationback to summary
protected TreeMap<String, Object> getConfiguration()

Implements abstract com.univocity.parsers.common.Format.getConfiguration.

Annotations
@Override
getEscapeCharback to summary
public char getEscapeChar()

Returns the character used for escaping special characters in TSV inputs: \t, \n, \r and \

Returns:char

the escape character.

getEscapedTabCharback to summary
public char getEscapedTabChar()

Returns the character that should be used to represent an escaped tab, i.e. the character before the defined getEscapeChar(). For example, if getEscapeChar() == '\\' and == 'X', the sequence '\X' will identify a tab. Defaults to 't'.

Returns:char

the character following the getEscapeChar() that represents an escaped tab.

isEscapeCharback to summary
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:char

the character to be verified

Returns:boolean

true if the given character is escape character, false otherwise

setEscapeCharback to summary
public void setEscapeChar(char escapeChar)

Defines the character used for escaping special characters in TSV inputs: \t, \n, \r and \ . Defaults to '\\'

Parameters
escapeChar:char

the escape character

setEscapedTabCharback to summary
public void setEscapedTabChar(char escapedTabChar)

Defines the character that should be used to represent an escaped tab, i.e. the character before the defined getEscapeChar(). For example, if getEscapeChar() == '\\' and == 'X', the sequence '\X' will identify a tab. Defaults to 't'.

Parameters
escapedTabChar:char

the character following the getEscapeChar() that represents an escaped tab.