Menu
Home Explore People Places Arts History Plants & Animals Science Life & Culture Technology
On this page
Apache Commons BeanUtils
Software by Apache Software Foundation

Apache Commons BeanUtils is a Java-based utility to provide component based architecture.

We don't have any images related to Apache Commons BeanUtils yet.
We don't have any YouTube videos related to Apache Commons BeanUtils yet.
We don't have any PDF documents related to Apache Commons BeanUtils yet.
We don't have any Books related to Apache Commons BeanUtils yet.
We don't have any archived web articles related to Apache Commons BeanUtils yet.

Modules

The library is distributed in three jar files:

  • commons-beanutils.jar - contains everything
  • commons-beanutils-core.jar - excludes Bean Collections classes
  • commons-beanutils-bean-collections.jar - only Bean Collections classes.4

Example

Sample code may look like as follows:

/** * Example displaying the new default behaviour such that * it is not possible to access class level properties utilizing the * BeanUtilsBean, which in turn utilizes the PropertyUtilsBean. */ public void testSuppressClassPropertyByDefault() throws Exception { final BeanUtilsBean bub = new BeanUtilsBean(); final AlphaBean bean = new AlphaBean(); try { bub.getProperty(bean, "class"); fail("Could access class property!"); } catch (final NoSuchMethodException ex) { // Ok } } /** * Example showing how by which one would use to revert to the * behaviour prior to the 1.9.4 release where class level properties were accessible by * the BeanUtilsBean and the PropertyUtilsBean. */ public void testAllowAccessToClassProperty() throws Exception { final BeanUtilsBean bub = new BeanUtilsBean(); bub.getPropertyUtils().removeBeanIntrospector(SuppressPropertiesBeanIntrospector.SUPPRESS_CLASS); final AlphaBean bean = new AlphaBean(); String result = bub.getProperty(bean, "class"); assertEquals("Class property should have been accessed", "class org.apache.commons.beanutils2.AlphaBean", result); }

5

See also

  • Computer programming portal
  • Free and open-source software portal

References

  1. "BeanUtils – Commons". commons.apache.org. Retrieved 2019-08-20. https://commons.apache.org/proper/commons-beanutils/index.html

  2. Berglund, Tim; McCullough, Matthew (2011-07-13). Building and Testing with Gradle. "O'Reilly Media, Inc.". p. 57. ISBN 9781449304638. 9781449304638

  3. Company, Sonatype (2008-09-24). Maven: The Definitive Guide: The Definitive Guide. "O'Reilly Media, Inc.". p. 136. ISBN 9780596551780. {{cite book}}: |last= has generic name (help) 9780596551780

  4. "BeanUtils – Commons". commons.apache.org. Retrieved 2019-08-20. https://commons.apache.org/proper/commons-beanutils/index.html

  5. "BeanUtils – Commons". commons.apache.org. Retrieved 2019-08-20. https://commons.apache.org/proper/commons-beanutils/index.html