Class ElementConverterUtils
java.lang.Object
com.aquima.interactions.framework.renderer.util.ElementConverterUtils
This class provides various utility methods which help converting multilingual objects to xml.
- Since:
- 6.0
- Author:
- F. van der Meer
-
Method Summary
Modifier and TypeMethodDescriptionstatic IXmlElement
createErrorMessages
(IRendererContext ctx, IMessage[] messages) This method may be used create an error XML element for the specified array of messages.static String
getDisplayText
(IRendererContext ctx, IPrimitiveValue domainValue) This method returns the display value that should be used for the specified primitive value.static String
getMultilingualText
(IRendererContext ctx, IMultilingualText multilingualText, String defaultText) This method may be used to retrieve the display text for the current language.static IDomainValue[]
sortDomainValues
(boolean sortDomainValues, IDomainValue[] domainValues) Helper method to sort domain values (case insensitive) by its short value.
-
Method Details
-
getDisplayText
This method returns the display value that should be used for the specified primitive value.- Parameters:
ctx
- The current renderer context containing the language settings.domainValue
- The value for which the display text is requested.- Returns:
- The display text for the specified value.
-
createErrorMessages
This method may be used create an error XML element for the specified array of messages.- Parameters:
ctx
- The current renderer context containing the language settings.messages
- The array of messages that should be converted to an XML element.- Returns:
- The XML element for the array of messages.
-
getMultilingualText
public static String getMultilingualText(IRendererContext ctx, IMultilingualText multilingualText, String defaultText) This method may be used to retrieve the display text for the current language.- Parameters:
ctx
- The current renderer context containing the language settings.multilingualText
- The text object containing the values.defaultText
- The default text that should be used when the text object did not supply a value.- Returns:
- The text that should be used.
-
sortDomainValues
public static IDomainValue[] sortDomainValues(boolean sortDomainValues, IDomainValue[] domainValues) Helper method to sort domain values (case insensitive) by its short value.- Parameters:
sortDomainValues
- When false, no sorting is done.domainValues
- The domain values to sort.- Returns:
- Sorted domain values.
-