Examples of DynaProperty


Examples of org.apache.commons.beanutils.DynaProperty

     * @return The property descriptor for the specified property name.
     * @throws IllegalArgumentException if this is not a valid property name
     *                                  for our DynaClass
     */
    protected DynaProperty getDynaProperty(String name) {
        DynaProperty descriptor = getDynaClass().getDynaProperty(name);

        if (descriptor == null) {
            throw new IllegalArgumentException("Invalid property name '" + name
                + "'");
        }
View Full Code Here

Examples of org.apache.commons.beanutils.DynaProperty

    // Test basic DynaActionFormClass name and properties
    public void testClassCreate() {
        assertEquals("name", "dynaForm", dynaClass.getName());

        for (int i = 0; i < dynaProperties.length; i++) {
            DynaProperty prop =
                dynaClass.getDynaProperty(dynaProperties[i].getName());

            assertNotNull("Found property " + dynaProperties[i].getName());
            assertEquals("Class for property " + dynaProperties[i].getName(),
                dynaProperties[i].getTypeClass(), prop.getType());
        }
    }
View Full Code Here

Examples of org.apache.commons.beanutils.DynaProperty

    /**
     * Corner cases on getDynaProperty invalid arguments.
     */
    public void testGetDescriptorArguments()
    {
        DynaProperty descriptor = bean.getDynaClass().getDynaProperty("unknown");
        assertNull("Unknown property descriptor should be null", descriptor);

        try
        {
            bean.getDynaClass().getDynaProperty(null);
View Full Code Here

Examples of org.apache.commons.beanutils.DynaProperty

     * Positive test for getDynaPropertys().  Each property name
     * listed in <code>properties</code> should be returned exactly once.
     */
    public void testGetDescriptors()
    {
        DynaProperty pd[] = bean.getDynaClass().getDynaProperties();
        assertNotNull("Got descriptors", pd);
        int count[] = new int[properties.length];
        for (int i = 0; i < pd.length; i++)
        {
            String name = pd[i].getName();
View Full Code Here

Examples of org.apache.commons.beanutils.DynaProperty

     * @param name Name of the property to be retrieved
     * @param type Expected class type of this property
     */
    protected void testGetDescriptorBase(String name, Class type)
    {
        DynaProperty descriptor = bean.getDynaClass().getDynaProperty(name);

        assertNotNull("Failed to get descriptor", descriptor);
        assertEquals("Got incorrect type", type, descriptor.getType());
    }
View Full Code Here

Examples of org.apache.commons.beanutils.DynaProperty

            else if (type == Short.class)
            {
                type = Short.TYPE;
            }

            return new DynaProperty(name, type);
        }
    }
View Full Code Here

Examples of org.apache.commons.beanutils.DynaProperty

        Iterator keys = configuration.getKeys();
        List properties = new ArrayList();
        while (keys.hasNext())
        {
            String key = (String) keys.next();
            DynaProperty property = getDynaProperty(key);
            properties.add(property);
        }

        DynaProperty[] propertyArray = new DynaProperty[properties.size()];
        properties.toArray(propertyArray);
View Full Code Here

Examples of org.apache.commons.beanutils.DynaProperty

   
    private DynaClass createDynasaurClass() throws Exception {
        DynaClass dynaClass = new BasicDynaClass
                ("Dynasaur", null,
                        new DynaProperty[]{
                            new DynaProperty("Species", String.class),
                            new DynaProperty("isRaptor", Boolean.TYPE),
                            new DynaProperty("Period", String.class),
                        });
        return (dynaClass);
    }
View Full Code Here

Examples of org.apache.commons.beanutils.DynaProperty

*/
public class TestDynaBeanUpdater extends TestCase {

    public void testSimpleTest() throws Exception {
        DynaProperty[] dynaProperties = {
                new DynaProperty("alpha", Integer.class),
                new DynaProperty("beta", String.class)};
        BasicDynaClass dynaClass = new BasicDynaClass("ADynaBean", BasicDynaBean.class,
                dynaProperties);
        DynaBean dynaBean = dynaClass.newInstance();
       
        Context context = new Context();
View Full Code Here

Examples of org.apache.commons.beanutils.DynaProperty

*/
public class TestDynaBeanIntrospection extends TestCase {

    public void testSimpleIntrospectionTest() throws Exception {
        DynaProperty[] dynaProperties = {
                new DynaProperty("one", Integer.class),
                new DynaProperty("two", String.class)};
        BasicDynaClass dynaClass = new BasicDynaClass("WibbleDynaBean", BasicDynaBean.class,
                dynaProperties);
        DynaBean dynaBean = dynaClass.newInstance();
        XMLIntrospector xmlIntrospector = new XMLIntrospector();
        XMLBeanInfo xmlBeanInfo = xmlIntrospector.introspect(dynaBean);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.