|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@UsesMappedConfiguration(key=java.lang.Class.class, value=Translator.class) public interface TranslatorSource
A source for Translator
s, either by name or by property type. The source knows
about two sets of translators: the standard translators contributed directly to the service
and the alternate translators, contributed to the TranslatorAlternatesSource
service.
Generally, Translators are matched by type (i.e., the type matching a particular property that will be read or
updated). Contributions to this service use a StrategyRegistry
to match by type. Translators can also be
selected by name. The TranslatorAlternatesSource
service configuration is often used for this purpose.
The contribution key must match the translator type.
Method Summary | |
---|---|
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() . |
Method Detail |
---|
Translator get(String name)
name
- name of translator (as configured, but case is ignored)
RuntimeException
- if no translator is configured for the provided nameTranslator findByType(Class valueType)
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).
valueType
- the type of value for which a default translator is needed
Translator getByType(Class valueType)
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).
valueType
- the type of value for which a default translator is needed
IllegalArgumentException
- if no standard validator matches the provided type
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |