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
public interface RecordTextSchema<T extends TextDataType> extends TextSchema
A schema for text files containing a single record type. This is opposed to files which may contain multiple record types; those are described usingFixedWidthMultiRecordTextSchema
instead.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TokenFormatter
createFieldFormatter(String fieldName)
Creates a new formatter for values of the specified field.TokenParser
createFieldParser(String fieldName)
Creates a new parser for values of the specified field.TextConversionDefaults
getDefaults()
Gets the default conversion behaviors for fields in the schema which do not explicitly define any.int
getFieldCount()
Gets the number of fields defined in the record.FieldDomain
getFieldDomain(String name)
Gets the domain of the specified field in the record.List<String>
getFieldNames()
Gets the names of the fields defined in the record.T
getFieldType(String name)
Gets the type of the specified fields in the record.RecordTokenType
getTokenType()
Gets the type of the token representation of the text record.boolean
isFieldDefined(String name)
Indicates whether a field with the given name is already defined.
-
-
-
Method Detail
-
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
List<String> 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
boolean isFieldDefined(String name)
Indicates whether a field with the given name is already defined.- Parameters:
name
- the field to check- Returns:
true
if a field with the name is defined in the schema,false
otherwise.
-
getFieldType
T getFieldType(String name)
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
FieldDomain getFieldDomain(String name)
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
TokenParser createFieldParser(String fieldName)
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
TokenFormatter createFieldFormatter(String fieldName)
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
-
-