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

com.tectonica.jonix.onix2.NewSupplier Maven / Gradle / Ivy

There is a newer version: 2024-10-onix308-fix
Show newest version
/*
 * Copyright (C) 2012 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.onix2;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import com.tectonica.jonix.JPU;
import com.tectonica.jonix.OnixComposite.OnixSuperComposite;
import com.tectonica.jonix.codelist.LanguageCodes;
import com.tectonica.jonix.codelist.RecordSourceTypes;
import com.tectonica.jonix.codelist.SupplierIdentifierTypes;
import com.tectonica.jonix.codelist.TextCaseFlags;
import com.tectonica.jonix.codelist.TextFormats;
import com.tectonica.jonix.codelist.TransliterationSchemes;
import com.tectonica.jonix.struct.JonixSupplierIdentifier;

/*
 * NOTE: THIS IS AN AUTO-GENERATED FILE, DON'T EDIT MANUALLY
 */

/**
 * 

New supplier composite

*

* A group of data elements which together specify a new supply source to which orders are referred. Use only when the * code in <ProductAvailability> or <AvailabilityCode> indicates “no longer available from us, refer to new * supplier”. Only one occurrence of the composite is permitted in this context. *

* * * * * * * * * *
Reference name<NewSupplier>
Short tag<newsupplier>
*/ public class NewSupplier implements OnixSuperComposite, Serializable { private static final long serialVersionUID = 1L; public static final String refname = "NewSupplier"; public static final String shortname = "newsupplier"; // /////////////////////////////////////////////////////////////////////////////// // ATTRIBUTES // /////////////////////////////////////////////////////////////////////////////// public TextFormats textformat; public TextCaseFlags textcase; public LanguageCodes language; public TransliterationSchemes transliteration; /** * (type: DateOrDateTime) */ public String datestamp; public RecordSourceTypes sourcetype; public String sourcename; // /////////////////////////////////////////////////////////////////////////////// // MEMBERS // /////////////////////////////////////////////////////////////////////////////// /** * (this list may be empty) */ public List supplierIdentifiers; /** * (this field is optional) */ public SupplierSAN supplierSAN; /** * (this field is required) */ public SupplierEANLocationNumber supplierEANLocationNumber; /** * (this field is optional) */ public SupplierName supplierName; /** * (this list may be empty) */ public List telephoneNumbers; /** * (this list may be empty) */ public List faxNumbers; /** * (this list may be empty) */ public List emailAddresss; // /////////////////////////////////////////////////////////////////////////////// // SERVICES // /////////////////////////////////////////////////////////////////////////////// public NewSupplier() {} public NewSupplier(org.w3c.dom.Element element) { textformat = TextFormats.byCode(JPU.getAttribute(element, "textformat")); textcase = TextCaseFlags.byCode(JPU.getAttribute(element, "textcase")); language = LanguageCodes.byCode(JPU.getAttribute(element, "language")); transliteration = TransliterationSchemes.byCode(JPU.getAttribute(element, "transliteration")); datestamp = JPU.getAttribute(element, "datestamp"); sourcetype = RecordSourceTypes.byCode(JPU.getAttribute(element, "sourcetype")); sourcename = JPU.getAttribute(element, "sourcename"); JPU.forElementsOf(element, new JPU.ElementListener() { @Override public void onElement(org.w3c.dom.Element element) { final String name = element.getNodeName(); if (name.equals(SupplierIdentifier.refname) || name.equals(SupplierIdentifier.shortname)) supplierIdentifiers = JPU.addToList(supplierIdentifiers, new SupplierIdentifier(element)); else if (name.equals(SupplierSAN.refname) || name.equals(SupplierSAN.shortname)) supplierSAN = new SupplierSAN(element); else if (name.equals(SupplierEANLocationNumber.refname) || name.equals(SupplierEANLocationNumber.shortname)) supplierEANLocationNumber = new SupplierEANLocationNumber(element); else if (name.equals(SupplierName.refname) || name.equals(SupplierName.shortname)) supplierName = new SupplierName(element); else if (name.equals(TelephoneNumber.refname) || name.equals(TelephoneNumber.shortname)) telephoneNumbers = JPU.addToList(telephoneNumbers, new TelephoneNumber(element)); else if (name.equals(FaxNumber.refname) || name.equals(FaxNumber.shortname)) faxNumbers = JPU.addToList(faxNumbers, new FaxNumber(element)); else if (name.equals(EmailAddress.refname) || name.equals(EmailAddress.shortname)) emailAddresss = JPU.addToList(emailAddresss, new EmailAddress(element)); } }); } /** * Raw Format: Fixed-length, seven characters. The first six are numeric digits, and the seventh is a check * character which may be a numeric digit or letter X. */ public String getSupplierSANValue() { return (supplierSAN == null) ? null : supplierSAN.value; } /** * Raw Format: Fixed-length, thirteen numeric digits, of which the last is a check digit. */ public String getSupplierEANLocationNumberValue() { return (supplierEANLocationNumber == null) ? null : supplierEANLocationNumber.value; } /** * Raw Format: Variable-length text, suggested maximum length 100 characters */ public String getSupplierNameValue() { return (supplierName == null) ? null : supplierName.value; } /** * Raw Format: Variable-length text, suggested maximum length 20 characters */ public List getTelephoneNumberValues() { if (telephoneNumbers != null) { List list = new ArrayList<>(); for (TelephoneNumber i : telephoneNumbers) list.add(i.value); return list; } return null; } /** * Raw Format: Variable-length text, suggested maximum length 20 characters */ public List getFaxNumberValues() { if (faxNumbers != null) { List list = new ArrayList<>(); for (FaxNumber i : faxNumbers) list.add(i.value); return list; } return null; } /** * Raw Format: Variable-length text, suggested maximum length 100 characters */ public List getEmailAddressValues() { if (emailAddresss != null) { List list = new ArrayList<>(); for (EmailAddress i : emailAddresss) list.add(i.value); return list; } return null; } public JonixSupplierIdentifier findSupplierIdentifier(SupplierIdentifierTypes supplierIDType) { if (supplierIdentifiers != null) { for (SupplierIdentifier x : supplierIdentifiers) { if (x.getSupplierIDTypeValue() == supplierIDType) return x.asJonixSupplierIdentifier(); } } return null; } public List findSupplierIdentifiers(java.util.Set supplierIDTypes) { if (supplierIdentifiers != null) { List matches = new ArrayList<>(); for (SupplierIdentifier x : supplierIdentifiers) { if (supplierIDTypes == null || supplierIDTypes.contains(x.getSupplierIDTypeValue())) matches.add(x.asJonixSupplierIdentifier()); } return matches; } return null; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy