Package java.beans

Examples of java.beans.ParameterDescriptor


      if (method != null) {
         ParameterDescriptor[] pd = new ParameterDescriptor[method.getParameterTypes().length];
         int pidx = 0;

         pd[pidx] = new ParameterDescriptor();
         pd[pidx].setName("param1");
         pd[pidx].setDisplayName("Parameter 1");

         pidx++;

         pd[pidx] = new ParameterDescriptor();
         pd[pidx].setName("param2");
         pd[pidx].setDisplayName("Parameter 2");

         pidx++;
View Full Code Here


        //
        __bc_paramNames = _methodParamMap.get(_getInitialContextMethod);
        __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(_getInitialContextMethod, __bc_paramDescriptors);
        methodDescriptors[index++] = md;
       
        //
        // Declare MethodDescriptor for getResource(resource, resourceClass)
        //
        __bc_paramNames = _methodParamMap.get(_getResourceMethod);
        __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(_getResourceMethod, __bc_paramDescriptors);
        methodDescriptors[index++] = md;
View Full Code Here

        //
        __bc_paramNames = _methodParamMap.get(_getEJBBeanInstanceMethod);
        __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(_getEJBBeanInstanceMethod, __bc_paramDescriptors);
        methodDescriptors[index++] = md;
       
        //
        // Declare MethodDescriptor for getEJBHomeInstance()
        //
        __bc_paramNames = _methodParamMap.get(_getEJBHomeInstanceMethod);
        __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(_getEJBHomeInstanceMethod, __bc_paramDescriptors);
        methodDescriptors[index++] = md;
       
        //
        // Declare MethodDescriptor for getEJBException()
        //
        __bc_paramNames = _methodParamMap.get(_getEJBExceptionMethod);
        __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(_getEJBExceptionMethod, __bc_paramDescriptors);
        methodDescriptors[index++] = md;
       
        //
        // Declare MethodDescriptor for hasEJBBeanInstance()
        //
        __bc_paramNames = _methodParamMap.get(_hasEJBBeanInstanceMethod);
        __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(_hasEJBBeanInstanceMethod, __bc_paramDescriptors);
        methodDescriptors[index++] = md;
View Full Code Here

        //
        __bc_paramNames = _methodParamMap.get(_getDestinationMethod);
        __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(_getDestinationMethod, __bc_paramDescriptors);
        methodDescriptors[index++] = md;
       
        //
        // Declare MethodDescriptor for setProperty(name, value)
        //
        __bc_paramNames = _methodParamMap.get(_setPropertyMethod);
        __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(_setPropertyMethod, __bc_paramDescriptors);
        methodDescriptors[index++] = md;
       
        //
        // Declare MethodDescriptor for setHeader(type, value)
        //
        __bc_paramNames = _methodParamMap.get(_setHeaderMethod);
        __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(_setHeaderMethod, __bc_paramDescriptors);
        methodDescriptors[index++] = md;
       
        //
        // Declare MethodDescriptor for setProperties(properties)
        //
        __bc_paramNames = _methodParamMap.get(_setPropertiesMethod);
        __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(_setPropertiesMethod, __bc_paramDescriptors);
        methodDescriptors[index++] = md;
       
        //
        // Declare MethodDescriptor for getSession()
        //
        __bc_paramNames = _methodParamMap.get(_getSessionMethod);
        __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(_getSessionMethod, __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 setHeaders(headers)
        //
        __bc_paramNames = _methodParamMap.get(_setHeadersMethod);
        __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(_setHeadersMethod, __bc_paramDescriptors);
        methodDescriptors[index++] = md;
View Full Code Here

        //
        __bc_paramNames = _methodParamMap.get(_getEJBNextBeanInstanceMethod);
        __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(_getEJBNextBeanInstanceMethod, __bc_paramDescriptors);
        methodDescriptors[index++] = md;
View Full Code Here

        //
        __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;
View Full Code Here

        String beanName = "MethodDescriptorTest.bean";
        MockJavaBean bean = new MockJavaBean(beanName);
        Method method = bean.getClass().getMethod("setPropertyOne",
                new Class[] { String.class });
        ParameterDescriptor[] pds = new ParameterDescriptor[1];
        pds[0] = new ParameterDescriptor();
        pds[0].setValue(method.getName(), method.getReturnType());
        MethodDescriptor md = new MethodDescriptor(method, pds);

        assertSame(method, md.getMethod());
        assertSame(pds, md.getParameterDescriptors());
View Full Code Here

    }

    public void testMethodDescriptorMethodParameterDescriptorArray_MethodNull() {
        Method method = null;
        ParameterDescriptor[] pds = new ParameterDescriptor[1];
        pds[0] = new ParameterDescriptor();
        try {
            new MethodDescriptor(method, pds);
            fail("Should throw NullPointerException.");
        } catch (NullPointerException e) {
        }
View Full Code Here

* Unit test for ParameterDescriptor.
*/
public class ParameterDescriptorTest extends TestCase {

    public void testParameterDescriptor() {
        ParameterDescriptor pd = new ParameterDescriptor();
        assertNull(pd.getDisplayName());
        assertNull(pd.getName());
        assertNull(pd.getShortDescription());

        assertNotNull(pd.attributeNames());

        assertFalse(pd.isExpert());
        assertFalse(pd.isHidden());
        assertFalse(pd.isPreferred());
    }
View Full Code Here

TOP

Related Classes of java.beans.ParameterDescriptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.