Apache Commons BeanUtils

Last updated
Apache Commons BeanUtils
Developer(s) Apache Software Foundation
Stable release
1.9.4
Repository https://github.com/apache/commons-beanutils
Written in Java
Operating system Cross-platform
License Apache License 2.0
Website commons.apache.org/proper/commons-beanutils/index.html

Apache Commons BeanUtils is a Java-based utility to provide component based architecture. [1] [2] [3]

Contents

Modules

The library is distributed in three jar files:

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.*/publicvoidtestSuppressClassPropertyByDefault()throwsException{finalBeanUtilsBeanbub=newBeanUtilsBean();finalAlphaBeanbean=newAlphaBean();try{bub.getProperty(bean,"class");fail("Could access class property!");}catch(finalNoSuchMethodExceptionex){// 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.*/publicvoidtestAllowAccessToClassProperty()throwsException{finalBeanUtilsBeanbub=newBeanUtilsBean();bub.getPropertyUtils().removeBeanIntrospector(SuppressPropertiesBeanIntrospector.SUPPRESS_CLASS);finalAlphaBeanbean=newAlphaBean();Stringresult=bub.getProperty(bean,"class");assertEquals("Class property should have been accessed","class org.apache.commons.beanutils2.AlphaBean",result);}

[1]

See also

Related Research Articles

Java Platform, Standard Edition is a computing platform for development and deployment of portable code for desktop and server environments. Java SE was formerly known as Java 2 Platform, Standard Edition (J2SE).

Jakarta Server Pages is a collection of technologies that helps software developers create dynamically generated web pages based on HTML, XML, SOAP, or other document types. Released in 1999 by Sun Microsystems, JSP is similar to PHP and ASP, but uses the Java programming language.

In software engineering, the mediator pattern defines an object that encapsulates how a set of objects interact. This pattern is considered to be a behavioral pattern due to the way it can alter the program's running behavior.

<span class="mw-page-title-main">JAR (file format)</span> Java archive file format

A JAR file is a package file format typically used to aggregate many Java class files and associated metadata and resources into one file for distribution.

<span class="mw-page-title-main">Apache Ant</span> Java software tool

Apache Ant is a software tool for automating software build processes for Java applications which originated from the Apache Tomcat project in early 2000 as a replacement for the Make build tool of Unix. It is similar to Make, but is implemented using the Java language and requires the Java platform. Unlike Make, which uses the Makefile format, Ant uses XML to describe the code build process and its dependencies.

<span class="mw-page-title-main">NUnit</span>

NUnit is an open-source unit testing framework for the .NET Framework and Mono. It serves the same purpose as JUnit does in the Java world, and is one of many programs in the xUnit family.

<span class="mw-page-title-main">Java syntax</span> Set of rules defining correctly structured program

The syntax of Java is the set of rules defining how a Java program is written and interpreted.

In computing based on the Java Platform, JavaBeans is a technology developed by Sun Microsystems and released in 1996, as part of JDK 1.1.

Maven is a build automation tool used primarily for Java projects. Maven can also be used to build and manage projects written in C#, Ruby, Scala, and other languages. The Maven project is hosted by The Apache Software Foundation, where it was formerly part of the Jakarta Project.

<span class="mw-page-title-main">Log4j</span> Java-based logging software

Apache Log4j is a Java-based logging utility originally written by Ceki Gülcü. It is part of the Apache Logging Services, a project of the Apache Software Foundation. Log4j is one of several Java logging frameworks.

In the Java computer programming language, an annotation is a form of syntactic metadata that can be added to Java source code. Classes, methods, variables, parameters and Java packages may be annotated. Like Javadoc tags, Java annotations can be read from source files. Unlike Javadoc tags, Java annotations can also be embedded in and read from Java class files generated by the Java compiler. This allows annotations to be retained by the Java virtual machine at run-time and read via reflection. It is possible to create meta-annotations out of the existing ones in Java.

<span class="mw-page-title-main">Java collections framework</span> Collections in Java

The Java collections framework is a set of classes and interfaces that implement commonly reusable collection data structures.

Jakarta Mail is a Jakarta EE API used to send and receive email via SMTP, POP3 and IMAP. Jakarta Mail is built into the Jakarta EE platform, but also provides an optional package for use in Java SE.

This article describes the syntax of the C# programming language. The features described are compatible with .NET Framework and Mono.

Hector is a high-level client API for Apache Cassandra. Named after Hector, a warrior of Troy in Greek mythology, it is a substitute for the Cassandra Java Client, or Thrift, that is encapsulated by Hector. It also has Maven repository access.

Composite entity is a Java EE Software design pattern and it is used to model, represent, and manage a set of interrelated persistent objects rather than representing them as individual fine-grained entity beans, and also a composite entity bean represents a graph of objects.

Apache Commons Logging is a Java-based logging utility and a programming model for logging and for other toolkits. It provides APIs, log implementations, and wrapper implementations over some other tools.

The Java programming language's Java Collections Framework version 1.5 and later defines and implements the original regular single-threaded Maps, and also new thread-safe Maps implementing the java.util.concurrent.ConcurrentMap interface among other concurrent interfaces. In Java 1.6, the java.util.NavigableMap interface was added, extending java.util.SortedMap, and the java.util.concurrent.ConcurrentNavigableMap interface was added as a subinterface combination.

Business delegate is a Java EE design pattern. This pattern is directed towards reducing the coupling in between business services and the connected presentation tier, and to hide the implementation details of services. Business delegates acts as an adaptor to invoke business objects from the presentation tier.

References

  1. 1 2 3 "BeanUtils – Commons". commons.apache.org. Retrieved 2019-08-20.
  2. Berglund, Tim; McCullough, Matthew (2011-07-13). Building and Testing with Gradle. "O'Reilly Media, Inc.". p. 57. ISBN   9781449304638.
  3. Company, Sonatype (2008-09-24). Maven: The Definitive Guide: The Definitive Guide. "O'Reilly Media, Inc.". p. 136. ISBN   9780596551780.