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

org.milyn.edi.unedifact.d96a.COPRAR.Coprar Maven / Gradle / Ivy

There is a newer version: 1.7.1.0
Show newest version
/**
 * This class was generated by Smooks EJC (http://www.smooks.org).
 */
package org.milyn.edi.unedifact.d96a.COPRAR;

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

@EDIMessage    
public class Coprar implements Serializable, EDIWritable {

    private static final long serialVersionUID = 1L;

    private BeginningOfMessage beginningOfMessage;
    private List freeText;
    private List reference;
    private SegmentGroup1 segmentGroup1;
    private List segmentGroup2;
    private List segmentGroup3;
    private ControlTotal controlTotal;

    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(segmentGroup2 != null && !segmentGroup2.isEmpty()) {
            for(SegmentGroup2 segmentGroup2Inst : segmentGroup2) {
                segmentGroup2Inst.write(nodeWriter, delimiters);
            }
        }
        if(segmentGroup3 != null && !segmentGroup3.isEmpty()) {
            for(SegmentGroup3 segmentGroup3Inst : segmentGroup3) {
                segmentGroup3Inst.write(nodeWriter, delimiters);
            }
        }
        if(controlTotal != null) {
            nodeWriter.write("CNT");
            nodeWriter.write(delimiters.getField());
            controlTotal.write(nodeWriter, delimiters);
        }
    }

    public BeginningOfMessage getBeginningOfMessage() {
        return beginningOfMessage;
    }

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

    public List getFreeText() {
        return freeText;
    }

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

    public List getReference() {
        return reference;
    }

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

    public SegmentGroup1 getSegmentGroup1() {
        return segmentGroup1;
    }

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

    public List getSegmentGroup2() {
        return segmentGroup2;
    }

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

    public List getSegmentGroup3() {
        return segmentGroup3;
    }

    public Coprar setSegmentGroup3(List segmentGroup3) {
        this.segmentGroup3 = segmentGroup3;  return this;
    }

    public ControlTotal getControlTotal() {
        return controlTotal;
    }

    public Coprar setControlTotal(ControlTotal controlTotal) {
        this.controlTotal = controlTotal;  return this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy