Package com.volantis.mcs.model.descriptor

Examples of com.volantis.mcs.model.descriptor.PropertyAccessor


        return propertyModelObject;
    }

    private Object getEmbeddedModelObject(
            PropertyDescriptor descriptor, boolean create) {
        PropertyAccessor accessor = descriptor.getPropertyAccessor();
        if (accessor == null) {
            throw new IllegalStateException("Cannot access property directly");
        }

        Object modelObject = getModelObject(create);
        Object propertyModelObject;
        if (modelObject != null) {
            propertyModelObject = accessor.get(modelObject);
        } else {
            propertyModelObject = null;
        }

        return propertyModelObject;
View Full Code Here


    public Object setEmbeddedModelObject(
            Proxy proxy, Object newEmbeddedModelObject) {

        PropertyDescriptor descriptor = findPropertyDescriptor(proxy);
        PropertyAccessor accessor = descriptor.getPropertyAccessor();
        if (accessor == null) {
            throw new IllegalStateException("Cannot access property directly");
        }

        Object modelObject = getModelObject(true);
        Object oldEmbeddedObject = accessor.get(modelObject);

        // Only do something if the old value and the new value are different.
        if (!equals(oldEmbeddedObject, newEmbeddedModelObject)) {
            accessor.set(modelObject, newEmbeddedModelObject);
        }

        return oldEmbeddedObject;
    }
View Full Code Here

        // by each of the proxies.
        List list = beanClassDescriptor.getPropertyDescriptors();
        for (int i = 0; i < list.size(); i++) {
            PropertyDescriptor descriptor = (PropertyDescriptor) list.get(i);
            PropertyIdentifier identifier = descriptor.getIdentifier();
            PropertyAccessor accessor = descriptor.getPropertyAccessor();

            Proxy childProxy = getPropertyProxy(identifier);
            Object childObject = childProxy.copyModelObject();
            accessor.set(copy, childObject);
        }

        return copy;
    }
View Full Code Here

                                     boolean originator) {
        List list = beanClassDescriptor.getPropertyDescriptors();
        for (int i = 0; i < list.size(); i++) {
            PropertyDescriptor descriptor = (PropertyDescriptor) list.get(i);
            PropertyIdentifier identifier = descriptor.getIdentifier();
            PropertyAccessor accessor = descriptor.getPropertyAccessor();

            Object propertyModelObject = accessor.get(modelObject);
            if (propertyModelObject != null) {
                InternalProxy propertyProxy =
                        (InternalProxy) getPropertyProxy(identifier);
                propertyProxy.setModelObject(propertyModelObject, force, false);
            }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.model.descriptor.PropertyAccessor

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.