public object GetJsonProp(object @object)
        {
            var result = GetJsonProvidedIndexedProp(@object, field, index);
            if (result == null) {
                return null;
            }

            return nestedGetter.GetBeanProp(result);
        }
        public object GetJsonProp(object @object)
        {
            var nested = GetJsonProvidedSimpleProp(@object, field);
            if (nested == null) {
                return null;
            }

            return nestedGetter.GetBeanProp(nested);
        }
 public object GetMap(IDictionary<string, object> map)
 {
     // If the map does not contain the key, this is allowed and represented as null
     var value = map.Get(_propertyMap);
     if (value == null) return null;
     // Object within the map
     if (value is EventBean) return _mapEntryGetter.Get((EventBean) value);
     return _mapEntryGetter.GetBeanProp(value);
 }
Esempio n. 4
0
        public object GetObjectArray(object[] array)
        {
            // If the map does not contain the key, this is allowed and represented as null
            var value = array[_propertyIndex];

            if (value == null) return null;

            // object within the map
            if (value is EventBean) return _entryGetter.Get((EventBean) value);
            return _entryGetter.GetBeanProp(value);
        }
        public object GetMap(DataMap map)
        {
            // If the map does not contain the key, this is allowed and represented as null
            var value = map.Get(_propertyMap);

            if (value == null)
            {
                return(null);
            }

            if (value is EventBean)
            {
                return(_mapEntryGetter.Get((EventBean)value));
            }

            // Object within the map
            return(_mapEntryGetter.GetBeanProp(value));
        }
Esempio n. 6
0
        public static object GetBeanArrayValue(BeanEventPropertyGetter nestedGetter, object value, int index)
        {
            if (value is Array valueAsArray)
            {
                if (valueAsArray.Length <= index)
                {
                    return(null);
                }

                var arrayItem = valueAsArray.GetValue(index);
                if (arrayItem == null)
                {
                    return(null);
                }

                return(nestedGetter.GetBeanProp(arrayItem));
            }

            return(null);
        }
Esempio n. 7
0
        public static Object GetBeanArrayValue(BeanEventPropertyGetter nestedGetter, Object value, int index)
        {
            var asArray = value as Array;

            if (asArray == null)
            {
                return(null);
            }

            if (asArray.Length <= index)
            {
                return(null);
            }

            var arrayItem = asArray.GetValue(index);

            if (arrayItem == null)
            {
                return(null);
            }

            return(nestedGetter.GetBeanProp(arrayItem));
        }