Module datarush.library
Package com.pervasive.datarush.schema
Interface RecordTextSchema<T extends TextDataType>
- Type Parameters:
T- the type of fields in the schema
- All Superinterfaces:
TextSchema
- All Known Implementing Classes:
FixedWidthTextRecord,TextRecord
A schema for text files containing a single record type. This is opposed to
files which may contain multiple record types; those are described using
FixedWidthMultiRecordTextSchema instead.-
Method Summary
Modifier and TypeMethodDescriptioncreateFieldFormatter(String fieldName) Creates a new formatter for values of the specified field.createFieldParser(String fieldName) Creates a new parser for values of the specified field.Gets the default conversion behaviors for fields in the schema which do not explicitly define any.intGets the number of fields defined in the record.getFieldDomain(String name) Gets the domain of the specified field in the record.Gets the names of the fields defined in the record.getFieldType(String name) Gets the type of the specified fields in the record.Gets the type of the token representation of the text record.booleanisFieldDefined(String name) Indicates whether a field with the given name is already defined.
-
Method Details
-
getTokenType
RecordTokenType getTokenType()Gets the type of the token representation of the text record. The fields of the resulting type are in the same order and have the same name as the fields in the schema.- Returns:
- the token type representing the schema
-
getFieldCount
int getFieldCount()Gets the number of fields defined in the record.- Returns:
- the number of defined fields
-
getFieldNames
Gets the names of the fields defined in the record. The names are returned in the order they were defined.- Returns:
- a list of defined field names
-
isFieldDefined
Indicates whether a field with the given name is already defined.- Parameters:
name- the field to check- Returns:
trueif a field with the name is defined in the schema,falseotherwise.
-
getFieldType
Gets the type of the specified fields in the record. The names are returned in the order they were defined.- Parameters:
name- the field for which to fetch the type- Returns:
- the text type of the named field
-
getFieldDomain
Gets the domain of the specified field in the record.- Parameters:
name- the field for which to fetch the domain- Returns:
- the domain of the named field
-
createFieldParser
Creates a new parser for values of the specified field.- Parameters:
fieldName- the field for which to obtain a parser- Returns:
- a parser for converting text values to token values for the field
-
createFieldFormatter
Creates a new formatter for values of the specified field.- Parameters:
fieldName- the field for which to obtain a formatter- Returns:
- a formatter for converting token values to text values for the field
-
getDefaults
TextConversionDefaults getDefaults()Gets the default conversion behaviors for fields in the schema which do not explicitly define any. These include settings such as the null indicator for values and whether string values are trimmed or preserved as is.- Returns:
- the default behavior for the schema
-