org.milyn.edi.unedifact.d02a.common.ProvisoDetails Maven / Gradle / Ivy
/**
* This class was generated by Smooks EJC (http://www.smooks.org).
*/
package org.milyn.edi.unedifact.d02a.common;
import java.io.Serializable;
import org.milyn.smooks.edi.EDIWritable;
import org.milyn.edi.unedifact.d02a.common.field.ProvisoTypeC971;
import org.milyn.edi.unedifact.d02a.common.field.ProvisoCalculationC972;
import java.io.Writer;
import org.milyn.edisax.model.internal.Delimiters;
import java.io.IOException;
import java.io.StringWriter;
import java.util.List;
import java.util.ArrayList;
import org.milyn.edisax.util.EDIUtils;
import org.milyn.edisax.model.internal.DelimiterType;
public class ProvisoDetails implements Serializable, EDIWritable {
private static final long serialVersionUID = 1L;
private String provisoCodeQualifier;
private ProvisoTypeC971 provisoType;
private ProvisoCalculationC972 provisoCalculation;
public void write(Writer writer, Delimiters delimiters) throws IOException {
Writer nodeWriter = new StringWriter();
List nodeTokens = new ArrayList();
if(provisoCodeQualifier != null) {
nodeWriter.write(delimiters.escape(provisoCodeQualifier.toString()));
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(provisoType != null) {
provisoType.write(nodeWriter, delimiters);
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(provisoCalculation != null) {
provisoCalculation.write(nodeWriter, delimiters);
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeTokens.add(nodeWriter.toString());
writer.write(EDIUtils.concatAndTruncate(nodeTokens, DelimiterType.FIELD, delimiters));
writer.write(delimiters.getSegmentDelimiter());
writer.flush();
}
public String getProvisoCodeQualifier() {
return provisoCodeQualifier;
}
public ProvisoDetails setProvisoCodeQualifier(String provisoCodeQualifier) {
this.provisoCodeQualifier = provisoCodeQualifier; return this;
}
public ProvisoTypeC971 getProvisoType() {
return provisoType;
}
public ProvisoDetails setProvisoType(ProvisoTypeC971 provisoType) {
this.provisoType = provisoType; return this;
}
public ProvisoCalculationC972 getProvisoCalculation() {
return provisoCalculation;
}
public ProvisoDetails setProvisoCalculation(ProvisoCalculationC972 provisoCalculation) {
this.provisoCalculation = provisoCalculation; return this;
}
}