Interface TextDataType

  • All Known Subinterfaces:
    FixedSizeTextType
    All Known Implementing Classes:
    DynamicEnumerationType, PaddedTextType

    public interface TextDataType
    A mapping between a scalar token type and text representations of values of that type. An TextDataType is used in TextSchema objects to provide the necessary information for structured text file readers and writers to convert values between internal (token) and external (text) representations.

    A number of standard types are predefined in TextTypes.

    See Also:
    TextSchema
    • Method Detail

      • getTokenType

        ScalarTokenType getTokenType()
        Gets the token type used internally for the external type.
        Returns:
        the internal data type
      • createParser

        TokenParser createParser​(TextConversionContext ctx)
        Creates a new parser for converting text into token values
        Parameters:
        ctx - context containing additional information needed by parser
        Returns:
        a new parser object for the type
      • getFormatter

        TokenFormatter getFormatter​(TextConversionContext ctx)
        Creates a new formatter for converting token values into text
        Parameters:
        ctx - context containing additional information needed by parser
        Returns:
        a new formatter object for the type
      • toPattern

        String toPattern()
        Gets a string representing the format.
        Returns:
        the format string for the type, null if the format cannot be expressed this way
      • getNullIndicator

        String getNullIndicator​(TextConversionDefaults defaults)
        Gets the string used to indicate null values for the type.
        Parameters:
        defaults - the schema defaults for the containing schema
        Returns:
        the null indicator for the type