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
ConstructorsConstructorDescriptionTLcdCompositeStringTranslator(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 availableILcdStringTranslatorinstances marked with theLcdServiceannotation.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-Iterableof string translators
-
-
Method Details
-
translate
Description copied from interface:ILcdStringTranslatorReturns the translation of the given string.- Specified by:
translatein interfaceILcdStringTranslator- Parameters:
aOriginalString- The string to translate.- Returns:
- The translated string
-
createFromServices
Create a composite string translator containing all the availableILcdStringTranslatorinstances marked with theLcdServiceannotation. More information can be found in the services mechanism tutorial.- Returns:
- a composite string translator.
-