Class DefaultBeanIntrospector

  • All Implemented Interfaces:
    IBeanIntrospector

    public class DefaultBeanIntrospector
    extends java.lang.Object
    implements IBeanIntrospector
    Introspector for Java beans. It uses the reflection to build up a map with property infos (name, read/write method, etc.)
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected BeanProperty createBeanProperty​(java.lang.String name, java.lang.Class<?> type, java.lang.reflect.Method getter, java.lang.reflect.Method setter, java.lang.Class<?> settertype, java.lang.reflect.Type generictype)
      Creates a bean property based on getter/setter.
      protected BeanProperty createBeanProperty​(java.lang.String name, java.lang.reflect.Field field, boolean anonclass)
      Creates a bean property based on a field.
      protected DefaultBeanIntrospector.BeanClassInfo getBeanClassInfo​(java.lang.Class<?> clazz, boolean includemethods, boolean includefields)  
      java.lang.invoke.MethodHandle getBeanConstructor​(java.lang.Class<?> clazz, boolean includemethods, boolean includefields)
      Get the bean constructor for a specific clazz.
      java.util.Map<java.lang.String,​BeanProperty> getBeanProperties​(java.lang.Class<?> clazz, boolean includemethods, boolean includefields)
      Get the bean properties for a specific clazz.
      • Methods inherited from class java.lang.Object

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

      • DefaultBeanIntrospector

        public DefaultBeanIntrospector()
        Create a new introspector.
      • DefaultBeanIntrospector

        public DefaultBeanIntrospector​(int lrusize)
        Create a new introspector.
    • Method Detail

      • getBeanConstructor

        public java.lang.invoke.MethodHandle getBeanConstructor​(java.lang.Class<?> clazz,
                                                                boolean includemethods,
                                                                boolean includefields)
        Get the bean constructor for a specific clazz.
        Specified by:
        getBeanConstructor in interface IBeanIntrospector
      • getBeanProperties

        public java.util.Map<java.lang.String,​BeanProperty> getBeanProperties​(java.lang.Class<?> clazz,
                                                                                    boolean includemethods,
                                                                                    boolean includefields)
        Get the bean properties for a specific clazz.
        Specified by:
        getBeanProperties in interface IBeanIntrospector
        Parameters:
        clazz - The class to inspect.
        Returns:
        The map of properties (name -> BeanProperty).
      • createBeanProperty

        protected BeanProperty createBeanProperty​(java.lang.String name,
                                                  java.lang.Class<?> type,
                                                  java.lang.reflect.Method getter,
                                                  java.lang.reflect.Method setter,
                                                  java.lang.Class<?> settertype,
                                                  java.lang.reflect.Type generictype)
        Creates a bean property based on getter/setter.
        Parameters:
        name - Property name
        type - Property type.
        getter - The getter method.
        setter - The setter method.
        settertype - The type used by the setter.
        Returns:
        The bean property.
      • createBeanProperty

        protected BeanProperty createBeanProperty​(java.lang.String name,
                                                  java.lang.reflect.Field field,
                                                  boolean anonclass)
        Creates a bean property based on a field.
        Parameters:
        name - Property name
        field - The field.
        Returns:
        The bean property.