Class ListFieldPropertyGetter
java.lang.Object
com.espertech.esper.common.internal.event.bean.getter.BaseNativePropertyGetter
com.espertech.esper.common.internal.event.bean.getter.ListFieldPropertyGetter
- All Implemented Interfaces:
EventPropertyGetter
,EventPropertyGetterIndexed
,EventPropertyValueGetter
,BeanEventPropertyGetter
,EventPropertyGetterAndIndexed
,EventPropertyGetterIndexedSPI
,EventPropertyGetterSPI
,EventPropertyValueGetterForge
public class ListFieldPropertyGetter
extends BaseNativePropertyGetter
implements BeanEventPropertyGetter, EventPropertyGetterAndIndexed
Getter for a list property backed by a field, identified by a given index, using vanilla reflection.
-
Field Summary
Fields inherited from class com.espertech.esper.common.internal.event.bean.getter.BaseNativePropertyGetter
isFragmentable, returnType
Fields inherited from interface com.espertech.esper.common.client.EventPropertyValueGetter
EPTYPE, EPTYPEARRAY
-
Constructor Summary
ConstructorDescriptionListFieldPropertyGetter
(Field field, int index, EventBeanTypedEventFactory eventBeanTypedEventFactory, BeanEventTypeFactory beanEventTypeFactory) -
Method Summary
Modifier and TypeMethodDescriptioneventBeanExistsCodegen
(CodegenExpression beanExpression, CodegenMethodScope codegenMethodScope, CodegenClassScope codegenClassScope) eventBeanGetCodegen
(CodegenExpression beanExpression, CodegenMethodScope codegenMethodScope, CodegenClassScope codegenClassScope) eventBeanGetIndexedCodegen
(CodegenMethodScope codegenMethodScope, CodegenClassScope codegenClassScope, CodegenExpression beanExpression, CodegenExpression key) final Object
Return the value for the property in the event object specified when the instance was obtained.Return the value for the property in the event object specified when the instance was obtained.getBeanProp
(Object object) Returns the property as an object.boolean
isBeanExistsProperty
(Object object) Returns true if the dynamic property exists.boolean
isExistsProperty
(EventBean eventBean) Returns true if the property exists, or false if the type does not have such a property.toString()
underlyingExistsCodegen
(CodegenExpression underlyingExpression, CodegenMethodScope codegenMethodScope, CodegenClassScope codegenClassScope) underlyingGetCodegen
(CodegenExpression underlyingExpression, CodegenMethodScope codegenMethodScope, CodegenClassScope codegenClassScope) Methods inherited from class com.espertech.esper.common.internal.event.bean.getter.BaseNativePropertyGetter
eventBeanFragmentCodegen, getBeanPropType, getFragment, getFragmentDynamic, getFragmentFromValue, toFragmentArray, toFragmentIterable, underlyingFragmentCodegen
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.espertech.esper.common.internal.event.bean.core.BeanEventPropertyGetter
getBeanPropType
Methods inherited from interface com.espertech.esper.common.client.EventPropertyGetter
getFragment
Methods inherited from interface com.espertech.esper.common.internal.event.core.EventPropertyGetterSPI
eventBeanFragmentCodegen, underlyingFragmentCodegen
-
Constructor Details
-
ListFieldPropertyGetter
public ListFieldPropertyGetter(Field field, int index, EventBeanTypedEventFactory eventBeanTypedEventFactory, BeanEventTypeFactory beanEventTypeFactory)
-
-
Method Details
-
get
Description copied from interface:EventPropertyGetterIndexed
Return the value for the property in the event object specified when the instance was obtained. Useful for fast access to event properties. Throws a PropertyAccessException if the getter instance doesn't match the EventType it was obtained from, and to indicate other property access problems.- Specified by:
get
in interfaceEventPropertyGetterIndexed
- Parameters:
eventBean
- is the event to get the value of a property fromindex
- the index value- Returns:
- value of indexed property in event
- Throws:
PropertyAccessException
- to indicate that property access failed
-
getBeanProp
Description copied from interface:BeanEventPropertyGetter
Returns the property as an object.- Specified by:
getBeanProp
in interfaceBeanEventPropertyGetter
- Parameters:
object
- to evaluate- Returns:
- property of object
- Throws:
PropertyAccessException
- if access failed
-
isBeanExistsProperty
Description copied from interface:BeanEventPropertyGetter
Returns true if the dynamic property exists.- Specified by:
isBeanExistsProperty
in interfaceBeanEventPropertyGetter
- Parameters:
object
- to evaluate- Returns:
- indicator if property exists
-
get
Description copied from interface:EventPropertyValueGetter
Return the value for the property in the event object specified when the instance was obtained. Useful for fast access to event properties. Throws a PropertyAccessException if the getter instance doesn't match the EventType it was obtained from, and to indicate other property access problems.- Specified by:
get
in interfaceEventPropertyValueGetter
- Parameters:
obj
- is the event to get the value of a property from- Returns:
- value of property in event
- Throws:
PropertyAccessException
- to indicate that property access failed
-
toString
-
isExistsProperty
Description copied from interface:EventPropertyGetter
Returns true if the property exists, or false if the type does not have such a property.Useful for dynamic properties of the syntax "property?" and the dynamic nested/indexed/mapped versions. Dynamic nested properties follow the syntax "property?.nested" which is equivalent to "property?.nested?". If any of the properties in the path of a dynamic nested property return null, the dynamic nested property does not exists and the method returns false.
For non-dynamic properties, this method always returns true since a getter would not be available unless
- Specified by:
isExistsProperty
in interfaceEventPropertyGetter
- Parameters:
eventBean
- is the event to check if the dynamic property exists- Returns:
- indictor whether the property exists, always true for non-dynamic (default) properties
-
getTargetType
- Specified by:
getTargetType
in interfaceBeanEventPropertyGetter
- Specified by:
getTargetType
in classBaseNativePropertyGetter
-
eventBeanGetCodegen
public CodegenExpression eventBeanGetCodegen(CodegenExpression beanExpression, CodegenMethodScope codegenMethodScope, CodegenClassScope codegenClassScope) - Specified by:
eventBeanGetCodegen
in interfaceEventPropertyValueGetterForge
-
eventBeanExistsCodegen
public CodegenExpression eventBeanExistsCodegen(CodegenExpression beanExpression, CodegenMethodScope codegenMethodScope, CodegenClassScope codegenClassScope) - Specified by:
eventBeanExistsCodegen
in interfaceEventPropertyGetterSPI
-
underlyingGetCodegen
public CodegenExpression underlyingGetCodegen(CodegenExpression underlyingExpression, CodegenMethodScope codegenMethodScope, CodegenClassScope codegenClassScope) - Specified by:
underlyingGetCodegen
in interfaceEventPropertyGetterSPI
-
underlyingExistsCodegen
public CodegenExpression underlyingExistsCodegen(CodegenExpression underlyingExpression, CodegenMethodScope codegenMethodScope, CodegenClassScope codegenClassScope) - Specified by:
underlyingExistsCodegen
in interfaceEventPropertyGetterSPI
-
eventBeanGetIndexedCodegen
public CodegenExpression eventBeanGetIndexedCodegen(CodegenMethodScope codegenMethodScope, CodegenClassScope codegenClassScope, CodegenExpression beanExpression, CodegenExpression key) - Specified by:
eventBeanGetIndexedCodegen
in interfaceEventPropertyGetterIndexedSPI
-