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
Object columnDelimiter()

Get the columnDelimiter property: The column delimiter.

Object encodingName()

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

Object escapeChar()

Get the escapeChar property: The escape character.

Object firstRowAsHeader()

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

static TextFormat fromJson(JsonReader jsonReader)

Reads an instance of TextFormat from the JsonReader.

Object nullValue()

Get the nullValue property: The null value string.

Object quoteChar()

Get the quoteChar property: The quote character.

Object rowDelimiter()

Get the rowDelimiter property: The row delimiter.

Object skipLineCount()

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

JsonWriter toJson(JsonWriter jsonWriter)
Object treatEmptyAsNull()

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

String type()

Get the type property: Type of dataset storage format.

void validate()

Validates the instance.

TextFormat withColumnDelimiter(Object columnDelimiter)

Set the columnDelimiter property: The column delimiter.

TextFormat withDeserializer(Object deserializer)

Set the deserializer property: Deserializer.

TextFormat withEncodingName(Object encodingName)

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

TextFormat withEscapeChar(Object escapeChar)

Set the escapeChar property: The escape character.

TextFormat withFirstRowAsHeader(Object firstRowAsHeader)

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

TextFormat withNullValue(Object nullValue)

Set the nullValue property: The null value string.

TextFormat withQuoteChar(Object quoteChar)

Set the quoteChar property: The quote character.

TextFormat withRowDelimiter(Object rowDelimiter)

Set the rowDelimiter property: The row delimiter.

TextFormat withSerializer(Object serializer)

Set the serializer property: Serializer.

TextFormat withSkipLineCount(Object skipLineCount)

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

TextFormat withTreatEmptyAsNull(Object treatEmptyAsNull)

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

Methods inherited from DatasetStorageFormat

Methods inherited from java.lang.Object

Constructor Details

TextFormat

public TextFormat()

Creates an instance of TextFormat class.

Method Details

columnDelimiter

public Object columnDelimiter()

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

Returns:

the columnDelimiter value.

encodingName

public Object encodingName()

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.

escapeChar

public Object escapeChar()

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

Returns:

the escapeChar value.

firstRowAsHeader

public Object firstRowAsHeader()

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.

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.

nullValue

public Object nullValue()

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

Returns:

the nullValue value.

quoteChar

public Object quoteChar()

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

Returns:

the quoteChar value.

rowDelimiter

public Object rowDelimiter()

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

Returns:

the rowDelimiter value.

skipLineCount

public Object skipLineCount()

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.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Overrides:

TextFormat.toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

treatEmptyAsNull

public Object treatEmptyAsNull()

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.

type

public String type()

Get the type property: Type of dataset storage format.

Overrides:

TextFormat.type()

Returns:

the type value.

validate

public void validate()

Validates the instance.

Overrides:

TextFormat.validate()

withColumnDelimiter

public TextFormat withColumnDelimiter(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.

withDeserializer

public TextFormat withDeserializer(Object deserializer)

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

Overrides:

TextFormat.withDeserializer(Object deserializer)

Parameters:

deserializer

withEncodingName

public TextFormat withEncodingName(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.

withEscapeChar

public TextFormat withEscapeChar(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.

withFirstRowAsHeader

public TextFormat withFirstRowAsHeader(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.

withNullValue

public TextFormat withNullValue(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.

withQuoteChar

public TextFormat withQuoteChar(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.

withRowDelimiter

public TextFormat withRowDelimiter(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.

withSerializer

public TextFormat withSerializer(Object serializer)

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

Overrides:

TextFormat.withSerializer(Object serializer)

Parameters:

serializer

withSkipLineCount

public TextFormat withSkipLineCount(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.

withTreatEmptyAsNull

public TextFormat withTreatEmptyAsNull(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.

Applies to