package controls;

import java.beans.BeanDescriptor;
import java.beans.EventSetDescriptor;
import java.beans.IntrospectionException;
import java.beans.MethodDescriptor;
import java.beans.ParameterDescriptor;
import java.beans.PropertyDescriptor;
import java.beans.PropertyEditor;
import java.lang.reflect.Method;
import java.util.HashMap;

import org.apache.beehive.controls.api.ControlException;
import org.apache.beehive.controls.runtime.bean.BeanPersistenceDelegate;
import org.apache.beehive.controls.runtime.packaging.ControlEventSetDescriptor;

@SuppressWarnings("all")
public class DSPControlFileBeanBeanInfo
extends com.bea.dsp.control.core.DSPControlBeanBeanInfo
{
    static final Method _getServiceCasesMethod;
    static final Method _createPROFILEMethod;
    static final Method _getCustomerByCustIDMethod;
    static final Method _getOrderCountsMethod;
    static final Method _getCustomerByLoginID0Method;
    static final Method _getCustomerServiceMethod;
    static final Method _updatePROFILEMethod;
    static final Method _deletePROFILEMethod;
    static final Method _getCustomerByLoginID1Method;
    static final Method _getCustomerByZipIDMethod;
    static final Method _getOrderCountMethod;
    static final Method _getProfileMethod;
    static final Method _getServiceCaseMethod;
    
    //
    // This HashMap will map from a Method to the array of names for parameters of the
    // method.  This is necessary because parameter name data isn't carried along in the
    // class file, but if available can enable ease of use by referencing parameters by
    // the declared name (vs. by index).
    //
    // This map should be read-only after its initialization in the static block, hence
    // using a plain HashMap is thread-safe.
    //
    static HashMap<Method, String []> _methodParamMap = new HashMap<Method, String []>();
    
    static
    {
        
        
        try
        {
            _getServiceCasesMethod = controls.DSPControlFile.class.getMethod("getServiceCases", new Class [] {retailer.PROFILE_SERVICES.class});
            _methodParamMap.put(_getServiceCasesMethod, new String [] { "profiles" });
            _createPROFILEMethod = controls.DSPControlFile.class.getMethod("createPROFILE", new Class [] {retailer.PROFILE_SERVICE[].class});
            _methodParamMap.put(_createPROFILEMethod, new String [] { "profile" });
            _getCustomerByCustIDMethod = controls.DSPControlFile.class.getMethod("getCustomerByCustID", new Class [] {java.lang.String.class});
            _methodParamMap.put(_getCustomerByCustIDMethod, new String [] { "custID" });
            _getOrderCountsMethod = controls.DSPControlFile.class.getMethod("getOrderCounts", new Class [] {java.lang.String.class});
            _methodParamMap.put(_getOrderCountsMethod, new String [] { "arg" });
            _getCustomerByLoginID0Method = controls.DSPControlFile.class.getMethod("getCustomerByLoginID", new Class [] {java.lang.String.class});
            _methodParamMap.put(_getCustomerByLoginID0Method, new String [] { "loginID" });
            _getCustomerServiceMethod = controls.DSPControlFile.class.getMethod("getCustomerService", new Class [] {retailer.PROFILE_SERVICE.class});
            _methodParamMap.put(_getCustomerServiceMethod, new String [] { "profile" });
            _updatePROFILEMethod = controls.DSPControlFile.class.getMethod("updatePROFILE", new Class [] {retailer.PROFILE_SERVICE[].class});
            _methodParamMap.put(_updatePROFILEMethod, new String [] { "profile" });
            _deletePROFILEMethod = controls.DSPControlFile.class.getMethod("deletePROFILE", new Class [] {retailer.PROFILE_SERVICE[].class});
            _methodParamMap.put(_deletePROFILEMethod, new String [] { "profile" });
            _getCustomerByLoginID1Method = controls.DSPControlFile.class.getMethod("getCustomerByLoginID", new Class [] {java.lang.String.class, com.bea.dsp.RequestConfig.class});
            _methodParamMap.put(_getCustomerByLoginID1Method, new String [] { "loginID", "config" });
            _getCustomerByZipIDMethod = controls.DSPControlFile.class.getMethod("getCustomerByZipID", new Class [] {java.lang.String.class});
            _methodParamMap.put(_getCustomerByZipIDMethod, new String [] { "zipID" });
            _getOrderCountMethod = controls.DSPControlFile.class.getMethod("getOrderCount", new Class [] {java.lang.String.class});
            _methodParamMap.put(_getOrderCountMethod, new String [] { "arg" });
            _getProfileMethod = controls.DSPControlFile.class.getMethod("getProfile", new Class [] {});
            _methodParamMap.put(_getProfileMethod, new String [] {  });
            _getServiceCaseMethod = controls.DSPControlFile.class.getMethod("getServiceCase", new Class [] {retailer.PROFILE_SERVICE.class});
            _methodParamMap.put(_getServiceCaseMethod, new String [] { "profile" });
        }
        catch (NoSuchMethodException __bc_nsme)
        {
            throw new ExceptionInInitializerError(__bc_nsme);
        }
    }
    
    /**
    * Default null-arg constructor used to create a new BeanInfo instance
    */
    public DSPControlFileBeanBeanInfo()
    {
        super(controls.DSPControlFileBean.class);
    }
    
    /**
    * Protected constructor used if this BeanInfo class is extended.
    */
    protected DSPControlFileBeanBeanInfo(Class beanClass)
    {
        super(beanClass);
    }
    
    // java.beans.BeanInfo.getBeanDescriptor
    public BeanDescriptor getBeanDescriptor()
    {
        BeanDescriptor bd = new BeanDescriptor(controls.DSPControlFileBean.class);
        bd.setName( "DSPControlFileBean" );
        bd.setDisplayName( "DSPControlFileBean" );
        
        //
        // The org.apache.beehive.controls.runtime.bean.BeanPersistenceDelegate class
        // implements the XMLDecode delegation model for all Control JavaBean types. It
        // provides optimized XML persistance based upon the Control runtime architecture.
        // The 'persistenceDelegate' attribute of a BeanDescriptor is used by XMLEncoder to
        // locate a delegate for a particular JavaBean type.
        //
        bd.setValue("persistenceDelegate", new BeanPersistenceDelegate());
        
        return bd;
    }
    
    /**
    * Stores MethodDescriptor descriptors for this bean and its superclasses into
    * an array, starting at the specified index
    */
    protected void initMethodDescriptors(MethodDescriptor [] methodDescriptors, int index)
    throws java.beans.IntrospectionException
    {
        String [] __bc_paramNames;
        ParameterDescriptor [] __bc_paramDescriptors;
        MethodDescriptor md;
        
        //
        // Declare MethodDescriptor for getServiceCases(profiles)
        //
        __bc_paramNames = _methodParamMap.get(_getServiceCasesMethod);
        __bc_paramDescriptors = new ParameterDescriptor[__bc_paramNames.length];
        for (int j = 0; j < __bc_paramNames.length; j++)
        {
            __bc_paramDescriptors[j] = new ParameterDescriptor();
            __bc_paramDescriptors[j].setName(__bc_paramNames[j]);
            __bc_paramDescriptors[j].setDisplayName(__bc_paramNames[j]);
        }
        md = new MethodDescriptor(_getServiceCasesMethod, __bc_paramDescriptors);
        methodDescriptors[index++] = md;
        
        //
        // Declare MethodDescriptor for createPROFILE(profile)
        //
        __bc_paramNames = _methodParamMap.get(_createPROFILEMethod);
        __bc_paramDescriptors = new ParameterDescriptor[__bc_paramNames.length];
        for (int j = 0; j < __bc_paramNames.length; j++)
        {
            __bc_paramDescriptors[j] = new ParameterDescriptor();
            __bc_paramDescriptors[j].setName(__bc_paramNames[j]);
            __bc_paramDescriptors[j].setDisplayName(__bc_paramNames[j]);
        }
        md = new MethodDescriptor(_createPROFILEMethod, __bc_paramDescriptors);
        methodDescriptors[index++] = md;
        
        //
        // Declare MethodDescriptor for getCustomerByCustID(custID)
        //
        __bc_paramNames = _methodParamMap.get(_getCustomerByCustIDMethod);
        __bc_paramDescriptors = new ParameterDescriptor[__bc_paramNames.length];
        for (int j = 0; j < __bc_paramNames.length; j++)
        {
            __bc_paramDescriptors[j] = new ParameterDescriptor();
            __bc_paramDescriptors[j].setName(__bc_paramNames[j]);
            __bc_paramDescriptors[j].setDisplayName(__bc_paramNames[j]);
        }
        md = new MethodDescriptor(_getCustomerByCustIDMethod, __bc_paramDescriptors);
        methodDescriptors[index++] = md;
        
        //
        // Declare MethodDescriptor for getOrderCounts(arg)
        //
        __bc_paramNames = _methodParamMap.get(_getOrderCountsMethod);
        __bc_paramDescriptors = new ParameterDescriptor[__bc_paramNames.length];
        for (int j = 0; j < __bc_paramNames.length; j++)
        {
            __bc_paramDescriptors[j] = new ParameterDescriptor();
            __bc_paramDescriptors[j].setName(__bc_paramNames[j]);
            __bc_paramDescriptors[j].setDisplayName(__bc_paramNames[j]);
        }
        md = new MethodDescriptor(_getOrderCountsMethod, __bc_paramDescriptors);
        methodDescriptors[index++] = md;
        
        //
        // Declare MethodDescriptor for getCustomerByLoginID(loginID)
        //
        __bc_paramNames = _methodParamMap.get(_getCustomerByLoginID0Method);
        __bc_paramDescriptors = new ParameterDescriptor[__bc_paramNames.length];
        for (int j = 0; j < __bc_paramNames.length; j++)
        {
            __bc_paramDescriptors[j] = new ParameterDescriptor();
            __bc_paramDescriptors[j].setName(__bc_paramNames[j]);
            __bc_paramDescriptors[j].setDisplayName(__bc_paramNames[j]);
        }
        md = new MethodDescriptor(_getCustomerByLoginID0Method, __bc_paramDescriptors);
        methodDescriptors[index++] = md;
        
        //
        // Declare MethodDescriptor for getCustomerService(profile)
        //
        __bc_paramNames = _methodParamMap.get(_getCustomerServiceMethod);
        __bc_paramDescriptors = new ParameterDescriptor[__bc_paramNames.length];
        for (int j = 0; j < __bc_paramNames.length; j++)
        {
            __bc_paramDescriptors[j] = new ParameterDescriptor();
            __bc_paramDescriptors[j].setName(__bc_paramNames[j]);
            __bc_paramDescriptors[j].setDisplayName(__bc_paramNames[j]);
        }
        md = new MethodDescriptor(_getCustomerServiceMethod, __bc_paramDescriptors);
        methodDescriptors[index++] = md;
        
        //
        // Declare MethodDescriptor for updatePROFILE(profile)
        //
        __bc_paramNames = _methodParamMap.get(_updatePROFILEMethod);
        __bc_paramDescriptors = new ParameterDescriptor[__bc_paramNames.length];
        for (int j = 0; j < __bc_paramNames.length; j++)
        {
            __bc_paramDescriptors[j] = new ParameterDescriptor();
            __bc_paramDescriptors[j].setName(__bc_paramNames[j]);
            __bc_paramDescriptors[j].setDisplayName(__bc_paramNames[j]);
        }
        md = new MethodDescriptor(_updatePROFILEMethod, __bc_paramDescriptors);
        methodDescriptors[index++] = md;
        
        //
        // Declare MethodDescriptor for deletePROFILE(profile)
        //
        __bc_paramNames = _methodParamMap.get(_deletePROFILEMethod);
        __bc_paramDescriptors = new ParameterDescriptor[__bc_paramNames.length];
        for (int j = 0; j < __bc_paramNames.length; j++)
        {
            __bc_paramDescriptors[j] = new ParameterDescriptor();
            __bc_paramDescriptors[j].setName(__bc_paramNames[j]);
            __bc_paramDescriptors[j].setDisplayName(__bc_paramNames[j]);
        }
        md = new MethodDescriptor(_deletePROFILEMethod, __bc_paramDescriptors);
        methodDescriptors[index++] = md;
        
        //
        // Declare MethodDescriptor for getCustomerByLoginID(loginID, config)
        //
        __bc_paramNames = _methodParamMap.get(_getCustomerByLoginID1Method);
        __bc_paramDescriptors = new ParameterDescriptor[__bc_paramNames.length];
        for (int j = 0; j < __bc_paramNames.length; j++)
        {
            __bc_paramDescriptors[j] = new ParameterDescriptor();
            __bc_paramDescriptors[j].setName(__bc_paramNames[j]);
            __bc_paramDescriptors[j].setDisplayName(__bc_paramNames[j]);
        }
        md = new MethodDescriptor(_getCustomerByLoginID1Method, __bc_paramDescriptors);
        methodDescriptors[index++] = md;
        
        //
        // Declare MethodDescriptor for getCustomerByZipID(zipID)
        //
        __bc_paramNames = _methodParamMap.get(_getCustomerByZipIDMethod);
        __bc_paramDescriptors = new ParameterDescriptor[__bc_paramNames.length];
        for (int j = 0; j < __bc_paramNames.length; j++)
        {
            __bc_paramDescriptors[j] = new ParameterDescriptor();
            __bc_paramDescriptors[j].setName(__bc_paramNames[j]);
            __bc_paramDescriptors[j].setDisplayName(__bc_paramNames[j]);
        }
        md = new MethodDescriptor(_getCustomerByZipIDMethod, __bc_paramDescriptors);
        methodDescriptors[index++] = md;
        
        //
        // Declare MethodDescriptor for getOrderCount(arg)
        //
        __bc_paramNames = _methodParamMap.get(_getOrderCountMethod);
        __bc_paramDescriptors = new ParameterDescriptor[__bc_paramNames.length];
        for (int j = 0; j < __bc_paramNames.length; j++)
        {
            __bc_paramDescriptors[j] = new ParameterDescriptor();
            __bc_paramDescriptors[j].setName(__bc_paramNames[j]);
            __bc_paramDescriptors[j].setDisplayName(__bc_paramNames[j]);
        }
        md = new MethodDescriptor(_getOrderCountMethod, __bc_paramDescriptors);
        methodDescriptors[index++] = md;
        
        //
        // Declare MethodDescriptor for getProfile()
        //
        __bc_paramNames = _methodParamMap.get(_getProfileMethod);
        __bc_paramDescriptors = new ParameterDescriptor[__bc_paramNames.length];
        for (int j = 0; j < __bc_paramNames.length; j++)
        {
            __bc_paramDescriptors[j] = new ParameterDescriptor();
            __bc_paramDescriptors[j].setName(__bc_paramNames[j]);
            __bc_paramDescriptors[j].setDisplayName(__bc_paramNames[j]);
        }
        md = new MethodDescriptor(_getProfileMethod, __bc_paramDescriptors);
        methodDescriptors[index++] = md;
        
        //
        // Declare MethodDescriptor for getServiceCase(profile)
        //
        __bc_paramNames = _methodParamMap.get(_getServiceCaseMethod);
        __bc_paramDescriptors = new ParameterDescriptor[__bc_paramNames.length];
        for (int j = 0; j < __bc_paramNames.length; j++)
        {
            __bc_paramDescriptors[j] = new ParameterDescriptor();
            __bc_paramDescriptors[j].setName(__bc_paramNames[j]);
            __bc_paramDescriptors[j].setDisplayName(__bc_paramNames[j]);
        }
        md = new MethodDescriptor(_getServiceCaseMethod, __bc_paramDescriptors);
        methodDescriptors[index++] = md;
        
        
        //
        // Add method descriptors from parent BeanInfo
        //
        super.initMethodDescriptors(methodDescriptors, index);
    }
    
    public MethodDescriptor [] getMethodDescriptors()
    {
        MethodDescriptor [] __bc_methodDescriptors = new MethodDescriptor[13];
        try
        {
            initMethodDescriptors(__bc_methodDescriptors, 0);
        }
        catch (java.beans.IntrospectionException __bc_ie)
        {
            throw new ControlException("Unable to create MethodDescriptor", __bc_ie);
        }
        return __bc_methodDescriptors;
    }
    
    /**
    * Stores PropertyDescriptor descriptors for this bean and its superclasses into
    * an array, starting at the specified index
    */
    protected void initPropertyDescriptors(PropertyDescriptor [] propDescriptors, int index)
    throws java.beans.IntrospectionException
    {
        PropertyDescriptor pd;
        
        pd = new PropertyDescriptor( "controlImplementation" , controls.DSPControlFileBean.class, "getControlImplementation", "setControlImplementation");
        propDescriptors[index++] = pd;
        
        //
        // add property descriptors for any getter/setters defined in control interface
        //
        pd = new PropertyDescriptor( "profile" , controls.DSPControlFileBean.class, "getProfile", null);
        propDescriptors[index++] = pd;
        
        //
        // Add property descriptors from parent BeanInfo
        //
        super.initPropertyDescriptors(propDescriptors, index);
    }
    
    // java.beans.BeanInfo.getPropertyDescriptors
    public PropertyDescriptor [] getPropertyDescriptors()
    {
        PropertyDescriptor [] __bc_propDescriptors = new PropertyDescriptor[3];
        try
        {
            initPropertyDescriptors(__bc_propDescriptors, 0);
        }
        catch (java.beans.IntrospectionException __bc_ie)
        {
            throw new ControlException("Unable to create PropertyDescriptor", __bc_ie);
        }
        return __bc_propDescriptors;
    }
    
    
    protected void initEventSetDescriptors(EventSetDescriptor [] eventSetDescriptors, int index)
    throws java.beans.IntrospectionException
    {
        
        
        //
        // Add event set descriptors from parent BeanInfo
        //
        super.initEventSetDescriptors(eventSetDescriptors, index);
    }
    
    // java.beans.BeanInfo.getEventSetDescriptors
    public EventSetDescriptor [] getEventSetDescriptors()
    {
        EventSetDescriptor [] __bc_eventSetDescriptors = new EventSetDescriptor[0];
        try
        {
            initEventSetDescriptors(__bc_eventSetDescriptors, 0);
        }
        catch (java.beans.IntrospectionException __bc_ie)
        {
            throw new ControlException("Unable to create EventSetDescriptor", __bc_ie);
        }
        return __bc_eventSetDescriptors;
    }
}
