Package com.luciad.util
Class TLcdCompositeStringTranslator
java.lang.Object
com.luciad.util.TLcdCompositeStringTranslator
- All Implemented Interfaces:
ILcdStringTranslator
Composite implementation of
ILcdStringTranslator
.
Any number of string translators can be added to this composite.
Example usage:
To create a composite instance which uses all default available ILcdStringTranslator
instances, you can use:
ILcdStringTranslator stringTranslator = TLcdCompositeStringTranslator.createFromServices();
This will use all string translators annotated with the @LcdService
annotation.
- Since:
- 2019.1
-
Constructor Summary
ConstructorDescriptionTLcdCompositeStringTranslator
(Iterable<ILcdStringTranslator> aStringTranslators) Creates a new composite string translator for the given string translators.TLcdCompositeStringTranslator
(List<ILcdStringTranslator> aStringTranslators) Creates a new composite string translator for the given string translators. -
Method Summary
Modifier and TypeMethodDescriptionCreate a composite string translator containing all the availableILcdStringTranslator
instances marked with theLcdService
annotation.Returns the translation of the given string.
-
Constructor Details
-
TLcdCompositeStringTranslator
Creates a new composite string translator for the given string translators.- Parameters:
aStringTranslators
- list of string translators
-
TLcdCompositeStringTranslator
Creates a new composite string translator for the given string translators.- Parameters:
aStringTranslators
-Iterable
of string translators
-
-
Method Details
-
translate
Description copied from interface:ILcdStringTranslator
Returns the translation of the given string.- Specified by:
translate
in interfaceILcdStringTranslator
- Parameters:
aOriginalString
- The string to translate.- Returns:
- The translated string
-
createFromServices
Create a composite string translator containing all the availableILcdStringTranslator
instances marked with theLcdService
annotation. More information can be found in the services mechanism tutorial.- Returns:
- a composite string translator.
-