Package dev.orne.i18n.jaxb
Class JaxbUtils
java.lang.Object
dev.orne.i18n.jaxb.JaxbUtils
Utility class for Jakarta XML Binding (JAXB)
- Since:
- 0.1
- Version:
- 1.0, 2021-10
- Author:
- (w) Iker Hernaez
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull I18nString
fromXml
(@NotNull XmlI18nString value) Converts the specifiedXmlI18NString
toI18nString
.static XmlI18nString
toFullXml
(I18nString value) Converts the specifiedI18nString
toXmlI18NString
containing all the available translations.static XmlI18nString
toXml
(I18nString value) Converts the specifiedI18nString
toXmlI18NString
containing only the current language translation.
-
Method Details
-
toXml
Converts the specifiedI18nString
toXmlI18NString
containing only the current language translation.- Parameters:
value
- TheI18nString
to convert- Returns:
- The
XmlI18NString
to marshall
-
toFullXml
Converts the specifiedI18nString
toXmlI18NString
containing all the available translations. CallsI18nString.asMap()
to retrieve the full translations version.- Parameters:
value
- TheI18nString
to convert- Returns:
- The
XmlI18NString
to marshall
-
fromXml
Converts the specifiedXmlI18NString
toI18nString
. IfXmlI18NString
containsXmlI18NStringTranslation
instances aI18nStringMap
is returned. Otherwise aI18nFixedString
is returned.- Parameters:
value
- TheXmlI18NString
to convert- Returns:
- The equivalent
I18nString
-