Content deleted Content added
m replace link to deleted Portal:Java (programming language) with Portal:Computer programming |
added Category:Apache Commons using HotCat |
||
(3 intermediate revisions by 3 users not shown) | |||
Line 18:
}}
'''Apache Commons BeanUtils''' is a [[Java platform|Java]]-based utility to provide [[Component-based software engineering|component based architecture]].<ref name=":0">{{Cite web|url=https://commons.apache.org/proper/commons-beanutils/index.html|title=BeanUtils – Commons|website=commons.apache.org|access-date=2019-08-20}}</ref><ref>{{Cite book|url=https://books.google.
== Modules ==
Line 29:
== Example ==
Sample code may look like as follows:
<
/**
* Example displaying the new default behaviour such that
Line 36:
*/
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) {
//
}
}
Line 52:
*/
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);
}
</
== See also ==
Line 78:
[[Category:Free software programmed in Java (programming language)]]
[[Category:Software using the Apache license]]
[[Category:Apache Commons|BeanUtils]]
|