package org.apache.beehive.controls.system.jdbc;
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 JdbcControlBeanBeanInfo
extends org.apache.beehive.controls.runtime.bean.ControlBeanInfo
{
static final Method _getDataSourceCalendarMethod;
static final Method _getConnectionMethod;
static final Method _setDataSourceCalendarMethod;
//
// 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
{
_getDataSourceCalendarMethod = org.apache.beehive.controls.system.jdbc.JdbcControl.class.getMethod("getDataSourceCalendar", new Class [] {});
_methodParamMap.put(_getDataSourceCalendarMethod, new String [] { });
_getConnectionMethod = org.apache.beehive.controls.system.jdbc.JdbcControl.class.getMethod("getConnection", new Class [] {});
_methodParamMap.put(_getConnectionMethod, new String [] { });
_setDataSourceCalendarMethod = org.apache.beehive.controls.system.jdbc.JdbcControl.class.getMethod("setDataSourceCalendar", new Class [] {java.util.Calendar.class});
_methodParamMap.put(_setDataSourceCalendarMethod, new String [] { "cal" });
}
catch (NoSuchMethodException __bc_nsme)
{
throw new ExceptionInInitializerError(__bc_nsme);
}
}
/**
* Default null-arg constructor used to create a new BeanInfo instance
*/
public JdbcControlBeanBeanInfo()
{
super(org.apache.beehive.controls.system.jdbc.JdbcControlBean.class);
}
/**
* Protected constructor used if this BeanInfo class is extended.
*/
protected JdbcControlBeanBeanInfo(Class beanClass)
{
super(beanClass);
}
// java.beans.BeanInfo.getBeanDescriptor
public BeanDescriptor getBeanDescriptor()
{
BeanDescriptor bd = new BeanDescriptor(org.apache.beehive.controls.system.jdbc.JdbcControlBean.class);
bd.setName( "JdbcControlBean" );
bd.setDisplayName( "JdbcControlBean" );
//
// 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 getDataSourceCalendar()
//
__bc_paramNames = _methodParamMap.get(_getDataSourceCalendarMethod);
__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(_getDataSourceCalendarMethod, __bc_paramDescriptors);
methodDescriptors[index++] = md;
//
// Declare MethodDescriptor for getConnection()
//
__bc_paramNames = _methodParamMap.get(_getConnectionMethod);
__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(_getConnectionMethod, __bc_paramDescriptors);
methodDescriptors[index++] = md;
//
// Declare MethodDescriptor for setDataSourceCalendar(cal)
//
__bc_paramNames = _methodParamMap.get(_setDataSourceCalendarMethod);
__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(_setDataSourceCalendarMethod, __bc_paramDescriptors);
methodDescriptors[index++] = md;
}
public MethodDescriptor [] getMethodDescriptors()
{
MethodDescriptor [] __bc_methodDescriptors = new MethodDescriptor[3];
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" , org.apache.beehive.controls.system.jdbc.JdbcControlBean.class, "getControlImplementation", "setControlImplementation");
propDescriptors[index++] = pd;
pd = new PropertyDescriptor( "jndiName" , org.apache.beehive.controls.system.jdbc.JdbcControlBean.class, "getConnectionDataSourceJndiName", "setConnectionDataSourceJndiName");
propDescriptors[index++] = pd;
pd = new PropertyDescriptor( "jndiContextFactory" , org.apache.beehive.controls.system.jdbc.JdbcControlBean.class, "getConnectionDataSourceJndiContextFactory", "setConnectionDataSourceJndiContextFactory");
propDescriptors[index++] = pd;
pd = new PropertyDescriptor( "databaseDriverClass" , org.apache.beehive.controls.system.jdbc.JdbcControlBean.class, "getConnectionDriverDatabaseDriverClass", "setConnectionDriverDatabaseDriverClass");
propDescriptors[index++] = pd;
pd = new PropertyDescriptor( "databaseURL" , org.apache.beehive.controls.system.jdbc.JdbcControlBean.class, "getConnectionDriverDatabaseURL", "setConnectionDriverDatabaseURL");
propDescriptors[index++] = pd;
pd = new PropertyDescriptor( "userName" , org.apache.beehive.controls.system.jdbc.JdbcControlBean.class, "getConnectionDriverUserName", "setConnectionDriverUserName");
propDescriptors[index++] = pd;
pd = new PropertyDescriptor( "password" , org.apache.beehive.controls.system.jdbc.JdbcControlBean.class, "getConnectionDriverPassword", "setConnectionDriverPassword");
propDescriptors[index++] = pd;
pd = new PropertyDescriptor( "properties" , org.apache.beehive.controls.system.jdbc.JdbcControlBean.class, "getConnectionDriverProperties", "setConnectionDriverProperties");
propDescriptors[index++] = pd;
pd = new PropertyDescriptor( "readOnly" , org.apache.beehive.controls.system.jdbc.JdbcControlBean.class, "isConnectionOptionsReadOnly", "setConnectionOptionsReadOnly");
propDescriptors[index++] = pd;
pd = new PropertyDescriptor( "resultSetHoldability" , org.apache.beehive.controls.system.jdbc.JdbcControlBean.class, "getConnectionOptionsResultSetHoldability", "setConnectionOptionsResultSetHoldability");
propDescriptors[index++] = pd;
pd = new PropertyDescriptor( "typeMappers" , org.apache.beehive.controls.system.jdbc.JdbcControlBean.class, "getConnectionOptionsTypeMappers", "setConnectionOptionsTypeMappers");
propDescriptors[index++] = pd;
pd = new PropertyDescriptor( "UDTName" , org.apache.beehive.controls.system.jdbc.JdbcControlBean.class, "getTypeMapperUDTName", "setTypeMapperUDTName");
propDescriptors[index++] = pd;
pd = new PropertyDescriptor( "mapperClass" , org.apache.beehive.controls.system.jdbc.JdbcControlBean.class, "getTypeMapperMapperClass", "setTypeMapperMapperClass");
propDescriptors[index++] = pd;
pd = new PropertyDescriptor( "statement" , org.apache.beehive.controls.system.jdbc.JdbcControlBean.class, "getSQLStatement", "setSQLStatement");
propDescriptors[index++] = pd;
pd = new PropertyDescriptor( "arrayMaxLength" , org.apache.beehive.controls.system.jdbc.JdbcControlBean.class, "getSQLArrayMaxLength", "setSQLArrayMaxLength");
propDescriptors[index++] = pd;
pd = new PropertyDescriptor( "maxRows" , org.apache.beehive.controls.system.jdbc.JdbcControlBean.class, "getSQLMaxRows", "setSQLMaxRows");
propDescriptors[index++] = pd;
pd = new PropertyDescriptor( "batchUpdate" , org.apache.beehive.controls.system.jdbc.JdbcControlBean.class, "isSQLBatchUpdate", "setSQLBatchUpdate");
propDescriptors[index++] = pd;
pd = new PropertyDescriptor( "fetchSize" , org.apache.beehive.controls.system.jdbc.JdbcControlBean.class, "getSQLFetchSize", "setSQLFetchSize");
propDescriptors[index++] = pd;
pd = new PropertyDescriptor( "fetchDirection" , org.apache.beehive.controls.system.jdbc.JdbcControlBean.class, "getSQLFetchDirection", "setSQLFetchDirection");
propDescriptors[index++] = pd;
pd = new PropertyDescriptor( "getGeneratedKeys" , org.apache.beehive.controls.system.jdbc.JdbcControlBean.class, "isSQLGetGeneratedKeys", "setSQLGetGeneratedKeys");
propDescriptors[index++] = pd;
pd = new PropertyDescriptor( "generatedKeyColumnNames" , org.apache.beehive.controls.system.jdbc.JdbcControlBean.class, "getSQLGeneratedKeyColumnNames", "setSQLGeneratedKeyColumnNames");
propDescriptors[index++] = pd;
pd = new PropertyDescriptor( "generatedKeyColumnIndexes" , org.apache.beehive.controls.system.jdbc.JdbcControlBean.class, "getSQLGeneratedKeyColumnIndexes", "setSQLGeneratedKeyColumnIndexes");
propDescriptors[index++] = pd;
pd = new PropertyDescriptor( "resultSetHoldabilityOverride" , org.apache.beehive.controls.system.jdbc.JdbcControlBean.class, "getSQLResultSetHoldabilityOverride", "setSQLResultSetHoldabilityOverride");
propDescriptors[index++] = pd;
pd = new PropertyDescriptor( "typeMappersOverride" , org.apache.beehive.controls.system.jdbc.JdbcControlBean.class, "getSQLTypeMappersOverride", "setSQLTypeMappersOverride");
propDescriptors[index++] = pd;
pd = new PropertyDescriptor( "iteratorElementType" , org.apache.beehive.controls.system.jdbc.JdbcControlBean.class, "getSQLIteratorElementType", "setSQLIteratorElementType");
propDescriptors[index++] = pd;
pd = new PropertyDescriptor( "resultSetMapper" , org.apache.beehive.controls.system.jdbc.JdbcControlBean.class, "getSQLResultSetMapper", "setSQLResultSetMapper");
propDescriptors[index++] = pd;
pd = new PropertyDescriptor( "scrollableResultSet" , org.apache.beehive.controls.system.jdbc.JdbcControlBean.class, "getSQLScrollableResultSet", "setSQLScrollableResultSet");
propDescriptors[index++] = pd;
//
// add property descriptors for any getter/setters defined in control interface
//
pd = new PropertyDescriptor( "connection" , org.apache.beehive.controls.system.jdbc.JdbcControlBean.class, "getConnection", null);
propDescriptors[index++] = pd;
pd = new PropertyDescriptor( "dataSourceCalendar" , org.apache.beehive.controls.system.jdbc.JdbcControlBean.class, "getDataSourceCalendar", "setDataSourceCalendar");
propDescriptors[index++] = pd;
}
// java.beans.BeanInfo.getPropertyDescriptors
public PropertyDescriptor [] getPropertyDescriptors()
{
PropertyDescriptor [] __bc_propDescriptors = new PropertyDescriptor[29];
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
{
}
// 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;
}
}