public class TranslatorSourceImpl extends Object implements TranslatorSource, Runnable
| Constructor and Description |
|---|
TranslatorSourceImpl(Map<Class,Translator> configuration) |
TranslatorSourceImpl(Map<Class,Translator> configuration,
Map<String,Translator> alternates) |
| Modifier and Type | Method and Description |
|---|---|
Translator |
findByType(Class valueType)
Finds a
Translator that is appropriate to the given type, which is usually obtained via
Binding.getBindingType(). |
Translator |
get(String name)
Returns the translator with the given name (either a standard translator, or an alternate).
|
Translator |
getByType(Class valueType)
Finds a
Translator that is appropriate to the given type, which is usually obtained via
Binding.getBindingType(). |
void |
run()
Invoked by InvalidationEventHub
|
public TranslatorSourceImpl(Map<Class,Translator> configuration)
public TranslatorSourceImpl(Map<Class,Translator> configuration, Map<String,Translator> alternates)
public Translator get(String name)
TranslatorSourceget in interface TranslatorSourcename - name of translator (as configured, but case is ignored)public Translator getByType(Class valueType)
TranslatorSourceTranslator 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).getByType in interface TranslatorSourcevalueType - the type of value for which a default translator is neededpublic Translator findByType(Class valueType)
TranslatorSourceTranslator 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).findByType in interface TranslatorSourcevalueType - the type of value for which a default translator is needed5.6.4 - Copyright © 2003-2021 The Apache Software Foundation.