/**
 * Do not edit.
 *
 * This file was auto-generated
 * by the Web Service Director Eclipse Plugin Edition.
 */

package com.nec.webotx.webservice.sample;

import com.nec.webotx.webservice.xml.rpc.encoding.*;
import com.nec.webotx.webservice.xml.rpc.util.exception.LocalizableExceptionAdapter;

public class Info_SOAPBuilder implements SOAPInstanceBuilder {
    private com.nec.webotx.webservice.sample.Info _instance;
    private java.lang.String sample1;
    private java.lang.String sample2;
    private static final int mySAMPLE1_INDEX = 0;
    private static final int mySAMPLE2_INDEX = 1;
    
    public Info_SOAPBuilder() {
    }
    
    public void setSample1(java.lang.String sample1) {
        this.sample1 = sample1;
    }
    
    public void setSample2(java.lang.String sample2) {
        this.sample2 = sample2;
    }
    
    public int memberGateType(int memberIndex) {
        switch (memberIndex) {
            case mySAMPLE1_INDEX:
                return GATES_INITIALIZATION | REQUIRES_CREATION;
            case mySAMPLE2_INDEX:
                return GATES_INITIALIZATION | REQUIRES_CREATION;
            default:
                throw new IllegalArgumentException();
        }
    }
    
    public void construct() {
    }
    
    public void setMember(int index, Object memberValue) {
        try {
            switch(index) {
                case mySAMPLE1_INDEX:
                    _instance.setSample1((java.lang.String)memberValue);
                    break;
                case mySAMPLE2_INDEX:
                    _instance.setSample2((java.lang.String)memberValue);
                    break;
                default:
                    throw new IllegalArgumentException();
            }
        }
        catch (RuntimeException e) {
            throw e;
        }
        catch (Exception e) {
            throw new DeserializationException(new LocalizableExceptionAdapter(e));
        }
    }
    
    public void initialize() {
    }
    
    public void setInstance(Object instance) {
        _instance = (com.nec.webotx.webservice.sample.Info)instance;
    }
    
    public Object getInstance() {
        return _instance;
    }
}
