TextFormat Class

public final class TextFormat
extends DatasetStorageFormat

The data stored in text format.

Constructor Summary

Constructor Description
TextFormat()

Creates an instance of TextFormat class.

Method Summary

Modifier and Type Method and Description
static TextFormat fromJson(JsonReader jsonReader)

Reads an instance of TextFormat from the JsonReader.

Object getColumnDelimiter()

Get the columnDelimiter property: The column delimiter.

Object getEncodingName()

Get the encodingName property: The code page name of the preferred encoding.

Object getEscapeChar()

Get the escapeChar property: The escape character.

Object getFirstRowAsHeader()

Get the firstRowAsHeader property: When used as input, treat the first row of data as headers.

Object getNullValue()

Get the nullValue property: The null value string.

Object getQuoteChar()

Get the quoteChar property: The quote character.

Object getRowDelimiter()

Get the rowDelimiter property: The row delimiter.

Object getSkipLineCount()

Get the skipLineCount property: The number of lines/rows to be skipped when parsing text files.

Object getTreatEmptyAsNull()

Get the treatEmptyAsNull property: Treat empty column values in the text file as null.

String getType()

Get the type property: Type of dataset storage format.

TextFormat setColumnDelimiter(Object columnDelimiter)

Set the columnDelimiter property: The column delimiter.

TextFormat setDeserializer(Object deserializer)

Set the deserializer property: Deserializer.

TextFormat setEncodingName(Object encodingName)

Set the encodingName property: The code page name of the preferred encoding.

TextFormat setEscapeChar(Object escapeChar)

Set the escapeChar property: The escape character.

TextFormat setFirstRowAsHeader(Object firstRowAsHeader)

Set the firstRowAsHeader property: When used as input, treat the first row of data as headers.

TextFormat setNullValue(Object nullValue)

Set the nullValue property: The null value string.

TextFormat setQuoteChar(Object quoteChar)

Set the quoteChar property: The quote character.

TextFormat setRowDelimiter(Object rowDelimiter)

Set the rowDelimiter property: The row delimiter.

TextFormat setSerializer(Object serializer)

Set the serializer property: Serializer.

TextFormat setSkipLineCount(Object skipLineCount)

Set the skipLineCount property: The number of lines/rows to be skipped when parsing text files.

TextFormat setTreatEmptyAsNull(Object treatEmptyAsNull)

Set the treatEmptyAsNull property: Treat empty column values in the text file as null.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from DatasetStorageFormat

Methods inherited from java.lang.Object

Constructor Details

TextFormat

public TextFormat()

Creates an instance of TextFormat class.

Method Details

fromJson

public static TextFormat fromJson(JsonReader jsonReader)

Reads an instance of TextFormat from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of TextFormat if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If an error occurs while reading the TextFormat.

getColumnDelimiter

public Object getColumnDelimiter()

Get the columnDelimiter property: The column delimiter. Type: string (or Expression with resultType string).

Returns:

the columnDelimiter value.

getEncodingName

public Object getEncodingName()

Get the encodingName property: The code page name of the preferred encoding. If miss, the default value is ΓÇ£utf-8ΓÇ¥, unless BOM denotes another Unicode encoding. Refer to the ΓÇ£NameΓÇ¥ column of the table in the following link to set supported values: https://msdn.microsoft.com/library/system.text.encoding.aspx. Type: string (or Expression with resultType string).

Returns:

the encodingName value.

getEscapeChar

public Object getEscapeChar()

Get the escapeChar property: The escape character. Type: string (or Expression with resultType string).

Returns:

the escapeChar value.

getFirstRowAsHeader

public Object getFirstRowAsHeader()

Get the firstRowAsHeader property: When used as input, treat the first row of data as headers. When used as output,write the headers into the output as the first row of data. The default value is false. Type: boolean (or Expression with resultType boolean).

Returns:

the firstRowAsHeader value.

getNullValue

public Object getNullValue()

Get the nullValue property: The null value string. Type: string (or Expression with resultType string).

Returns:

the nullValue value.

getQuoteChar

public Object getQuoteChar()

Get the quoteChar property: The quote character. Type: string (or Expression with resultType string).

Returns:

the quoteChar value.

getRowDelimiter

public Object getRowDelimiter()

Get the rowDelimiter property: The row delimiter. Type: string (or Expression with resultType string).

Returns:

the rowDelimiter value.

getSkipLineCount

public Object getSkipLineCount()

Get the skipLineCount property: The number of lines/rows to be skipped when parsing text files. The default value is 0. Type: integer (or Expression with resultType integer).

Returns:

the skipLineCount value.

getTreatEmptyAsNull

public Object getTreatEmptyAsNull()

Get the treatEmptyAsNull property: Treat empty column values in the text file as null. The default value is true. Type: boolean (or Expression with resultType boolean).

Returns:

the treatEmptyAsNull value.

getType

public String getType()

Get the type property: Type of dataset storage format.

Overrides:

TextFormat.getType()

Returns:

the type value.

setColumnDelimiter

public TextFormat setColumnDelimiter(Object columnDelimiter)

Set the columnDelimiter property: The column delimiter. Type: string (or Expression with resultType string).

Parameters:

columnDelimiter - the columnDelimiter value to set.

Returns:

the TextFormat object itself.

setDeserializer

public TextFormat setDeserializer(Object deserializer)

Set the deserializer property: Deserializer. Type: string (or Expression with resultType string).

Overrides:

TextFormat.setDeserializer(Object deserializer)

Parameters:

deserializer

setEncodingName

public TextFormat setEncodingName(Object encodingName)

Set the encodingName property: The code page name of the preferred encoding. If miss, the default value is ΓÇ£utf-8ΓÇ¥, unless BOM denotes another Unicode encoding. Refer to the ΓÇ£NameΓÇ¥ column of the table in the following link to set supported values: https://msdn.microsoft.com/library/system.text.encoding.aspx. Type: string (or Expression with resultType string).

Parameters:

encodingName - the encodingName value to set.

Returns:

the TextFormat object itself.

setEscapeChar

public TextFormat setEscapeChar(Object escapeChar)

Set the escapeChar property: The escape character. Type: string (or Expression with resultType string).

Parameters:

escapeChar - the escapeChar value to set.

Returns:

the TextFormat object itself.

setFirstRowAsHeader

public TextFormat setFirstRowAsHeader(Object firstRowAsHeader)

Set the firstRowAsHeader property: When used as input, treat the first row of data as headers. When used as output,write the headers into the output as the first row of data. The default value is false. Type: boolean (or Expression with resultType boolean).

Parameters:

firstRowAsHeader - the firstRowAsHeader value to set.

Returns:

the TextFormat object itself.

setNullValue

public TextFormat setNullValue(Object nullValue)

Set the nullValue property: The null value string. Type: string (or Expression with resultType string).

Parameters:

nullValue - the nullValue value to set.

Returns:

the TextFormat object itself.

setQuoteChar

public TextFormat setQuoteChar(Object quoteChar)

Set the quoteChar property: The quote character. Type: string (or Expression with resultType string).

Parameters:

quoteChar - the quoteChar value to set.

Returns:

the TextFormat object itself.

setRowDelimiter

public TextFormat setRowDelimiter(Object rowDelimiter)

Set the rowDelimiter property: The row delimiter. Type: string (or Expression with resultType string).

Parameters:

rowDelimiter - the rowDelimiter value to set.

Returns:

the TextFormat object itself.

setSerializer

public TextFormat setSerializer(Object serializer)

Set the serializer property: Serializer. Type: string (or Expression with resultType string).

Overrides:

TextFormat.setSerializer(Object serializer)

Parameters:

serializer

setSkipLineCount

public TextFormat setSkipLineCount(Object skipLineCount)

Set the skipLineCount property: The number of lines/rows to be skipped when parsing text files. The default value is 0. Type: integer (or Expression with resultType integer).

Parameters:

skipLineCount - the skipLineCount value to set.

Returns:

the TextFormat object itself.

setTreatEmptyAsNull

public TextFormat setTreatEmptyAsNull(Object treatEmptyAsNull)

Set the treatEmptyAsNull property: Treat empty column values in the text file as null. The default value is true. Type: boolean (or Expression with resultType boolean).

Parameters:

treatEmptyAsNull - the treatEmptyAsNull value to set.

Returns:

the TextFormat object itself.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Overrides:

TextFormat.toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to