Class PropertyHelper
java.lang.Object
com.espertech.esper.common.internal.event.bean.core.PropertyHelper
This class offers utility methods around introspection.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected 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.protected static void
addMappedProperties
(Class clazz, List<PropertyStem> result) Adds to the given list of property descriptors the mapped properties, ie.static EventPropertyGetterSPI
getGetter
(Method method, EventBeanTypedEventFactory eventBeanTypedEventFactory, BeanEventTypeFactory beanEventTypeFactory) Return getter for the given method.static String
getGetterMethodName
(String propertyName) static String
getIsMethodName
(String propertyName) 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.static String
getSetterMethodName
(String propertyName) 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.protected static PropertyDescriptor[]
introspect
(Class clazz) Using the Java Introspector class the method returns the property descriptors obtained through introspection.protected static void
removeDuplicateProperties
(List<PropertyStem> properties) Removed duplicate properties using the property name to find unique properties.static void
removeJavaProperties
(List<PropertyStem> properties) Remove Java language specific properties from the given list of property descriptors.
-
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 foreventBeanTypedEventFactory
- factory for event beans and event typesbeanEventTypeFactory
- bean facory- Returns:
- property getter
-
getProperties
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
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
Remove Java language specific properties from the given list of property descriptors.- Parameters:
properties
- is the list of property descriptors
-
removeDuplicateProperties
Removed duplicate properties using the property name to find unique properties.- Parameters:
properties
- is a list of property descriptors
-
addIntrospectProperties
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 introspectresult
- is the list to add to
-
addMappedProperties
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 introspectresult
- is the list to add to
-
introspect
Using the Java Introspector class the method returns the property descriptors obtained through introspection.- Parameters:
clazz
- to introspect- Returns:
- array of property descriptors
-
getGetterMethodName
-
getSetterMethodName
-
getIsMethodName
-