Package org.jspresso.framework.util.bean

Examples of org.jspresso.framework.util.bean.AccessorInfo


        // this is certainly normal.
      }
      if (isLifecycleMethod) {
        return new Boolean(invokeLifecycleInterceptors(proxy, method, args));
      }
      AccessorInfo accessorInfo = new AccessorInfo(method);
      EAccessorType accessorType = accessorInfo.getAccessorType();
      IPropertyDescriptor propertyDescriptor = null;
      if (accessorType != EAccessorType.NONE) {
        String accessedPropertyName = accessorInfo.getAccessedPropertyName();
        if (accessedPropertyName != null) {
          propertyDescriptor = componentDescriptor
              .getPropertyDescriptor(accessedPropertyName);
        }
      }
      if (propertyDescriptor != null) {
        Class<IComponentExtension<IComponent>> extensionClass = (Class<IComponentExtension<IComponent>>) propertyDescriptor
            .getDelegateClass();
        if (extensionClass != null) {
          IComponentExtension<? extends IComponent> extensionDelegate = getExtensionInstance(
              extensionClass, (IComponent) proxy);
          return invokeExtensionMethod(extensionDelegate, method, args);
        } else if (!propertyDescriptor.isComputed()) {
          if (accessorInfo.isModifier()) {
            if (modifierMonitors != null
                && modifierMonitors.contains(methodName)) {
              return null;
            }
            if (modifierMonitors == null) {
              modifierMonitors = new HashSet<String>();
            }
            modifierMonitors.add(methodName);
          }
          try {
            switch (accessorType) {
              case GETTER:
                return getProperty(proxy, propertyDescriptor);
              case SETTER:
                setProperty(proxy, propertyDescriptor, args[0]);
                return null;
              case ADDER:
                if (args.length == 2) {
                  addToProperty(proxy,
                      (ICollectionPropertyDescriptor<?>) propertyDescriptor,
                      ((Integer) args[0]).intValue(), args[1]);
                } else {
                  addToProperty(proxy,
                      (ICollectionPropertyDescriptor<?>) propertyDescriptor,
                      args[0]);
                }
                return null;
              case REMOVER:
                removeFromProperty(proxy,
                    (ICollectionPropertyDescriptor<?>) propertyDescriptor,
                    args[0]);
                return null;
              default:
                break;
            }
          } finally {
            if (modifierMonitors != null && accessorInfo.isModifier()) {
              modifierMonitors.remove(methodName);
            }
          }
        } else {
          try {
View Full Code Here


  public synchronized Object invoke(@SuppressWarnings("unused")
  Object proxy, Method method, Object[] args) throws Throwable {
    if ("getComponentContract".equals(method.getName())) {
      return componentDelegate.getComponentContract();
    }
    AccessorInfo accessorInfo = new AccessorInfo(method);
    EAccessorType accessorType = accessorInfo.getAccessorType();
    if (accessorType == EAccessorType.SETTER) {
      String accessedPropertyName = accessorInfo.getAccessedPropertyName();
      if (accessedPropertyName != null) {
        componentDelegate.straightSetProperty(accessedPropertyName, args[0]);
        return null;
      }
    } else if (accessorType == EAccessorType.GETTER) {
      String accessedPropertyName = accessorInfo.getAccessedPropertyName();
      if (IQueryComponent.QUERIED_COMPONENTS.equals(accessedPropertyName)) {
        if (accessedPropertyName != null) {
          return componentDelegate.straightGetProperty(accessedPropertyName);
        }
      }
View Full Code Here

TOP

Related Classes of org.jspresso.framework.util.bean.AccessorInfo

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.