org.milyn.edi.unedifact.d96a.common.DangerousGoods Maven / Gradle / Ivy
/**
* This class was generated by Smooks EJC (http://www.smooks.org).
*/
package org.milyn.edi.unedifact.d96a.common;
import java.io.Serializable;
import org.milyn.smooks.edi.EDIWritable;
import org.milyn.edi.unedifact.d96a.common.field.HazardCodeC205;
import org.milyn.edi.unedifact.d96a.common.field.UndgInformationC234;
import org.milyn.edi.unedifact.d96a.common.field.DangerousGoodsShipmentFlashpointC223;
import org.milyn.edi.unedifact.d96a.common.field.HazardIdentificationC235;
import org.milyn.edi.unedifact.d96a.common.field.DangerousGoodsLabelC236;
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 DangerousGoods implements Serializable, EDIWritable {
private static final long serialVersionUID = 1L;
private String dangerousGoodsRegulationsCoded;
private HazardCodeC205 hazardCode;
private UndgInformationC234 undgInformation;
private DangerousGoodsShipmentFlashpointC223 dangerousGoodsShipmentFlashpoint;
private String packingGroupCoded;
private String eMSNumber;
private String mfag;
private String tremCardNumber;
private HazardIdentificationC235 hazardIdentification;
private DangerousGoodsLabelC236 dangerousGoodsLabel;
private String packingInstructionCoded;
private String categoryOfMeansOfTransportCoded;
private String permissionForTransportCoded;
public void write(Writer writer, Delimiters delimiters) throws IOException {
Writer nodeWriter = new StringWriter();
List nodeTokens = new ArrayList();
if(dangerousGoodsRegulationsCoded != null) {
nodeWriter.write(delimiters.escape(dangerousGoodsRegulationsCoded.toString()));
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(hazardCode != null) {
hazardCode.write(nodeWriter, delimiters);
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(undgInformation != null) {
undgInformation.write(nodeWriter, delimiters);
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(dangerousGoodsShipmentFlashpoint != null) {
dangerousGoodsShipmentFlashpoint.write(nodeWriter, delimiters);
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(packingGroupCoded != null) {
nodeWriter.write(delimiters.escape(packingGroupCoded.toString()));
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(eMSNumber != null) {
nodeWriter.write(delimiters.escape(eMSNumber.toString()));
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(mfag != null) {
nodeWriter.write(delimiters.escape(mfag.toString()));
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(tremCardNumber != null) {
nodeWriter.write(delimiters.escape(tremCardNumber.toString()));
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(hazardIdentification != null) {
hazardIdentification.write(nodeWriter, delimiters);
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(dangerousGoodsLabel != null) {
dangerousGoodsLabel.write(nodeWriter, delimiters);
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(packingInstructionCoded != null) {
nodeWriter.write(delimiters.escape(packingInstructionCoded.toString()));
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(categoryOfMeansOfTransportCoded != null) {
nodeWriter.write(delimiters.escape(categoryOfMeansOfTransportCoded.toString()));
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(permissionForTransportCoded != null) {
nodeWriter.write(delimiters.escape(permissionForTransportCoded.toString()));
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 getDangerousGoodsRegulationsCoded() {
return dangerousGoodsRegulationsCoded;
}
public DangerousGoods setDangerousGoodsRegulationsCoded(String dangerousGoodsRegulationsCoded) {
this.dangerousGoodsRegulationsCoded = dangerousGoodsRegulationsCoded; return this;
}
public HazardCodeC205 getHazardCode() {
return hazardCode;
}
public DangerousGoods setHazardCode(HazardCodeC205 hazardCode) {
this.hazardCode = hazardCode; return this;
}
public UndgInformationC234 getUndgInformation() {
return undgInformation;
}
public DangerousGoods setUndgInformation(UndgInformationC234 undgInformation) {
this.undgInformation = undgInformation; return this;
}
public DangerousGoodsShipmentFlashpointC223 getDangerousGoodsShipmentFlashpoint() {
return dangerousGoodsShipmentFlashpoint;
}
public DangerousGoods setDangerousGoodsShipmentFlashpoint(DangerousGoodsShipmentFlashpointC223 dangerousGoodsShipmentFlashpoint) {
this.dangerousGoodsShipmentFlashpoint = dangerousGoodsShipmentFlashpoint; return this;
}
public String getPackingGroupCoded() {
return packingGroupCoded;
}
public DangerousGoods setPackingGroupCoded(String packingGroupCoded) {
this.packingGroupCoded = packingGroupCoded; return this;
}
public String getEMSNumber() {
return eMSNumber;
}
public DangerousGoods setEMSNumber(String eMSNumber) {
this.eMSNumber = eMSNumber; return this;
}
public String getMfag() {
return mfag;
}
public DangerousGoods setMfag(String mfag) {
this.mfag = mfag; return this;
}
public String getTremCardNumber() {
return tremCardNumber;
}
public DangerousGoods setTremCardNumber(String tremCardNumber) {
this.tremCardNumber = tremCardNumber; return this;
}
public HazardIdentificationC235 getHazardIdentification() {
return hazardIdentification;
}
public DangerousGoods setHazardIdentification(HazardIdentificationC235 hazardIdentification) {
this.hazardIdentification = hazardIdentification; return this;
}
public DangerousGoodsLabelC236 getDangerousGoodsLabel() {
return dangerousGoodsLabel;
}
public DangerousGoods setDangerousGoodsLabel(DangerousGoodsLabelC236 dangerousGoodsLabel) {
this.dangerousGoodsLabel = dangerousGoodsLabel; return this;
}
public String getPackingInstructionCoded() {
return packingInstructionCoded;
}
public DangerousGoods setPackingInstructionCoded(String packingInstructionCoded) {
this.packingInstructionCoded = packingInstructionCoded; return this;
}
public String getCategoryOfMeansOfTransportCoded() {
return categoryOfMeansOfTransportCoded;
}
public DangerousGoods setCategoryOfMeansOfTransportCoded(String categoryOfMeansOfTransportCoded) {
this.categoryOfMeansOfTransportCoded = categoryOfMeansOfTransportCoded; return this;
}
public String getPermissionForTransportCoded() {
return permissionForTransportCoded;
}
public DangerousGoods setPermissionForTransportCoded(String permissionForTransportCoded) {
this.permissionForTransportCoded = permissionForTransportCoded; return this;
}
}