public class TranslatorSourceImpl extends java.lang.Object implements TranslatorSource, java.lang.Runnable
Constructor and Description |
---|
TranslatorSourceImpl(java.util.Map<java.lang.Class,Translator> configuration) |
TranslatorSourceImpl(java.util.Map<java.lang.Class,Translator> configuration,
java.util.Map<java.lang.String,Translator> alternates) |
Modifier and Type | Method and Description |
---|---|
Translator |
findByType(java.lang.Class valueType)
Finds a
Translator that is appropriate to the given type, which is usually obtained via
Binding.getBindingType() . |
Translator |
get(java.lang.String name)
Returns the translator with the given name (either a standard translator, or an alternate).
|
Translator |
getByType(java.lang.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(java.util.Map<java.lang.Class,Translator> configuration)
public TranslatorSourceImpl(java.util.Map<java.lang.Class,Translator> configuration, java.util.Map<java.lang.String,Translator> alternates)
public Translator get(java.lang.String name)
TranslatorSource
get
in interface TranslatorSource
name
- name of translator (as configured, but case is ignored)public Translator getByType(java.lang.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(java.lang.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 neededpublic void run()
run
in interface java.lang.Runnable
${project.version} - Copyright © 2003-2015 The Apache Software Foundation.