Apache Commons BeanUtils: Difference between revisions

Content deleted Content added
Created page with '{{Infobox software | name = Apache Commons BeanUtils | logo = | screenshot = | caption = | developer = Apache Software Foundation | released = | latest r...'
 
 
(7 intermediate revisions by 6 users not shown)
Line 13:
| programming language = [[Java (programming language)|Java]]
| operating system = [[Cross-platform]]
| genre = [[Logging Tool]]
| license = [[Apache License 2.0]]
| website = {{URL|https://commons.apache.org/proper/commons-beanutils/index.html}}
}}
 
'''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.co.ukcom/books?id=g2K2zBZWf0wC|title=Building and Testing with Gradle|lastlast1=Berglund|firstfirst1=Tim|last2=McCullough|first2=Matthew|date=2011-07-13|publisher="O'Reilly Media, Inc."|year=|isbn=9781449304638|___location=|pages=57|language=en}}</ref><ref>{{Cite book|url=https://books.google.co.ukcom/books?id=cBvZ4s72Z0gC|title=Maven: The Definitive Guide: The Definitive Guide|last=Company|first=Sonatype|date=2008-09-24|publisher="O'Reilly Media, Inc."|year=|isbn=9780596551780|___location=|pages=136|language=en}}</ref>
 
== Modules ==
Line 29:
== Example ==
Sample code may look like as follows:
<sourcesyntaxhighlight lang="java">
/**
* 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) {
// okOk
}
}
 
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);
}
</sourcesyntaxhighlight><ref name=":0" />
 
== See also ==
{{Portal|JavaComputer (programming language)|Free and open-source software}}
 
* {{GitHub|https://github.com/apache/commons-beanutils}}
Line 74:
{{Apache Software Foundation}}
 
{{DEFAULTSORT:Commons BeanUtils}}
[[Category:Apache Software Foundation]]
[[Category:Free software programmed in Java (programming language)]]
[[Category:Software using the Apache license]]
[[Category:Apache Commons|BeanUtils]]