Class TranslatorSourceImpl
java.lang.Object
org.apache.tapestry5.internal.services.TranslatorSourceImpl
- All Implemented Interfaces:
Runnable,TranslatorSource
-
Constructor Summary
ConstructorsConstructorDescriptionTranslatorSourceImpl(Map<Class, Translator> configuration) TranslatorSourceImpl(Map<Class, Translator> configuration, Map<String, Translator> alternates) -
Method Summary
Modifier and TypeMethodDescriptionfindByType(Class valueType) Finds aTranslatorthat is appropriate to the given type, which is usually obtained viaBinding.getBindingType().Returns the translator with the given name (either a standard translator, or an alternate).Finds aTranslatorthat is appropriate to the given type, which is usually obtained viaBinding.getBindingType().voidrun()Invoked by InvalidationEventHub
-
Constructor Details
-
TranslatorSourceImpl
-
TranslatorSourceImpl
-
-
Method Details
-
get
Description copied from interface:TranslatorSourceReturns the translator with the given name (either a standard translator, or an alternate).- Specified by:
getin interfaceTranslatorSource- Parameters:
name- name of translator (as configured, but case is ignored)- Returns:
- the shared translator instance
-
getByType
Description copied from interface:TranslatorSourceFinds aTranslatorthat is appropriate to the given type, which is usually obtained viaBinding.getBindingType(). Performs an inheritance-based search for the best match, among the standard translators (not alternates).- Specified by:
getByTypein interfaceTranslatorSource- Parameters:
valueType- the type of value for which a default translator is needed- Returns:
- the matching translator
-
findByType
Description copied from interface:TranslatorSourceFinds aTranslatorthat is appropriate to the given type, which is usually obtained viaBinding.getBindingType(). Performs an inheritance-based search for the best match, among the standard translator (not alternates).- Specified by:
findByTypein interfaceTranslatorSource- 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
-
run
Invoked by InvalidationEventHub
-