public class DynamicIndexedPropertyGetter extends DynamicPropertyGetterBase
beanEventTypeFactory, cache, eventBeanTypedEventFactory, sharableCode
Constructor and Description |
---|
DynamicIndexedPropertyGetter(String fieldName,
int index,
EventBeanTypedEventFactory eventBeanTypedEventFactory,
BeanEventTypeFactory beanEventTypeFactory) |
Modifier and Type | Method and Description |
---|---|
protected Object |
call(DynamicPropertyDescriptor descriptor,
Object underlying)
Call the getter to obtains the return result object, or null if no such method exists.
|
protected CodegenExpression |
callCodegen(CodegenExpressionRef desc,
CodegenExpressionRef object,
CodegenMethodScope parent,
CodegenClassScope codegenClassScope) |
protected Method |
determineMethod(Class clazz)
To be implemented to return the method required, or null to indicate an appropriate method could not be found.
|
protected CodegenExpression |
determineMethodCodegen(CodegenExpressionRef clazz,
CodegenMethodScope parent,
CodegenClassScope codegenClassScope) |
static boolean |
dynamicIndexedPropertyExists(DynamicPropertyDescriptor descriptor,
Object underlying,
int index)
NOTE: Code-generation-invoked method, method name and parameter order matters
|
static Object |
dynamicIndexedPropertyGet(DynamicPropertyDescriptor descriptor,
Object underlying,
Object[] parameters,
int index)
NOTE: Code-generation-invoked method, method name and parameter order matters
|
static Method |
dynamicIndexPropertyDetermineMethod(Class clazz,
String getterMethodName)
NOTE: Code-generation-invoked method, method name and parameter order matters
|
boolean |
isExistsProperty(EventBean eventBean)
Returns true if the property exists, or false if the type does not have such a property.
|
CodegenExpression |
underlyingExistsCodegen(CodegenExpression underlyingExpression,
CodegenMethodScope parent,
CodegenClassScope codegenClassScope) |
cacheAndCall, cacheAndExists, cacheAndExistsCodegen, dynamicPropertyCacheAdd, dynamicPropertyCacheCheck, eventBeanExistsCodegen, eventBeanFragmentCodegen, eventBeanGetCodegen, get, getBeanProp, getBeanPropType, getFragment, getPopulateCache, getPopulateCacheCodegen, getTargetType, handleException, isBeanExistsProperty, underlyingFragmentCodegen, underlyingGetCodegen
public DynamicIndexedPropertyGetter(String fieldName, int index, EventBeanTypedEventFactory eventBeanTypedEventFactory, BeanEventTypeFactory beanEventTypeFactory)
protected Method determineMethod(Class clazz)
DynamicPropertyGetterBase
determineMethod
in class DynamicPropertyGetterBase
clazz
- to search for a matching methodprotected CodegenExpression determineMethodCodegen(CodegenExpressionRef clazz, CodegenMethodScope parent, CodegenClassScope codegenClassScope)
determineMethodCodegen
in class DynamicPropertyGetterBase
protected Object call(DynamicPropertyDescriptor descriptor, Object underlying)
DynamicPropertyGetterBase
call
in class DynamicPropertyGetterBase
descriptor
- provides method information for the classunderlying
- is the underlying object to ask for the property valueprotected CodegenExpression callCodegen(CodegenExpressionRef desc, CodegenExpressionRef object, CodegenMethodScope parent, CodegenClassScope codegenClassScope)
callCodegen
in class DynamicPropertyGetterBase
public boolean isExistsProperty(EventBean eventBean)
EventPropertyGetter
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
eventBean
- is the event to check if the dynamic property existspublic CodegenExpression underlyingExistsCodegen(CodegenExpression underlyingExpression, CodegenMethodScope parent, CodegenClassScope codegenClassScope)
public static Method dynamicIndexPropertyDetermineMethod(Class clazz, String getterMethodName)
clazz
- classgetterMethodName
- methodpublic static Object dynamicIndexedPropertyGet(DynamicPropertyDescriptor descriptor, Object underlying, Object[] parameters, int index)
descriptor
- descriptorunderlying
- targetparameters
- paramsindex
- idxpublic static boolean dynamicIndexedPropertyExists(DynamicPropertyDescriptor descriptor, Object underlying, int index)
descriptor
- descriptorunderlying
- targetindex
- idxCopyright © 2005–2019. All rights reserved.