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)
TranslatorSource
get
in interface TranslatorSource
name
- name of translator (as configured, but case is ignored)public Translator getByType(Class valueType)
TranslatorSource
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).getByType
in interface TranslatorSource
valueType
- the type of value for which a default translator is neededpublic Translator findByType(Class valueType)
TranslatorSource
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).findByType
in interface TranslatorSource
valueType
- the type of value for which a default translator is needed5.6.3 - Copyright © 2003-2021 The Apache Software Foundation.