XmlI18nStringTranslation.java

package dev.orne.i18n.jaxb;

/*-
 * #%L
 * Orne I18N
 * %%
 * Copyright (C) 2021 Orne Developments
 * %%
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Lesser Public License for more details.
 * 
 * You should have received a copy of the GNU General Lesser Public
 * License along with this program.  If not, see
 * <http://www.gnu.org/licenses/lgpl-3.0.html>.
 * #L%
 */

import java.io.Serializable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlValue;

import org.apiguardian.api.API;
import org.apiguardian.api.API.Status;

import dev.orne.i18n.I18nString;
import dev.orne.i18n.I18nXmlSchema;

/**
 * XML representation of I18N string translation.
 * <p>
 * This class is based on class generated by JAXB Reference Implementation
 * v2.3.2, but modified to correct deficiencies caused by
 * <a href="https://github.com/eclipse-ee4j/jaxb-ri/issues/1108">Issue 1108</a>.
 * <p>The following schema fragment specifies the expected content contained
 * within this class.
 * <pre>
 * &lt;complexType name="translation"&gt;
 *   &lt;simpleContent&gt;
 *     &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema&gt;string"&gt;
 *       &lt;attribute name="lang" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
 *     &lt;/extension&gt;
 *   &lt;/simpleContent&gt;
 * &lt;/complexType&gt;
 * </pre>
 * 
 * @author <a href="https://github.com/ihernaez">(w) Iker Hernaez</a>
 * @version 1.0, 2021-02
 * @see I18nString
 * @see <a href="https://github.com/eclipse-ee4j/jaxb-ri/issues/1108">JAXB RI Issue 1108</a>
 * @since 0.1
 */
@API(status=Status.INTERNAL, since="0.1")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(
        name=I18nXmlSchema.TRANSLATION_TYPE,
        namespace=I18nXmlSchema.NS,
        propOrder = {
            "value"
        })
@XmlRootElement(
        name=I18nXmlSchema.TRANSLATION_ELEMENT,
        namespace=I18nXmlSchema.NS)
public class XmlI18nStringTranslation
implements Serializable {

    /** The serial version UID. */
    private static final long serialVersionUID = 1L;

    /** The translation language. */
    @XmlAttribute(name=I18nXmlSchema.TRANSLATION_LANG_ATTR, required=true)
    protected String lang;
    /** The translation text. */
    @XmlValue
    protected String value;

    /**
     * Creates a new instance.
     */
    public XmlI18nStringTranslation() {
        super();
    }

    /**
     * Gets the translation language.
     * 
     * @return The translation language
     */
    public String getLang() {
        return this.lang;
    }

    /**
     * Sets the translation language.
     * 
     * @param value The translation language
     */
    public void setLang(final String value) {
        this.lang = value;
    }

    /**
     * Gets the translation text.
     * 
     * @return The translation text
     */
    public String getValue() {
        return value;
    }

    /**
     * Sets the translation text.
     * 
     * @param value The translation text
     */
    public void setValue(String value) {
        this.value = value;
    }
}