Examples of BeanAccessor


Examples of nexj.core.util.BeanAccessor

      {
         obj = Class.forName(sName.substring(BEAN_SCHEME.length())).newInstance();

         if (!(obj instanceof PropertiesAware))
         {
            new BeanAccessor().setProperties(obj, properties);
           
         }
      }

      if (obj == null)
View Full Code Here

Examples of nexj.core.util.BeanAccessor

      {
         m_dataSource = (XADataSource)Class.forName(sDataSource).newInstance();

         if (m_dataSourceProperties != null)
         {
            new BeanAccessor().setProperties(m_dataSource, m_dataSourceProperties);
         }
      }
      catch (Throwable e)
      {
         throw new ResourceException(e);
View Full Code Here

Examples of nexj.core.util.BeanAccessor

      {
         m_dataSourceProperties = PropertyUtil.fromString(sProperties);

         if (m_dataSource != null)
         {
            new BeanAccessor().setProperties(m_dataSource, m_dataSourceProperties);
         }
      }
      catch (Throwable e)
      {
         throw new ResourceException("err.meta.dataSourceConnectionProperty", e);
View Full Code Here

Examples of org.apache.cayenne.property.BeanAccessor

    /**
     * Implements an attributes compilation step. Called internally from "compile".
     */
    protected void compileSpecialProperties() {
        this.persistenceStateProperty = new BeanAccessor(
                objectClass,
                "persistenceState",
                Integer.TYPE);
    }
View Full Code Here

Examples of org.apache.cayenne.reflect.BeanAccessor

        if (managedClass == null) {
            throw new IllegalArgumentException("Not a managed class: " + className);
        }
       
        if (managedClass.getAccess() == AccessType.PROPERTY) {
            return new BeanAccessor(
                    descriptor.getObjectClass(),
                    propertyName,
                    propertyType);
        }
        else {
View Full Code Here

Examples of org.apache.cayenne.reflect.BeanAccessor

        if (managedClass == null) {
            throw new IllegalArgumentException("Not a managed class: " + className);
        }

        if (managedClass.getAccess() == AccessType.PROPERTY) {
            return new BeanAccessor(
                    descriptor.getObjectClass(),
                    propertyName,
                    propertyType);
        }
        else {
View Full Code Here

Examples of org.apache.cayenne.reflect.BeanAccessor

public class BeanAccessorTest extends TestCase {

    public void testByteArrayProperty() {

        BeanAccessor accessor = new BeanAccessor(
                TestJavaBean.class,
                "byteArrayField",
                byte[].class);

        byte[] bytes = new byte[] {
                5, 6, 7
        };
        TestJavaBean o1 = new TestJavaBean();

        assertNull(o1.getByteArrayField());
        accessor.setValue(o1, bytes);
        assertSame(bytes, o1.getByteArrayField());
        assertSame(bytes, accessor.getValue(o1));
    }
View Full Code Here

Examples of org.apache.cayenne.reflect.BeanAccessor

        assertSame(bytes, accessor.getValue(o1));
    }

    public void testStringProperty() {

        BeanAccessor accessor = new BeanAccessor(
                TestJavaBean.class,
                "stringField",
                String.class);

        TestJavaBean o1 = new TestJavaBean();

        assertNull(o1.getStringField());
        accessor.setValue(o1, "ABC");
        assertSame("ABC", o1.getStringField());
        assertSame("ABC", accessor.getValue(o1));
    }
View Full Code Here

Examples of org.apache.cayenne.reflect.BeanAccessor

        assertSame("ABC", accessor.getValue(o1));
    }

    public void testIntProperty() {

        BeanAccessor accessor = new BeanAccessor(
                TestJavaBean.class,
                "intField",
                Integer.TYPE);

        TestJavaBean o1 = new TestJavaBean();

        assertEquals(0, o1.getIntField());
        accessor.setValue(o1, new Integer(5));
        assertEquals(5, o1.getIntField());
        assertEquals(new Integer(5), accessor.getValue(o1));

        accessor.setValue(o1, null);
        assertEquals("Incorrectly set null default", 0, o1.getIntField());
    }
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.