
package processing;

import java.lang.reflect.Field;
import org.apache.beehive.controls.api.ControlException;
import org.apache.beehive.controls.api.bean.Controls;
import org.apache.beehive.controls.api.versioning.VersionRequired;
import org.apache.beehive.controls.api.context.ControlBeanContext;
import org.apache.beehive.controls.runtime.bean.EventAdaptor;
import org.apache.beehive.controls.runtime.bean.AdaptorPersistenceDelegate;

@SuppressWarnings("all")
public class CreateApplicationFileClientInitializer
extends org.apache.beehive.controls.runtime.bean.ClientInitializer
{
    static final Field _applicationFileField;
    static
    {
        try
        {
            _applicationFileField = processing.CreateApplicationFile.class.getDeclaredField("applicationFile");
            _applicationFileField.setAccessible(true);
        }
        catch (NoSuchFieldException __bc_nsfe)
        {
            throw new ExceptionInInitializerError(__bc_nsfe);
        }
    }
    
    
    private static void initializeFields(ControlBeanContext cbc,
    processing.CreateApplicationFile client)
    {
        try
        {
            String __bc_id;
            //
            // Initialize any nested controls used by the client
            //
            __bc_id = "applicationFile";
            controls.ApplicationFileBean _applicationFile = (cbc == null ? null : (controls.ApplicationFileBean)cbc.getBean(__bc_id));
            if (_applicationFile == null)
            _applicationFile = (controls.ApplicationFileBean) Controls.instantiate(controls.ApplicationFileBean.class, getAnnotationMap(cbc, _applicationFileField), cbc, __bc_id );
            
            
            _applicationFileField.set(client, _applicationFile);
        }
        catch (RuntimeException __bc_re) { throw __bc_re; }
        catch (Exception __bc_e)
        {
            __bc_e.printStackTrace();
            throw new ControlException("Initializer failure", __bc_e);
        }
    }
    
    public static void initialize(ControlBeanContext cbc, processing.CreateApplicationFile client)
    {
        
        initializeFields( cbc, client );
    }
}
