org.milyn.edi.unedifact.d05a.common.GPOGeographicalPosition Maven / Gradle / Ivy
/**
* This class was generated by Smooks EJC (http://www.smooks.org).
*/
package org.milyn.edi.unedifact.d05a.common;
import java.io.Serializable;
import org.milyn.smooks.edi.EDIWritable;
import java.math.BigDecimal;
import org.milyn.javabean.decoders.DABigDecimalDecoder;
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 GPOGeographicalPosition implements Serializable, EDIWritable {
private static final long serialVersionUID = 1L;
private String e6029GeographicalPositionCodeQualifier;
private String e6000LatitudeDegree;
private String e6002LongitudeDegree;
private BigDecimal e6096Altitude;
private DABigDecimalDecoder e6096AltitudeEncoder;
public GPOGeographicalPosition() {
e6096AltitudeEncoder = new DABigDecimalDecoder();
}
public void write(Writer writer, Delimiters delimiters) throws IOException {
Writer nodeWriter = new StringWriter();
List nodeTokens = new ArrayList();
if(e6029GeographicalPositionCodeQualifier != null) {
nodeWriter.write(delimiters.escape(e6029GeographicalPositionCodeQualifier.toString()));
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(e6000LatitudeDegree != null) {
nodeWriter.write(delimiters.escape(e6000LatitudeDegree.toString()));
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(e6002LongitudeDegree != null) {
nodeWriter.write(delimiters.escape(e6002LongitudeDegree.toString()));
nodeTokens.add(nodeWriter.toString());
((StringWriter)nodeWriter).getBuffer().setLength(0);
}
nodeWriter.write(delimiters.getField());
if(e6096Altitude != null) {
nodeWriter.write(delimiters.escape(e6096AltitudeEncoder.encode(e6096Altitude, 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 getE6029GeographicalPositionCodeQualifier() {
return e6029GeographicalPositionCodeQualifier;
}
public GPOGeographicalPosition setE6029GeographicalPositionCodeQualifier(String e6029GeographicalPositionCodeQualifier) {
this.e6029GeographicalPositionCodeQualifier = e6029GeographicalPositionCodeQualifier; return this;
}
public String getE6000LatitudeDegree() {
return e6000LatitudeDegree;
}
public GPOGeographicalPosition setE6000LatitudeDegree(String e6000LatitudeDegree) {
this.e6000LatitudeDegree = e6000LatitudeDegree; return this;
}
public String getE6002LongitudeDegree() {
return e6002LongitudeDegree;
}
public GPOGeographicalPosition setE6002LongitudeDegree(String e6002LongitudeDegree) {
this.e6002LongitudeDegree = e6002LongitudeDegree; return this;
}
public BigDecimal getE6096Altitude() {
return e6096Altitude;
}
public GPOGeographicalPosition setE6096Altitude(BigDecimal e6096Altitude) {
this.e6096Altitude = e6096Altitude; return this;
}
}