Interface TypeHandler

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String NIL
      This constant can be returned from format(Object) for XML formatted streams to indicate a nillable element should be set to nil even if the field's minimum occurrences is zero.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String format​(java.lang.Object value)
      Formats a Java object into field text.
      java.lang.Class<?> getType()
      Returns the class type supported by this handler.
      java.lang.Object parse​(java.lang.String text)
      Parses field text into a Java object.
    • Field Detail

      • NIL

        static final java.lang.String NIL
        This constant can be returned from format(Object) for XML formatted streams to indicate a nillable element should be set to nil even if the field's minimum occurrences is zero. In all other cases, if NIL is returned, the formatted value is treated as null.
    • Method Detail

      • parse

        java.lang.Object parse​(java.lang.String text)
                        throws TypeConversionException
        Parses field text into a Java object.
        Parameters:
        text - the field text to parse, which may be null if the field was not passed in the record
        Returns:
        the parsed Java object
        Throws:
        TypeConversionException - if the text cannot be parsed
      • format

        java.lang.String format​(java.lang.Object value)
        Formats a Java object into field text.
        Parameters:
        value - the Java object to format, which may be null
        Returns:
        the formatted field text, or null to indicate the value is not present, or NIL for XML formatted streams
      • getType

        java.lang.Class<?> getType()
        Returns the class type supported by this handler. Primitive types should not be returned by this method- use the object equivalent instead.
        Returns:
        the class type supported by this handler