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

org.milyn.edi.unedifact.d94b.IFTDGN.Iftdgn Maven / Gradle / Ivy

/**
 * This class was generated by Smooks EJC (http://www.smooks.org).
 */
package org.milyn.edi.unedifact.d94b.IFTDGN;

import java.io.Serializable;    
import org.milyn.smooks.edi.EDIWritable;    
import org.milyn.smooks.edi.EDIMessage;    
import org.milyn.edi.unedifact.d94b.common.BeginningOfMessage;    
import java.util.List;    
import org.milyn.edi.unedifact.d94b.common.FreeText;    
import org.milyn.edi.unedifact.d94b.common.Reference;    
import org.milyn.edi.unedifact.d94b.common.NameAndAddress;    
import java.io.Writer;    
import org.milyn.edisax.model.internal.Delimiters;    
import java.io.IOException;    

@EDIMessage    
public class Iftdgn implements Serializable, EDIWritable {

    private static final long serialVersionUID = 1L;

    private BeginningOfMessage beginningOfMessage;
    private List freeText;
    private List reference;
    private SegmentGroup1 segmentGroup1;
    private List nameAndAddress;
    private List segmentGroup2;

    public void write(Writer writer, Delimiters delimiters) throws IOException {
        
        Writer nodeWriter = writer;

        if(beginningOfMessage != null) {
            nodeWriter.write("BGM");
            nodeWriter.write(delimiters.getField());
            beginningOfMessage.write(nodeWriter, delimiters);
        }
        if(freeText != null && !freeText.isEmpty()) {
            for(FreeText freeTextInst : freeText) {
                nodeWriter.write("FTX");
                nodeWriter.write(delimiters.getField());
                freeTextInst.write(nodeWriter, delimiters);
            }
        }
        if(reference != null && !reference.isEmpty()) {
            for(Reference referenceInst : reference) {
                nodeWriter.write("RFF");
                nodeWriter.write(delimiters.getField());
                referenceInst.write(nodeWriter, delimiters);
            }
        }
        if(segmentGroup1 != null) {
            segmentGroup1.write(nodeWriter, delimiters);
        }
        if(nameAndAddress != null && !nameAndAddress.isEmpty()) {
            for(NameAndAddress nameAndAddressInst : nameAndAddress) {
                nodeWriter.write("NAD");
                nodeWriter.write(delimiters.getField());
                nameAndAddressInst.write(nodeWriter, delimiters);
            }
        }
        if(segmentGroup2 != null && !segmentGroup2.isEmpty()) {
            for(SegmentGroup2 segmentGroup2Inst : segmentGroup2) {
                segmentGroup2Inst.write(nodeWriter, delimiters);
            }
        }
    }

    public BeginningOfMessage getBeginningOfMessage() {
        return beginningOfMessage;
    }

    public Iftdgn setBeginningOfMessage(BeginningOfMessage beginningOfMessage) {
        this.beginningOfMessage = beginningOfMessage;  return this;
    }

    public List getFreeText() {
        return freeText;
    }

    public Iftdgn setFreeText(List freeText) {
        this.freeText = freeText;  return this;
    }

    public List getReference() {
        return reference;
    }

    public Iftdgn setReference(List reference) {
        this.reference = reference;  return this;
    }

    public SegmentGroup1 getSegmentGroup1() {
        return segmentGroup1;
    }

    public Iftdgn setSegmentGroup1(SegmentGroup1 segmentGroup1) {
        this.segmentGroup1 = segmentGroup1;  return this;
    }

    public List getNameAndAddress() {
        return nameAndAddress;
    }

    public Iftdgn setNameAndAddress(List nameAndAddress) {
        this.nameAndAddress = nameAndAddress;  return this;
    }

    public List getSegmentGroup2() {
        return segmentGroup2;
    }

    public Iftdgn setSegmentGroup2(List segmentGroup2) {
        this.segmentGroup2 = segmentGroup2;  return this;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy