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

org.milyn.edi.unedifact.d06b.common.TestMethod Maven / Gradle / Ivy

/**
 * This class was generated by Smooks EJC (http://www.smooks.org).
 */
package org.milyn.edi.unedifact.d06b.common;

import java.io.Serializable;    
import org.milyn.smooks.edi.EDIWritable;    
import org.milyn.edi.unedifact.d06b.common.field.TestMethodC244;    
import org.milyn.edi.unedifact.d06b.common.field.TestReasonC515;    
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 TestMethod implements Serializable, EDIWritable {

    private static final long serialVersionUID = 1L;

    private TestMethodC244 testMethod;
    private String testAdministrationMethodCode;
    private String testMediumCode;
    private String measurementPurposeCodeQualifier;
    private String testMethodRevisionIdentifier;
    private TestReasonC515 testReason;

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

        List nodeTokens = new ArrayList();

        if(testMethod != null) {
            testMethod.write(nodeWriter, delimiters);
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(testAdministrationMethodCode != null) {
            nodeWriter.write(delimiters.escape(testAdministrationMethodCode.toString()));
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(testMediumCode != null) {
            nodeWriter.write(delimiters.escape(testMediumCode.toString()));
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(measurementPurposeCodeQualifier != null) {
            nodeWriter.write(delimiters.escape(measurementPurposeCodeQualifier.toString()));
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(testMethodRevisionIdentifier != null) {
            nodeWriter.write(delimiters.escape(testMethodRevisionIdentifier.toString()));
            nodeTokens.add(nodeWriter.toString());
            ((StringWriter)nodeWriter).getBuffer().setLength(0);
        }
        nodeWriter.write(delimiters.getField());
        if(testReason != null) {
            testReason.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 TestMethodC244 getTestMethod() {
        return testMethod;
    }

    public TestMethod setTestMethod(TestMethodC244 testMethod) {
        this.testMethod = testMethod;  return this;
    }

    public String getTestAdministrationMethodCode() {
        return testAdministrationMethodCode;
    }

    public TestMethod setTestAdministrationMethodCode(String testAdministrationMethodCode) {
        this.testAdministrationMethodCode = testAdministrationMethodCode;  return this;
    }

    public String getTestMediumCode() {
        return testMediumCode;
    }

    public TestMethod setTestMediumCode(String testMediumCode) {
        this.testMediumCode = testMediumCode;  return this;
    }

    public String getMeasurementPurposeCodeQualifier() {
        return measurementPurposeCodeQualifier;
    }

    public TestMethod setMeasurementPurposeCodeQualifier(String measurementPurposeCodeQualifier) {
        this.measurementPurposeCodeQualifier = measurementPurposeCodeQualifier;  return this;
    }

    public String getTestMethodRevisionIdentifier() {
        return testMethodRevisionIdentifier;
    }

    public TestMethod setTestMethodRevisionIdentifier(String testMethodRevisionIdentifier) {
        this.testMethodRevisionIdentifier = testMethodRevisionIdentifier;  return this;
    }

    public TestReasonC515 getTestReason() {
        return testReason;
    }

    public TestMethod setTestReason(TestReasonC515 testReason) {
        this.testReason = testReason;  return this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy