Interface ConversionHandler


  • @Deprecated
    public interface ConversionHandler
    Deprecated.
    A conversion handler adds admissible conversions between Java types whenever Velocity introspection has to map VTL methods and property accessors to Java methods. Both methods must be consistent: getNeededConverter must not return null whenever isExplicitlyConvertible returned true with the same arguments.
    Since:
    2.0
    Version:
    $Id: ConversionHandler.java $
    See Also:
    TypeConversionHandler
    • Method Summary

      All Methods Instance Methods Abstract Methods Deprecated Methods 
      Modifier and Type Method Description
      void addConverter​(java.lang.Class<?> formal, java.lang.Class<?> actual, Converter converter)
      Deprecated.
      Add the given converter to the handler.
      Converter getNeededConverter​(java.lang.Class<?> formal, java.lang.Class<?> actual)
      Deprecated.
      Returns the appropriate Converter object needed for an explicit conversion Returns null if no conversion is needed.
      boolean isExplicitlyConvertible​(java.lang.Class<?> formal, java.lang.Class<?> actual, boolean possibleVarArg)
      Deprecated.
      Check to see if the conversion can be done using an explicit conversion
    • Method Detail

      • isExplicitlyConvertible

        boolean isExplicitlyConvertible​(java.lang.Class<?> formal,
                                        java.lang.Class<?> actual,
                                        boolean possibleVarArg)
        Deprecated.
        Check to see if the conversion can be done using an explicit conversion
        Parameters:
        formal - expected formal type
        actual - provided argument type
        possibleVarArg - whether var arg is possible here
        Returns:
        null if no conversion is needed, or the appropriate Converter object
        Since:
        2.0
      • getNeededConverter

        Converter getNeededConverter​(java.lang.Class<?> formal,
                                     java.lang.Class<?> actual)
        Deprecated.
        Returns the appropriate Converter object needed for an explicit conversion Returns null if no conversion is needed.
        Parameters:
        formal - expected formal type
        actual - provided argument type
        Returns:
        null if no conversion is needed, or the appropriate Converter object
        Since:
        2.0
      • addConverter

        void addConverter​(java.lang.Class<?> formal,
                          java.lang.Class<?> actual,
                          Converter converter)
        Deprecated.
        Add the given converter to the handler. Implementation should be thread-safe.
        Parameters:
        formal - expected formal type
        actual - provided argument type
        converter - converter
        Since:
        2.0