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

org.milyn.edi.unedifact.d01a.common.DRDDataRepresentationDetails 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.d01a.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 DRDDataRepresentationDetails implements Serializable, EDIWritable {

    private static final long serialVersionUID = 1L;

    private String e7512StructureComponentIdentifier;
    private String e7515StructureTypeCode;
    private String e9169DataRepresentationTypeCode;
    private BigDecimal e6174SizeValue;
    private DABigDecimalDecoder e6174SizeValueEncoder;

    public DRDDataRepresentationDetails() {
        
        e6174SizeValueEncoder = new DABigDecimalDecoder();
    }

    public void write(Writer writer, Delimiters delimiters) throws IOException {
        
        Writer nodeWriter = new StringWriter();

        List nodeTokens = new ArrayList();

        if(e7512StructureComponentIdentifier != null) {
            nodeWriter.write(delimiters.escape(e7512StructureComponentIdentifier.toString()));
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(e7515StructureTypeCode != null) {
            nodeWriter.write(delimiters.escape(e7515StructureTypeCode.toString()));
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(e9169DataRepresentationTypeCode != null) {
            nodeWriter.write(delimiters.escape(e9169DataRepresentationTypeCode.toString()));
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(e6174SizeValue != null) {
            nodeWriter.write(delimiters.escape(e6174SizeValueEncoder.encode(e6174SizeValue, 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 getE7512StructureComponentIdentifier() {
        return e7512StructureComponentIdentifier;
    }

    public DRDDataRepresentationDetails setE7512StructureComponentIdentifier(String e7512StructureComponentIdentifier) {
        this.e7512StructureComponentIdentifier = e7512StructureComponentIdentifier;  return this;
    }

    public String getE7515StructureTypeCode() {
        return e7515StructureTypeCode;
    }

    public DRDDataRepresentationDetails setE7515StructureTypeCode(String e7515StructureTypeCode) {
        this.e7515StructureTypeCode = e7515StructureTypeCode;  return this;
    }

    public String getE9169DataRepresentationTypeCode() {
        return e9169DataRepresentationTypeCode;
    }

    public DRDDataRepresentationDetails setE9169DataRepresentationTypeCode(String e9169DataRepresentationTypeCode) {
        this.e9169DataRepresentationTypeCode = e9169DataRepresentationTypeCode;  return this;
    }

    public BigDecimal getE6174SizeValue() {
        return e6174SizeValue;
    }

    public DRDDataRepresentationDetails setE6174SizeValue(BigDecimal e6174SizeValue) {
        this.e6174SizeValue = e6174SizeValue;  return this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy