Interface TranslatorSource

    • Method Detail

      • get

        Translator get​(java.lang.String name)
        Returns the translator with the given name (either a standard translator, or an alternate).
        Parameters:
        name - name of translator (as configured, but case is ignored)
        Returns:
        the shared translator instance
        Throws:
        java.lang.RuntimeException - if no translator is configured for the provided name
      • findByType

        Translator findByType​(java.lang.Class valueType)
        Finds a Translator that is appropriate to the given type, which is usually obtained via Binding.getBindingType(). Performs an inheritance-based search for the best match, among the standard translator (not alternates).
        Parameters:
        valueType - the type of value for which a default translator is needed
        Returns:
        the matching translator, or null if no match can be found
      • getByType

        Translator getByType​(java.lang.Class valueType)
        Finds a Translator that is appropriate to the given type, which is usually obtained via Binding.getBindingType(). Performs an inheritance-based search for the best match, among the standard translators (not alternates).
        Parameters:
        valueType - the type of value for which a default translator is needed
        Returns:
        the matching translator
        Throws:
        java.lang.IllegalArgumentException - if no standard validator matches the provided type