Class TextConversionDefaults


  • public final class TextConversionDefaults
    extends Object
    Describes behaviors used during conversion of token values to and from text. These settings are typically used to describe default behavior for a schema. Text types are not required to honor any of these settings. The default behavior for text type processing is:
    • Null values are indicated by an empty string ("").
    • String-valued types do not perform whitespace trimming and tread the empty string as a null value.
    • Field Detail

      • DEFAULT_NULL_MARKER

        public static final String DEFAULT_NULL_MARKER
        The default text value used to indicate a null value, the empty string ("").
        See Also:
        Constant Field Values
    • Constructor Detail

      • TextConversionDefaults

        public TextConversionDefaults()
        Creates a descriptor specifying default behavior.
      • TextConversionDefaults

        public TextConversionDefaults​(String nullIndicator)
        Creates a descriptor having the specified null indicator. All other behavior is default.
        Parameters:
        nullIndicator - the string used to represent a null value
      • TextConversionDefaults

        public TextConversionDefaults​(TextTypes.StringConversion behavior)
        Creates a descriptor having the specified string processing behavior. All other behavior is default.
        Parameters:
        behavior - indicates how string-valued type should be converted from text
      • TextConversionDefaults

        public TextConversionDefaults​(String nullIndicator,
                                      TextTypes.StringConversion behavior)
        Creates a descriptor having the specified behavior.
        Parameters:
        nullIndicator - the string used to represent a null value
        behavior - indicates how string-valued type should be converted from text
    • Method Detail

      • getNullIndicator

        public String getNullIndicator()
        Gets the text value used to represent null values.
        Returns:
        the string indicating a null value
      • applyDefaultNullMarker

        public String applyDefaultNullMarker​(String value)
        Merges the given null indicator with the default.
        Parameters:
        value - the input null indicator
        Returns:
        value if value != null, otherwise the null indicator value in the defaults
      • setNullIndicator

        public void setNullIndicator​(String value)
        Sets the text value used to represent null values.
        Parameters:
        value - the string used to indicate a null value
      • getStringHandling

        public TextTypes.StringConversion getStringHandling()
        Gets the behavior for processing string-valued types.
        Returns:
        how string-valued types should be converted from text
      • setStringHandling

        public void setStringHandling​(TextTypes.StringConversion behavior)
        Sets the behavior for processing string-valued types.
        Parameters:
        behavior - indicates how string-valued types should be converted from text
      • applyDefaultStringHandling

        public TextTypes.StringConversion applyDefaultStringHandling​(TextTypes.StringConversion value)
        Merges the given string conversion behavior with the default.
        Parameters:
        value - the input string conversion behavior
        Returns:
        value if value != null, otherwise the string conversion behavior in the defaults
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object