Class BeanUtils


  • public class BeanUtils
    extends java.lang.Object
    Simple JavaBean manipulation helper methods
    Since:
    4.0
    Author:
    Manik Surtani (manik@jboss.org)
    • Constructor Summary

      Constructors 
      Constructor Description
      BeanUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String fluentSetterName​(java.lang.String fieldName)
      Retrieves a setter name based on a field name passed in
      static java.lang.reflect.Method getterMethod​(java.lang.Class<?> target, java.lang.Class<?> componentClass)
      Returns a Method object corresponding to a getter that retrieves an instance of componentClass from target.
      static java.lang.String getterName​(java.lang.Class<?> componentClass)
      Returns a getter for a given class
      static java.lang.reflect.Method setterMethod​(java.lang.Class<?> target, java.lang.Class<?> componentClass)
      Returns a Method object corresponding to a setter that sets an instance of componentClass from target.
      static java.lang.String setterName​(java.lang.Class<?> componentClass)
      Returns a setter for a given class
      static java.lang.String setterName​(java.lang.String fieldName)
      Retrieves a setter name based on a field name passed in
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BeanUtils

        public BeanUtils()
    • Method Detail

      • setterName

        public static java.lang.String setterName​(java.lang.String fieldName)
        Retrieves a setter name based on a field name passed in
        Parameters:
        fieldName - field name to find setter for
        Returns:
        name of setter method
      • fluentSetterName

        public static java.lang.String fluentSetterName​(java.lang.String fieldName)
        Retrieves a setter name based on a field name passed in
        Parameters:
        fieldName - field name to find setter for
        Returns:
        name of setter method
      • getterName

        public static java.lang.String getterName​(java.lang.Class<?> componentClass)
        Returns a getter for a given class
        Parameters:
        componentClass - class to find getter for
        Returns:
        name of getter method
      • setterName

        public static java.lang.String setterName​(java.lang.Class<?> componentClass)
        Returns a setter for a given class
        Parameters:
        componentClass - class to find setter for
        Returns:
        name of getter method
      • getterMethod

        public static java.lang.reflect.Method getterMethod​(java.lang.Class<?> target,
                                                            java.lang.Class<?> componentClass)
        Returns a Method object corresponding to a getter that retrieves an instance of componentClass from target.
        Parameters:
        target - class that the getter should exist on
        componentClass - component to get
        Returns:
        Method object, or null of one does not exist
      • setterMethod

        public static java.lang.reflect.Method setterMethod​(java.lang.Class<?> target,
                                                            java.lang.Class<?> componentClass)
        Returns a Method object corresponding to a setter that sets an instance of componentClass from target.
        Parameters:
        target - class that the setter should exist on
        componentClass - component to set
        Returns:
        Method object, or null of one does not exist