コード例 #1
0
        public EventBean EvaluateGetEventBean(
            EventBean[] eventsPerStream,
            bool isNewData,
            ExprEvaluatorContext context)
        {
            var @event = eventsPerStream[streamId];
            if (@event == null) {
                return null;
            }

            return (EventBean) getter.GetFragment(@event);
        }
コード例 #2
0
        public object Evaluate(
            EventBean[] eventsPerStream,
            bool isNewData,
            ExprEvaluatorContext context)
        {
            var @event = eventsPerStream[streamId];
            if (@event == null) {
                return null;
            }

            var fragment = getter.GetFragment(@event);
            if (fragment == null) {
                return null;
            }

            if (fragment is EventBean) {
                var bean = (EventBean) fragment;
                return bean.EventType.Name;
            }

            if (fragment.GetType().IsArray) {
                var type = fragmentType + "[]";
                return type;
            }

            return null;
        }
コード例 #3
0
 private ICollection<EventBean> EvaluateInternal(
     EventBean eventInQuestion,
     ExprEvaluatorContext context)
 {
     var events = (EventBean[]) _getter.GetFragment(eventInQuestion);
     return events?.Unwrap<EventBean>();
 }
コード例 #4
0
        public object Evaluate(
            EventBean[] eventsPerStream,
            bool isNewData,
            ExprEvaluatorContext context)
        {
            EventBean @event = eventsPerStream[_streamId];

            if (@event == null)
            {
                return(null);
            }

            object result = _getter.GetFragment(@event);

            if (result == null || !result.GetType().IsArray)
            {
                return(null);
            }

            EventBean[] events = (EventBean[])result;
            var         index  = _indexExpr.Forge.ExprEvaluator.Evaluate(eventsPerStream, isNewData, context).AsBoxedInt32();

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

            return(events[index.Value]);
        }
コード例 #5
0
 public object GetFragment(EventBean theEvent)
 {
     if (!(theEvent is DecoratingEventBean))
         throw new PropertyAccessException("Mismatched property getter to EventBean type");
     var wrapperEvent = (DecoratingEventBean) theEvent;
     var map = wrapperEvent.DecoratingProperties;
     return _mapGetter.GetFragment(_eventAdapterService.AdapterForTypedMap(map, _underlyingMapType));
 }
コード例 #6
0
 public object GetFragment(EventBean theEvent)
 {
     if (!(theEvent is DecoratingEventBean))
         throw new PropertyAccessException("Mismatched property getter to EventBean type");
     var wrapperEvent = (DecoratingEventBean) theEvent;
     var wrappedEvent = wrapperEvent.UnderlyingEvent;
     if (wrappedEvent == null) return null;
     return _underlyingGetter.GetFragment(wrappedEvent);
 }
コード例 #7
0
        public object Evaluate(
            object target,
            EventBean[] eventsPerStream,
            bool isNewData,
            ExprEvaluatorContext exprEvaluatorContext)
        {
            if (!(target is EventBean))
            {
                return(null);
            }

            return(_getter.GetFragment((EventBean)target));
        }
コード例 #8
0
        public object GetFragment(EventBean obj)
        {
            var map = BaseNestableEventUtil.CheckedCastUnderlyingMap(obj);

            // 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
            var theEvent = (EventBean) value;
            return _eventBeanEntryGetter.GetFragment(theEvent);
        }
コード例 #9
0
        public object GetFragment(EventBean obj)
        {
            // If the map does not contain the key, this is allowed and represented as null
            var value = BaseNestableEventUtil.CheckedCastUnderlyingObjectArray(obj)[propertyIndex];

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

            // Object within the map
            var theEvent = (EventBean) value;
            return eventBeanEntryGetter.GetFragment(theEvent);
        }
コード例 #10
0
        public object Evaluate(
            EventBean[] eventsPerStream,
            bool isNewData,
            ExprEvaluatorContext context)
        {
            var theEvent = eventsPerStream[streamId];
            if (theEvent == null) {
                return null;
            }

            var @event = getterFragment.GetFragment(theEvent);
            if (!(@event is EventBean)) {
                return null;
            }

            return getterTimestamp.Get((EventBean) @event);
        }