Examples of BeanWrapperImpl


Examples of org.springframework.beans.BeanWrapperImpl

    public static Object getPropertyValue(Object obj, String prop) {
        return (new BeanWrapperImpl(obj)).getPropertyValue(prop);
    }
   
    public static void setPropertyValue(Object obj, String prop, Object value) {
        (new BeanWrapperImpl(obj)).setPropertyValue(prop, value);
    }   
View Full Code Here

Examples of org.springframework.beans.BeanWrapperImpl

    public static void setPropertyValue(Object obj, String prop, Object value) {
        (new BeanWrapperImpl(obj)).setPropertyValue(prop, value);
    }   

    public static boolean hasProperty(Object obj, String prop) {
        return (new BeanWrapperImpl(obj)).isReadableProperty(prop);
    }
View Full Code Here

Examples of org.springframework.beans.BeanWrapperImpl

                        @Override
                        public void populateItem(final Item<ICellPopulator<AbstractSchemaTO>> item,
                                final String componentId, final IModel<AbstractSchemaTO> model) {

                            BeanWrapper bwi = new BeanWrapperImpl(model.getObject());
                            Object obj = bwi.getPropertyValue(field);

                            item.add(new Label(componentId, ""));
                            item.add(new AttributeModifier("class", new Model<String>(obj.toString())));
                        }
View Full Code Here

Examples of org.springframework.beans.BeanWrapperImpl

    return memberCollection.containsKey(id);
  }

  // alternative way of copying values
  public void copyValues(Member source, Member target, Iterable<String> properties) {
    BeanWrapper src = new BeanWrapperImpl(source);
    BeanWrapper trg = new BeanWrapperImpl(target);

    for(String propertyName : properties){
      trg.setPropertyValue(propertyName,src.getPropertyValue(propertyName)
      );
    }

  }
View Full Code Here

Examples of org.springframework.beans.BeanWrapperImpl

        fs.exists(new Path(path + "/test/" + DatasetUtils.getDatasetName(recordClass) + "/.metadata")));
    Collection<T> results = datasetOperations.read(recordClass);
    assertEquals(2, results.size());
    List<T> sorted = new ArrayList<T>(results);
    Collections.sort(sorted);
    BeanWrapper result = new BeanWrapperImpl(sorted.get(0));
    assertTrue(result.isReadableProperty("name"));
    assertTrue(result.getPropertyValue("name").equals("Sven"));
    assertTrue(result.isReadableProperty("id"));
    assertTrue(result.getPropertyValue("id").equals(22L));
    result = new BeanWrapperImpl(sorted.get(1));
    assertTrue(result.isReadableProperty("name"));
    assertTrue(result.getPropertyValue("name").equals("Nisse"));
    assertTrue(result.isReadableProperty("id"));
    assertTrue(result.getPropertyValue("id").equals(48L));
  }
View Full Code Here

Examples of org.springframework.beans.BeanWrapperImpl

            return null;
        }
       
        try {
           
            final BeanWrapperImpl wrapper = new BeanWrapperImpl(authentication);
            final Object propertyObj = wrapper.getPropertyValue(property);
           
            if (logger.isTraceEnabled()) {
                logger.trace("[THYMELEAF][{}] Property \"{}\" obtained from authentication object " +
                    "for user \"{}\". Returned value of class {}.",
                        new Object[] {TemplateEngine.threadIndex(), property, authentication.getName(),
View Full Code Here

Examples of org.springframework.beans.BeanWrapperImpl

  private BeanWrapper user;

  public UserBuilder(Organization org) {
    User target = new User();
    target.setOrganization(org);
    user = new BeanWrapperImpl(target);
  }
View Full Code Here

Examples of org.springframework.beans.BeanWrapperImpl

  private BeanWrapper authPolicy;

  public AuthenticationPolicyBuilder() {
    AuthenticationPolicy target = new AuthenticationPolicy();
    authPolicy = new BeanWrapperImpl(target);
  }
View Full Code Here

Examples of org.springframework.beans.BeanWrapperImpl

  public void findsRepositoryFactories() {

    DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory() {
      @Override
      protected BeanWrapper instantiateBean(String beanName, RootBeanDefinition mbd) {
        return beanName.equals("repoFactory") ? new BeanWrapperImpl(factory) : super.instantiateBean(beanName, mbd);
      }
    };

    beanFactory.registerBeanDefinition("postProcessor", new RootBeanDefinition(PredictingProcessor.class));
    beanFactory.registerBeanDefinition("repoFactory", new RootBeanDefinition(RepositoryFactoryBeanSupport.class));
View Full Code Here

Examples of org.springframework.beans.BeanWrapperImpl

     *
     * @param bean The bean to be wraped.
     * @return The bean wrapper that wraps the given bean.
     */
    protected BeanWrapper wrapBean(Object bean) {
        return new BeanWrapperImpl(bean);
    }
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.