Beispiel #1
0
        private EventPropertyGetterSPI GetGetterFromDictionary(
            EventBeanTypedEventFactory eventBeanTypedEventFactory,
            BeanEventTypeFactory beanEventTypeFactory,
            PropertyStem propertyDesc)
        {
            if (propertyDesc.AccessorProp != null) {
                return new KeyedMapPropertyPropertyGetter(
                    propertyDesc.AccessorProp,
                    Key,
                    eventBeanTypedEventFactory,
                    beanEventTypeFactory);
            }

            if (propertyDesc.IsSimpleReadMethod) {
                return new KeyedMapMethodPropertyGetter(
                    propertyDesc.ReadMethod,
                    Key,
                    eventBeanTypedEventFactory,
                    beanEventTypeFactory);
            }


            if (propertyDesc.AccessorField != null) {
                var field = propertyDesc.AccessorField;
                return new KeyedMapFieldPropertyGetter(
                    field,
                    Key,
                    eventBeanTypedEventFactory,
                    beanEventTypeFactory);
            }

            throw new IllegalStateException($"unable to determine property getter for requested member");
        }
Beispiel #2
0
        private EventPropertyGetterSPI GetGetterFromEnumerable(
            EventBeanTypedEventFactory eventBeanTypedEventFactory,
            BeanEventTypeFactory beanEventTypeFactory,
            PropertyStem propertyDesc)
        {
            if (propertyDesc.AccessorProp != null) {
                return new IterablePropertyPropertyGetter(
                    propertyDesc.AccessorProp,
                    Index,
                    eventBeanTypedEventFactory,
                    beanEventTypeFactory);
            }

            if (propertyDesc.IsSimpleReadMethod) {
                return new IterableMethodPropertyGetter(
                    propertyDesc.ReadMethod,
                    Index,
                    eventBeanTypedEventFactory,
                    beanEventTypeFactory);
            }

            if (propertyDesc.AccessorField != null) {
                return new IterableFieldPropertyGetter(
                    propertyDesc.AccessorField,
                    Index,
                    eventBeanTypedEventFactory,
                    beanEventTypeFactory);
            }

            throw new EPRuntimeException("unable to determine property enumerator accessor");
        }
Beispiel #3
0
        private EventPropertyGetterSPI GetGetterFromArray(
            EventBeanTypedEventFactory eventBeanTypedEventFactory,
            BeanEventTypeFactory beanEventTypeFactory,
            PropertyStem propertyDesc)
        {
            var prop = propertyDesc.AccessorProp;
            if (prop != null) {
                return new ArrayPropertyPropertyGetter(prop, Index, eventBeanTypedEventFactory, beanEventTypeFactory);
            }

            if (propertyDesc.IsSimpleReadMethod) {
                var method = propertyDesc.ReadMethod;
                return new ArrayMethodPropertyGetter(
                    method,
                    Index,
                    eventBeanTypedEventFactory,
                    beanEventTypeFactory);
            }

            var field = propertyDesc.AccessorField;
            if (field != null) {
                return new ArrayFieldPropertyGetter(field, Index, eventBeanTypedEventFactory, beanEventTypeFactory);
            }

            throw new EPRuntimeException("unable to determine property array accessor");
        }
Beispiel #4
0
 /// <summary>
 ///     Ctor.
 /// </summary>
 /// <param name="clazz">is the class</param>
 /// <param name="getterFactory">is the getter</param>
 /// <param name="stem">is the property info</param>
 public PropertyInfo(
     Type clazz,
     EventPropertyGetterSPIFactory getterFactory,
     PropertyStem stem)
 {
     Clazz = clazz;
     GetterFactory = getterFactory;
     Descriptor = stem;
 }