public class DynamicMappedPropertyGetterByField extends DynamicPropertyGetterByFieldBase
beanEventTypeFactory, cache, eventBeanTypedEventFactory, sharableCode
EPTYPE, EPTYPEARRAY
Constructor and Description |
---|
DynamicMappedPropertyGetterByField(String fieldName,
String key,
EventBeanTypedEventFactory eventBeanTypedEventFactory,
BeanEventTypeFactory beanEventTypeFactory) |
Modifier and Type | Method and Description |
---|---|
protected Object |
call(DynamicPropertyDescriptorByField descriptor,
Object underlying)
Call the getter to obtains the return result object, or null if no such field exists.
|
protected CodegenExpression |
callCodegen(CodegenExpressionRef desc,
CodegenExpressionRef object,
CodegenMethodScope parent,
CodegenClassScope codegenClassScope) |
protected Field |
determineField(Class clazz)
To be implemented to return the field required, or null to indicate an appropriate field could not be found.
|
protected CodegenExpression |
determineFieldCodegen(CodegenExpressionRef clazz,
CodegenMethodScope parent,
CodegenClassScope codegenClassScope) |
static boolean |
dynamicMappedPropertyExists(DynamicPropertyDescriptorByField descriptor,
Object underlying,
String key)
NOTE: Code-generation-invoked method, method name and parameter order matters
|
static Object |
dynamicMappedPropertyGet(DynamicPropertyDescriptorByField descriptor,
Object underlying,
String key)
NOTE: Code-generation-invoked method, method name and parameter order matters
|
static Field |
dynamicMapperPropertyDetermineField(Class clazz,
String fieldName)
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 DynamicMappedPropertyGetterByField(String fieldName, String key, EventBeanTypedEventFactory eventBeanTypedEventFactory, BeanEventTypeFactory beanEventTypeFactory)
protected Field determineField(Class clazz)
DynamicPropertyGetterByFieldBase
determineField
in class DynamicPropertyGetterByFieldBase
clazz
- to search for a matching fieldprotected CodegenExpression determineFieldCodegen(CodegenExpressionRef clazz, CodegenMethodScope parent, CodegenClassScope codegenClassScope)
determineFieldCodegen
in class DynamicPropertyGetterByFieldBase
protected Object call(DynamicPropertyDescriptorByField descriptor, Object underlying)
DynamicPropertyGetterByFieldBase
call
in class DynamicPropertyGetterByFieldBase
descriptor
- provides field 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 DynamicPropertyGetterByFieldBase
public CodegenExpression underlyingExistsCodegen(CodegenExpression underlyingExpression, CodegenMethodScope parent, CodegenClassScope codegenClassScope)
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 static Field dynamicMapperPropertyDetermineField(Class clazz, String fieldName) throws PropertyAccessException
clazz
- classfieldName
- methodPropertyAccessException
- for access expublic static Object dynamicMappedPropertyGet(DynamicPropertyDescriptorByField descriptor, Object underlying, String key)
descriptor
- descriptorunderlying
- targetkey
- keypublic static boolean dynamicMappedPropertyExists(DynamicPropertyDescriptorByField descriptor, Object underlying, String key)
descriptor
- descriptorunderlying
- targetkey
- keyCopyright © 2005–2021. All rights reserved.