Package org.apache.commons.beanutils

Examples of org.apache.commons.beanutils.BeanUtilsBean


  public static final boolean TRIM_STR = true;

  private BeanUtilsBean beanUtils;

  public ConvertPopulatorBean() {
    beanUtils = new BeanUtilsBean(Converter.getDefault());
  }
View Full Code Here


  public ConvertPopulatorBean() {
    beanUtils = new BeanUtilsBean(Converter.getDefault());
  }

  public ConvertPopulatorBean(ConvertUtilsBean convertUtils) {
    beanUtils = new BeanUtilsBean(convertUtils);
  }
View Full Code Here

                    throws InvalidConfigException
  {
  super(true);
  _propPrefix = propPrefix;
  _configBuilder = dynConfigBuilder;
  _beanUtilsBean = new BeanUtilsBean();
  }
View Full Code Here

    public void testDigester()
        throws IOException, SAXException
    {
        PropertyUtilsBean propertyUtils = new MyPropertyUtilsBean();
        ConvertUtilsBean convertUtils = new ConvertUtilsBean();
        BeanUtilsBean beanUtils = new BeanUtilsBean( convertUtils, propertyUtils );
        BeanUtilsBean.setInstance( beanUtils );

        final String xml = "<myclass flag='true' />";
        final Digester digester = new Digester();
        digester.addObjectCreate( "myclass", MyClass.class );
View Full Code Here

    /**
     * Tests that with a specialized {@code BeanIntrospector} implementation the class
     * property can be suppressed.
     */
    public void testSuppressClassProperty() throws Exception {
        BeanUtilsBean bub = new BeanUtilsBean();
        bub.getPropertyUtils().addBeanIntrospector(
                SuppressPropertiesBeanIntrospector.SUPPRESS_CLASS);
        AlphaBean bean = new AlphaBean();
        try {
            bub.getProperty(bean, "class");
            fail("Could access class property!");
        } catch (NoSuchMethodException ex) {
            // ok
        }
    }
View Full Code Here

  {
    ConvertUtilsBean convertUtils = new ConvertUtilsBean();
    Integer intValue = (Integer)convertUtils.convert("456", int.class);

    assertEquals("correct int value", 456, intValue.intValue());
    BeanUtilsBean beanUtils = new BeanUtilsBean();
    PropertyDescriptor propDesc = beanUtils.getPropertyUtils().getPropertyDescriptor(_configBuilder,
                                                                                     "intSetting");
    assertEquals("correct setting type", int.class, propDesc.getPropertyType());

    _configManager.setSetting("com.linkedin.databus2.intSetting", " 123 ");
    DynamicConfig config = _configManager.getReadOnlyConfig();
View Full Code Here

        // Clear WrapDynaClass cache
        WrapDynaClass.clear();

        // replace the existing BeanUtilsBean instance for the current class loader with a new, clean instance
        BeanUtilsBean.setInstance(new BeanUtilsBean());

        // replace the existing LocaleBeanUtilsBean instance for the current class loader with a new, clean instance
        LocaleBeanUtilsBean.setInstance(new LocaleBeanUtilsBean());
    }
View Full Code Here

     */
    private static BeanUtilsBean initBeanUtilsBean()
    {
        PropertyUtilsBean propUtilsBean = new PropertyUtilsBean();
        propUtilsBean.addBeanIntrospector(new FluentPropertyBeanIntrospector());
        return new BeanUtilsBean(new ConvertUtilsBean(), propUtilsBean);
    }
View Full Code Here

                        properties.put(param.substring(
                                PARAM_NAME_PREFIX.length()), ctx.getRequest().getParameter(param));
                    }
                }
               
                new BeanUtilsBean(CONVERTER_UTILS_BEAN, new PropertyUtilsBean())
                        .populate(searchParams, properties);

            } catch (Exception e) {
                Throwable cause = e.getCause() != null ? e.getCause() : e;
                if (cause instanceof InvocationTargetException
View Full Code Here

        cub.register(new IntegerArrayConverter(), Integer[].class);

        // BigDecimal, BigInteger, Class, Date, String, Time, TimeStamp
        // do not use defaults in the default configuration of ConvertUtilsBean

        return new BeanUtilsBean(cub, new PropertyUtilsBean());
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.beanutils.BeanUtilsBean

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.