org.milyn.edi.unedifact.d05a.UTILTS.SegmentGroup2 Maven / Gradle / Ivy
/**
* This class was generated by Smooks EJC (http://www.smooks.org).
*/
package org.milyn.edi.unedifact.d05a.UTILTS;
import java.io.Serializable;
import org.milyn.smooks.edi.EDIWritable;
import org.milyn.edi.unedifact.d05a.common.NameAndAddress;
import org.milyn.edi.unedifact.d05a.common.Reference;
import java.util.List;
import org.milyn.edi.unedifact.d05a.common.Attribute;
import java.io.Writer;
import org.milyn.edisax.model.internal.Delimiters;
import java.io.IOException;
public class SegmentGroup2 implements Serializable, EDIWritable {
private static final long serialVersionUID = 1L;
private NameAndAddress nameAndAddress;
private Reference reference;
private List attribute;
private List segmentGroup3;
public void write(Writer writer, Delimiters delimiters) throws IOException {
Writer nodeWriter = writer;
if(nameAndAddress != null) {
nodeWriter.write("NAD");
nodeWriter.write(delimiters.getField());
nameAndAddress.write(nodeWriter, delimiters);
}
if(reference != null) {
nodeWriter.write("RFF");
nodeWriter.write(delimiters.getField());
reference.write(nodeWriter, delimiters);
}
if(attribute != null && !attribute.isEmpty()) {
for(Attribute attributeInst : attribute) {
nodeWriter.write("ATT");
nodeWriter.write(delimiters.getField());
attributeInst.write(nodeWriter, delimiters);
}
}
if(segmentGroup3 != null && !segmentGroup3.isEmpty()) {
for(SegmentGroup3 segmentGroup3Inst : segmentGroup3) {
segmentGroup3Inst.write(nodeWriter, delimiters);
}
}
}
public NameAndAddress getNameAndAddress() {
return nameAndAddress;
}
public SegmentGroup2 setNameAndAddress(NameAndAddress nameAndAddress) {
this.nameAndAddress = nameAndAddress; return this;
}
public Reference getReference() {
return reference;
}
public SegmentGroup2 setReference(Reference reference) {
this.reference = reference; return this;
}
public List getAttribute() {
return attribute;
}
public SegmentGroup2 setAttribute(List attribute) {
this.attribute = attribute; return this;
}
public List getSegmentGroup3() {
return segmentGroup3;
}
public SegmentGroup2 setSegmentGroup3(List segmentGroup3) {
this.segmentGroup3 = segmentGroup3; return this;
}
}