Examples of PropertyAccessor


Examples of com.impetus.kundera.property.PropertyAccessor

        while (iterator.hasNext())
        {
            KeyValueVersion keyValueVersion = iterator.next();
            String minorKey = keyValueVersion.getKey().getMinorPath().get(0);

            PropertyAccessor accessor = PropertyAccessorFactory.getPropertyAccessor(childMetadata.getIdAttribute()
                    .getBindableJavaType());

            byte[] idByteArr = keyValueVersion.getValue().getValue();
            Object keyObj = accessor.fromBytes(childMetadata.getIdAttribute().getBindableJavaType(), idByteArr);

            results.put(childIdColumnName + "|" + minorKey, keyObj);
        }

        return results;
View Full Code Here

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

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

    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

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

        // 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

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

                                     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

Examples of de.danielbechler.diff.introspection.PropertyAccessor

  @Test
  public void testIsPrimitiveTypeReturnsPrimitiveClassForPrimitiveType() throws Exception
  {
    final Method readMethod = getClass().getDeclaredMethod("getTestValue");
    final PropertyAccessor accessor = new PropertyAccessor("testValue", readMethod, null);
    final Instances instances = new Instances(accessor, 1L, 2L, 0L);
    assertThat(instances.getType() == long.class).isTrue();
  }
View Full Code Here

Examples of groovy.beans.PropertyAccessor

        }

        Class<? extends PropertyAccessor> accessorClass = ACCESSORS.get(klass);
        if (accessorClass == null) {
            for (Class c : klass.getInterfaces()) {
                PropertyAccessor propertyAccessor = fetchPropertyAccessor(c);
                if (propertyAccessor != DefaultPropertyAccessor.INSTANCE) {
                    return propertyAccessor;
                }
            }
            return fetchPropertyAccessor(klass.getSuperclass());
View Full Code Here

Examples of net.sourceforge.squirrel_sql.plugins.hibernate.viewobjects.PropertyAccessor

      }

      try
      {
         Field f = clazz.getDeclaredField(_propertyName);
         return new PropertyAccessor(f);
      }
      catch (NoSuchFieldException nsfe)
      {
         try
         {
            Method m = clazz.getDeclaredMethod(toGetter(_propertyName, false));
            return new PropertyAccessor(m);
         }
         catch (NoSuchMethodException nsme)
         {
            try
            {
               Method m = clazz.getDeclaredMethod(toGetter(_propertyName, true));
               return new PropertyAccessor(m);
            }
            catch (NoSuchMethodException e)
            {
               return getAccessor(clazz.getSuperclass());
            }
View Full Code Here

Examples of ognl.PropertyAccessor

    }

    /** {@inheritDoc} */
    public PropertyAccessor getPropertyAccessor(String propertyName,
            Request request) {
        PropertyAccessor retValue;
        if (propertyName.endsWith("Scope")) {
            String scopeName = propertyName.substring(0, propertyName.length()
                    - ScopePropertyAccessor.SCOPE_SUFFIX_LENGTH);
            if (request.getContext(scopeName) != null) {
                return scopePropertyAccessor;
View Full Code Here

Examples of ognl.PropertyAccessor

     *
     * @return The OGNL evaluator.
     */
    private OGNLAttributeEvaluator createOGNLEvaluator() {
        try {
            PropertyAccessor objectPropertyAccessor = OgnlRuntime.getPropertyAccessor(Object.class);
            PropertyAccessor applicationContextPropertyAccessor = new NestedObjectDelegatePropertyAccessor<Request>(
                    new TilesApplicationContextNestedObjectExtractor(), objectPropertyAccessor);
            PropertyAccessor anyScopePropertyAccessor = new AnyScopePropertyAccessor();
            PropertyAccessor scopePropertyAccessor = new ScopePropertyAccessor();
            PropertyAccessorDelegateFactory<Request> factory = new TilesContextPropertyAccessorDelegateFactory(
                    objectPropertyAccessor, applicationContextPropertyAccessor, anyScopePropertyAccessor,
                    scopePropertyAccessor);
            PropertyAccessor tilesRequestAccessor = new DelegatePropertyAccessor<Request>(factory);
            OgnlRuntime.setPropertyAccessor(Request.class, tilesRequestAccessor);
            return new OGNLAttributeEvaluator();
        } catch (OgnlException e) {
            throw new TilesContainerFactoryException("Cannot initialize OGNL evaluator", e);
        }
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.