Class JaxbUtils

java.lang.Object
dev.orne.i18n.jaxb.JaxbUtils

@API(status=INTERNAL, since="0.1") public final class JaxbUtils extends Object
Utility class for Jakarta XML Binding (JAXB)
Since:
0.1
Version:
1.0, 2021-10
Author:
(w) Iker Hernaez
  • Method Details

    • toXml

      public static XmlI18nString toXml(I18nString value)
      Converts the specified I18nString to XmlI18NString containing only the current language translation.
      Parameters:
      value - The I18nString to convert
      Returns:
      The XmlI18NString to marshall
    • toFullXml

      public static XmlI18nString toFullXml(I18nString value)
      Converts the specified I18nString to XmlI18NString containing all the available translations. Calls I18nString.asMap() to retrieve the full translations version.
      Parameters:
      value - The I18nString to convert
      Returns:
      The XmlI18NString to marshall
    • fromXml

      @NotNull public static @NotNull I18nString fromXml(@NotNull @NotNull XmlI18nString value)
      Converts the specified XmlI18NString to I18nString. If XmlI18NString contains XmlI18NStringTranslation instances a I18nStringMap is returned. Otherwise a I18nFixedString is returned.
      Parameters:
      value - The XmlI18NString to convert
      Returns:
      The equivalent I18nString