Package org.springframework.beans

Examples of org.springframework.beans.BeanWrapperImpl$OptionalUnwrapper


        return executeCallable((Callable<?>) callable, properties);
    }

    private ActionResult executeCallable(Callable<?> callable, Map<String, String> properties) {
        BeanWrapper beanWrapper = new BeanWrapperImpl(callable);
        PropertyValues propertyValues = new MutablePropertyValues(properties);

        try {
            beanWrapper.setPropertyValues(propertyValues, true, false);
        } catch (Exception e) {
            LOGGER.debug("Error while setting bean properties", e);
            return new ClassActionResult(e);
        }
View Full Code Here


                bd = new ChildBeanDefinition(parentName,clazz, null,null);
                bd.setSingleton(singleton);
            }

    }
    wrapper = new BeanWrapperImpl(bd);
    return bd;
  }
View Full Code Here

            if (auth.getPrincipal() == null) {
                return Tag.EVAL_PAGE;
            }

            try {
                BeanWrapperImpl wrapper = new BeanWrapperImpl(auth);
                result = wrapper.getPropertyValue(property);
            } catch (BeansException e) {
                throw new JspException(e);
            }
        }
View Full Code Here

        if (parent != null) {
          /*
           * Invoke the method and return the list type thing (it can be an
           * Array, List, Set or Map)
           */
          BeanWrapper wrapper = new BeanWrapperImpl (parent);
 
          Object listTypeThing = wrapper.getPropertyValue( childCollectionProperty() );

            if (logger.isDebugEnabled()) {
                logger.debug(String.format("returning %s from getChildCollection(parent=%s)",listTypeThing, parent));
            }
            return listTypeThing;
View Full Code Here

     * @throws SecurityException
     * @throws Exception
     *             Some problem.
     */
    private void setChildCollectionIntoParentObject( Object parent, Object newCollection ) {
            BeanWrapper wrapper = new BeanWrapperImpl(parent);
            wrapper.setPropertyValue( this.childCollectionProperty, newCollection);
    }
View Full Code Here

        /**
         * Iterate through children looking for child with id of id passed.
         */
        while(iterator.hasNext()){
            Object object = iterator.next();
            BeanWrapper wrapper = new BeanWrapperImpl(object);
            Long idPropertyValue = (Long) wrapper.getPropertyValue(this.idPropertyName);
            if (id.equals(idPropertyValue)) {
                child = (Serializable) object;
                break;
            }
        }
View Full Code Here

        /**
         * Iterate through children looking for child with id of id passed.
         */
        while(iterator.hasNext()){
            Object object = iterator.next();
            BeanWrapper wrapper = new BeanWrapperImpl(object);
            String idPropertyValue = (String) wrapper.getPropertyValue(this.idPropertyName);
            if (id.equalsIgnoreCase(idPropertyValue)) {
                child = (Serializable) object;
                break;
            }
        }
View Full Code Here

    @SuppressWarnings("unchecked")
  protected Object initChildCollection( Object parent ) throws Exception {
      if (parent == null) {
        return null;
      }
        BeanWrapper wrapper = new BeanWrapperImpl (parent);
        Object childCollection=null;
        Class propertyType = wrapper.getPropertyType( this.childCollectionProperty );
        if (List.class.isAssignableFrom( propertyType )) {
            childCollection = new ArrayList();
        } else if (Set.class.isAssignableFrom( propertyType )) {
            childCollection = new HashSet();
        } else if (Map.class.isAssignableFrom( propertyType )) {
View Full Code Here

    }
   
    /** Get the object id. */
    @SuppressWarnings("unchecked")
  private String getObjectParameterIdFromBagOrSet(Object object, Collection collection) {
        BeanWrapper wrapper = new BeanWrapperImpl(object);
        Object idValue =  wrapper.getPropertyValue(this.idPropertyName);

        if (idValue==null) {
            return "hc--" + object.hashCode();
        } else if (idValue instanceof String) {
            String strIdValue = (String) idValue;
View Full Code Here

    /** Get the object id. */
    @SuppressWarnings("unchecked")
  private String getObjectParameterIdFromList(Object object, List list) {


        BeanWrapper wrapper = new BeanWrapperImpl(object);
        Object idValue =  wrapper.getPropertyValue(this.idPropertyName);


        if (!(idValue instanceof Number || idValue == null) ) {
            throw new IllegalStateException("The value of index property is not a number");
        }
View Full Code Here

TOP

Related Classes of org.springframework.beans.BeanWrapperImpl$OptionalUnwrapper

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.