Class BeanDescriptor

  • All Implemented Interfaces:
    Serializable

    public final class BeanDescriptor
    extends Object
    implements Serializable
    Contains basic information about the read and write methods for a bean class.
    Author:
    David B. Bracewell
    See Also:
    Serialized Form
    • Method Detail

      • createInstanceQuietly

        public Object createInstanceQuietly()
        Constructs an instance of the wrapped class ignoring any errors.
        Returns:
        An instance of the class or null if something went wrong.
      • getBeanClass

        public Class<?> getBeanClass()
        Returns:
        The associated class information.
      • getReadMethod

        public Method getReadMethod​(String methodName)
        Gets a read method by its name
        Parameters:
        methodName - The name of the method
        Returns:
        The method with the given name or null
      • getReadMethodNames

        public Set<String> getReadMethodNames()
        Returns:
        All of the names of the read methods
      • getReadMethods

        public Collection<Method> getReadMethods()
        Returns:
        All of the read methods
      • getWriteMethod

        public Method getWriteMethod​(String methodName)
        Gets a write method by its name
        Parameters:
        methodName - The name of the method
        Returns:
        The method with the given name or null
      • getWriteMethodNames

        public Set<String> getWriteMethodNames()
        Returns:
        All of the names of the write methods
      • getWriteMethods

        public Collection<Method> getWriteMethods()
        Returns:
        All of the write methods
      • hasReadMethod

        public boolean hasReadMethod​(String methodName)
        Determines if the descriptor has a read method named with the given string.
        Parameters:
        methodName - The read method we want to check for
        Returns:
        True if the method exists, false otherwise
      • hasWriteMethod

        public boolean hasWriteMethod​(String methodName)
        Determines if the descriptor has a write method named with the given string.
        Parameters:
        methodName - The write method we want to check for
        Returns:
        True if the method exists, false otherwise
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • numberOfReadMethods

        public int numberOfReadMethods()
        Returns:
        The number of read methods
      • numberOfWriteMethods

        public int numberOfWriteMethods()
        Returns:
        The number of write methods