java.lang.Object
com.espertech.esper.common.internal.event.bean.core.PropertyHelper

public class PropertyHelper extends Object
This class offers utility methods around introspection.
  • Constructor Details

    • PropertyHelper

      public PropertyHelper()
  • Method Details

    • getGetter

      public static EventPropertyGetterSPI getGetter(Method method, EventBeanTypedEventFactory eventBeanTypedEventFactory, BeanEventTypeFactory beanEventTypeFactory)
      Return getter for the given method.
      Parameters:
      method - to return getter for
      eventBeanTypedEventFactory - factory for event beans and event types
      beanEventTypeFactory - bean facory
      Returns:
      property getter
    • getProperties

      public static List<PropertyStem> getProperties(Class clazz)
      Introspects the given class and returns event property descriptors for each property found in the class itself, it's superclasses and all interfaces this class and the superclasses implements.
      Parameters:
      clazz - is the Class to introspect
      Returns:
      list of properties
    • getWritableProperties

      public static Set<WriteablePropertyDescriptor> getWritableProperties(Class clazz)
      Introspects the given class and returns event property descriptors for each writable property found in the class itself, it's superclasses and all interfaces this class and the superclasses implements.
      Parameters:
      clazz - is the Class to introspect
      Returns:
      list of properties
    • removeJavaProperties

      public static void removeJavaProperties(List<PropertyStem> properties)
      Remove Java language specific properties from the given list of property descriptors.
      Parameters:
      properties - is the list of property descriptors
    • removeDuplicateProperties

      protected static void removeDuplicateProperties(List<PropertyStem> properties)
      Removed duplicate properties using the property name to find unique properties.
      Parameters:
      properties - is a list of property descriptors
    • addIntrospectProperties

      protected static void addIntrospectProperties(Class clazz, List<PropertyStem> result)
      Adds to the given list of property descriptors the properties of the given class using the Introspector to introspect properties. This also finds array and indexed properties.
      Parameters:
      clazz - to introspect
      result - is the list to add to
    • addMappedProperties

      protected static void addMappedProperties(Class clazz, List<PropertyStem> result)
      Adds to the given list of property descriptors the mapped properties, ie. properties that have a getter method taking a single String value as a parameter.
      Parameters:
      clazz - to introspect
      result - is the list to add to
    • introspect

      protected static PropertyDescriptor[] introspect(Class clazz)
      Using the Java Introspector class the method returns the property descriptors obtained through introspection.
      Parameters:
      clazz - to introspect
      Returns:
      array of property descriptors
    • getGetterMethodName

      public static String getGetterMethodName(String propertyName)
    • getSetterMethodName

      public static String getSetterMethodName(String propertyName)
    • getIsMethodName

      public static String getIsMethodName(String propertyName)