com.espertech.esper.event.bean
Class PropertyHelper

java.lang.Object
  extended by com.espertech.esper.event.bean.PropertyHelper

public class PropertyHelper
extends java.lang.Object

This class offers utililty methods around introspection and CGLIB interaction.


Constructor Summary
PropertyHelper()
           
 
Method Summary
protected static void addIntrospectProperties(java.lang.Class clazz, java.util.List<InternalEventPropDescriptor> 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(java.lang.Class clazz, java.util.List<InternalEventPropDescriptor> result)
          Adds to the given list of property descriptors the mapped properties, ie.
static EventPropertyGetter getGetter(java.lang.reflect.Method method, net.sf.cglib.reflect.FastClass fastClass, EventAdapterService eventAdapterService)
          Return getter for the given method and CGLIB FastClass.
static java.lang.String getGetterMethodName(java.lang.String propertyName)
           
static java.lang.String getIsMethodName(java.lang.String propertyName)
           
static java.util.List<InternalEventPropDescriptor> getProperties(java.lang.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 java.lang.String getSetterMethodName(java.lang.String propertyName)
           
static java.util.Set<WriteablePropertyDescriptor> getWritableProperties(java.lang.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 java.beans.PropertyDescriptor[] introspect(java.lang.Class clazz)
          Using the Java Introspector class the method returns the property descriptors obtained through introspection.
protected static void removeDuplicateProperties(java.util.List<InternalEventPropDescriptor> properties)
          Removed duplicate properties using the property name to find unique properties.
protected static void removeJavaProperties(java.util.List<InternalEventPropDescriptor> properties)
          Remove Java language specific properties from the given list of property descriptors.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyHelper

public PropertyHelper()
Method Detail

getGetter

public static EventPropertyGetter getGetter(java.lang.reflect.Method method,
                                            net.sf.cglib.reflect.FastClass fastClass,
                                            EventAdapterService eventAdapterService)
Return getter for the given method and CGLIB FastClass.

Parameters:
method - to return getter for
fastClass - is the CGLIB fast classs to make FastMethod for
eventAdapterService - factory for event beans and event types
Returns:
property getter

getProperties

public static java.util.List<InternalEventPropDescriptor> getProperties(java.lang.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 java.util.Set<WriteablePropertyDescriptor> getWritableProperties(java.lang.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

protected static void removeJavaProperties(java.util.List<InternalEventPropDescriptor> 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(java.util.List<InternalEventPropDescriptor> 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(java.lang.Class clazz,
                                              java.util.List<InternalEventPropDescriptor> 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(java.lang.Class clazz,
                                          java.util.List<InternalEventPropDescriptor> 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 java.beans.PropertyDescriptor[] introspect(java.lang.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 java.lang.String getGetterMethodName(java.lang.String propertyName)

getSetterMethodName

public static java.lang.String getSetterMethodName(java.lang.String propertyName)

getIsMethodName

public static java.lang.String getIsMethodName(java.lang.String propertyName)

© 2006-2015 EsperTech Inc.
All rights reserved.
Visit us at espertech.com