Org. apache. commons. beanutils is a sub-project under Apache commons. Because of tracking struts, we tracked this package in depth and found that some static tool functions provided by the beanutils class are still very useful. This toolkit is widely used in struts to operate the struts actionform object.
Clonebean: copy a bean object. The reflect method is used to call getter and setter to copy bean objects, which is equally effective for bean objects that do not implement the clone method.
Copyproperties: copy the Same Name attribute of the source bean to the same name attribute of the target bean. Only duplicate attributes with the same name of two beans, so the two beans can be of the same type, integration relationship, or completely irrelevant. As long as there are some attributes with the same name, getter and setter can both be copied.
Describe: Put the names and values of all attributes of a bean object in a map object and return them. Very useful method. The specific procedure is to callJava. Beans. beaninfo. getpropertydescriptors ()Method.
Getproperty: obtains the property value of a bean object based on its property name.
These methods can be used flexibly to greatly reduce the complexity of bean objects.