All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.tectonica.jonix.onix3.FromLanguage Maven / Gradle / Ivy

/*
 * Copyright (C) 2012-2024 Zach Melamed
 *
 * Latest version available online at https://github.com/zach-m/jonix
 * Contact me at [email protected]
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.tectonica.jonix.onix3;

import com.tectonica.jonix.common.JPU;
import com.tectonica.jonix.common.OnixElement;
import com.tectonica.jonix.common.codelist.Languages;
import com.tectonica.jonix.common.codelist.RecordSourceTypes;

import java.io.Serializable;
import java.util.function.Consumer;

/*
 * NOTE: THIS IS AN AUTO-GENERATED FILE, DO NOT EDIT MANUALLY
 */

/**
 * 

Source language of a translation

*

* Used only when the <ContributorRole> code value is B06, B08 or B10 indicating a translator, to specify the * source language from which the translation was made. This element makes it possible to specify a translator’s exact * responsibility when a work involves translation from two or more languages. Optional, and repeatable in the event * that a single person has been responsible for translation from two or more languages. *

* * * * * * * * * * * * * * * * * * * * * * * * * *
FormatFixed length, three lower-case letters. Note that ISO 639 specifies that these codes should always be in * lower-case
CodelistISO 639-2/B List 74
Reference name<FromLanguage>
Short tag<x412>
Cardinality0…n
Example<FromLanguage>eng</FromLanguage>
*

* This tag may be included in the following composites: *

    *
  • <{@link Contributor}>
  • *
*

* Possible placements within ONIX message: *

    *
  • {@link Product} ⯈ {@link DescriptiveDetail} ⯈ {@link Contributor} ⯈ {@link FromLanguage}
  • *
  • {@link Product} ⯈ {@link ContentDetail} ⯈ {@link ContentItem} ⯈ {@link Contributor} ⯈ {@link FromLanguage}
  • *
  • {@link Product} ⯈ {@link PromotionDetail} ⯈ {@link PromotionalEvent} ⯈ {@link Contributor} ⯈ * {@link FromLanguage}
  • *
  • {@link Product} ⯈ {@link DescriptiveDetail} ⯈ {@link Collection} ⯈ {@link Contributor} ⯈ * {@link FromLanguage}
  • *
*/ public class FromLanguage implements OnixElement, Serializable { private static final long serialVersionUID = 1L; public static final String refname = "FromLanguage"; public static final String shortname = "x412"; ///////////////////////////////////////////////////////////////////////////////// // ATTRIBUTES ///////////////////////////////////////////////////////////////////////////////// /** * (type: dt.DateOrDateTime) */ public String datestamp; /** * (type: dt.NonEmptyString) */ public String sourcename; public RecordSourceTypes sourcetype; ///////////////////////////////////////////////////////////////////////////////// // VALUE MEMBER ///////////////////////////////////////////////////////////////////////////////// public Languages value; /** * Internal API, use the {@link #value()} method or the {@link #value} field instead */ @Override public Languages __v() { return value; } ///////////////////////////////////////////////////////////////////////////////// // SERVICES ///////////////////////////////////////////////////////////////////////////////// private final boolean exists; public static final FromLanguage EMPTY = new FromLanguage(); public FromLanguage() { exists = false; } public FromLanguage(org.w3c.dom.Element element) { exists = true; datestamp = JPU.getAttribute(element, "datestamp"); sourcename = JPU.getAttribute(element, "sourcename"); sourcetype = RecordSourceTypes.byCode(JPU.getAttribute(element, "sourcetype")); value = Languages.byCode(JPU.getContentAsString(element)); } /** * @return whether this tag (<FromLanguage> or <x412>) is explicitly provided in the ONIX XML */ @Override public boolean exists() { return exists; } public void ifExists(Consumer action) { if (exists) { action.accept(this); } } public String codeOrNull() { return value == null ? null : value.code; } public String descriptionOrNull() { return value == null ? null : value.description; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy