Interface IStringConverter


  • public interface IStringConverter
    Convert to and from a string.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String TYPE_BASIC  
      static java.lang.String TYPE_JSON  
      static java.lang.String TYPE_XML  
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String convertObject​(java.lang.Object val, java.lang.Class<?> type, java.lang.ClassLoader cl, java.lang.Object context)
      Convert an object to a string.
      java.lang.Object convertString​(java.lang.String val, java.lang.Class<?> type, java.lang.ClassLoader cl, java.lang.Object context)
      Convert a string to an object.
      java.lang.String getType()
      Get the type of string that can be processed (xml, json, plain).
      boolean isSupportedType​(java.lang.Class<?> clazz)
      Test if the type can be converted.
    • Method Detail

      • convertString

        java.lang.Object convertString​(java.lang.String val,
                                       java.lang.Class<?> type,
                                       java.lang.ClassLoader cl,
                                       java.lang.Object context)
        Convert a string to an object.
        Parameters:
        val - The string.
        type - The target type.
        context - The context.
        Returns:
        The object.
      • convertObject

        java.lang.String convertObject​(java.lang.Object val,
                                       java.lang.Class<?> type,
                                       java.lang.ClassLoader cl,
                                       java.lang.Object context)
        Convert an object to a string.
        Parameters:
        val - The object.
        type - The encoding type.
        context - The context.
        Returns:
        The object.
      • getType

        java.lang.String getType()
        Get the type of string that can be processed (xml, json, plain).
        Returns:
        The object.
      • isSupportedType

        boolean isSupportedType​(java.lang.Class<?> clazz)
        Test if the type can be converted.
        Parameters:
        clazz - The class.
        Returns:
        True if can be converted.