Esempio n. 1
0
        public override EventPropertyGetterSPI GetGetterDOM(
            SchemaElementComplex complexProperty,
            EventBeanTypedEventFactory eventBeanTypedEventFactory,
            BaseXMLEventType xmlEventType,
            string propertyExpression)
        {
            foreach (var attribute in complexProperty.Attributes) {
                if (attribute.Name.Equals(PropertyNameAtomic)) {
                    return new DOMSimpleAttributeGetter(PropertyNameAtomic);
                }
            }

            foreach (var simple in complexProperty.SimpleElements) {
                if (simple.Name.Equals(PropertyNameAtomic)) {
                    return new DOMComplexElementGetter(PropertyNameAtomic, null, simple.IsArray);
                }
            }

            foreach (SchemaElementComplex complex in complexProperty.ComplexElements) {
                var complexFragmentFactory = new FragmentFactoryDOMGetter(
                    eventBeanTypedEventFactory,
                    xmlEventType,
                    propertyExpression);
                if (complex.Name.Equals(PropertyNameAtomic)) {
                    return new DOMComplexElementGetter(PropertyNameAtomic, complexFragmentFactory, complex.IsArray);
                }
            }

            return null;
        }
Esempio n. 2
0
        public override EventPropertyGetter GetGetterDOM(SchemaElementComplex complexProperty,
                                                         EventAdapterService eventAdapterService,
                                                         BaseXMLEventType eventType,
                                                         String propertyExpression)
        {
            foreach (SchemaElementSimple simple in complexProperty.SimpleElements)
            {
                if (!simple.IsArray)
                {
                    continue;
                }
                if (simple.Name != PropertyNameAtomic)
                {
                    continue;
                }
                return(new DOMIndexedGetter(PropertyNameAtomic, _index, null));
            }

            foreach (SchemaElementComplex complex in complexProperty.ComplexElements)
            {
                if (!complex.IsArray)
                {
                    continue;
                }
                if (complex.Name != PropertyNameAtomic)
                {
                    continue;
                }
                return(new DOMIndexedGetter(PropertyNameAtomic, _index,
                                            new FragmentFactoryDOMGetter(eventAdapterService, eventType,
                                                                         propertyExpression)));
            }

            return(null);
        }
Esempio n. 3
0
        public override EventPropertyGetterSPI GetGetterDOM(
            SchemaElementComplex complexProperty,
            EventBeanTypedEventFactory eventBeanTypedEventFactory,
            BaseXMLEventType eventType,
            string propertyExpression)
        {
            foreach (var simple in complexProperty.SimpleElements) {
                if (!simple.IsArray) {
                    continue;
                }

                if (!simple.Name.Equals(PropertyNameAtomic)) {
                    continue;
                }

                return new DOMIndexedGetter(PropertyNameAtomic, Index, null);
            }

            foreach (var complex in complexProperty.ComplexElements) {
                if (!complex.IsArray) {
                    continue;
                }

                if (!complex.Name.Equals(PropertyNameAtomic)) {
                    continue;
                }

                return new DOMIndexedGetter(
                    PropertyNameAtomic,
                    Index,
                    new FragmentFactoryDOMGetter(eventBeanTypedEventFactory, eventType, propertyExpression));
            }

            return null;
        }
Esempio n. 4
0
        public SchemaItem GetPropertyTypeSchema(SchemaElementComplex parentComplexProperty, EventAdapterService eventAdapterService)
        {
            Property             lastProperty   = null;
            SchemaElementComplex complexElement = parentComplexProperty;

            for (var en = Properties.EnumerateWithLookahead(); en.HasNext();)
            {
                Property property = en.Next();
                lastProperty = property;

                if (en.HasNext())
                {
                    SchemaItem childSchemaItem = property.GetPropertyTypeSchema(complexElement, eventAdapterService);
                    if (childSchemaItem == null)
                    {
                        // if the property is not valid, return null
                        return(null);
                    }

                    if ((childSchemaItem is SchemaItemAttribute) || (childSchemaItem is SchemaElementSimple))
                    {
                        return(null);
                    }

                    complexElement = (SchemaElementComplex)childSchemaItem;
                }
            }

            return(lastProperty.GetPropertyTypeSchema(complexElement, eventAdapterService));
        }
Esempio n. 5
0
        public SchemaItem GetPropertyTypeSchema(SchemaElementComplex parentComplexProperty)
        {
            Property lastProperty = null;
            var complexElement = parentComplexProperty;

            var properties = Properties;
            var propertiesCount = properties.Count;
            for (var ii = 0; ii < propertiesCount; ii++) {
                var property = properties[ii];
                lastProperty = property;

                if (ii < (propertiesCount - 1)) {
                    var childSchemaItem = property.GetPropertyTypeSchema(complexElement);
                    if (childSchemaItem == null) {
                        // if the property is not valid, return null
                        return null;
                    }

                    if (childSchemaItem is SchemaItemAttribute || childSchemaItem is SchemaElementSimple) {
                        return null;
                    }

                    complexElement = (SchemaElementComplex) childSchemaItem;
                }
            }

            return lastProperty.GetPropertyTypeSchema(complexElement);
        }
Esempio n. 6
0
 public override EventPropertyGetterSPI GetGetterDOM(
     SchemaElementComplex complexProperty,
     EventAdapterService eventAdapterService,
     BaseXMLEventType eventType,
     string propertyExpression)
 {
     return(new DOMMapGetter(PropertyNameAtomic, _key, null));
 }
Esempio n. 7
0
 public override EventPropertyGetterSPI GetGetterDOM(
     SchemaElementComplex complexProperty,
     EventBeanTypedEventFactory eventBeanTypedEventFactory,
     BaseXMLEventType eventType,
     string propertyExpression)
 {
     return new DOMIndexedGetter(PropertyNameAtomic, Index, null);
 }
Esempio n. 8
0
        public EventPropertyGetterSPI GetGetterDOM(
            SchemaElementComplex parentComplexProperty,
            EventBeanTypedEventFactory eventBeanTypedEventFactory,
            BaseXMLEventType eventType,
            string propertyExpression)
        {
            IList<EventPropertyGetter> getters = new List<EventPropertyGetter>();

            var complexElement = parentComplexProperty;

            var properties = Properties;
            var propertiesCount = properties.Count;
            for (var ii = 0; ii < propertiesCount; ii++) {
                var property = properties[ii];
                var getter = property.GetGetterDOM(
                    complexElement,
                    eventBeanTypedEventFactory,
                    eventType,
                    propertyExpression);
                if (getter == null) {
                    return null;
                }

                if (ii < (propertiesCount - 1)) {
                    var childSchemaItem = property.GetPropertyTypeSchema(complexElement);
                    if (childSchemaItem == null) {
                        // if the property is not valid, return null
                        return null;
                    }

                    if (childSchemaItem is SchemaItemAttribute || childSchemaItem is SchemaElementSimple) {
                        return null;
                    }

                    complexElement = (SchemaElementComplex) childSchemaItem;

                    if (complexElement.IsArray) {
                        if (property is SimpleProperty || property is DynamicSimpleProperty) {
                            return null;
                        }
                    }
                }

                getters.Add(getter);
            }

            return new DOMNestedPropertyGetter(
                getters,
                new FragmentFactoryDOMGetter(eventBeanTypedEventFactory, eventType, propertyExpression));
        }
Esempio n. 9
0
        public override SchemaItem GetPropertyTypeSchema(SchemaElementComplex complexProperty)
        {
            foreach (SchemaElementComplex complex in complexProperty.ComplexElements) {
                if (!complex.Name.Equals(PropertyNameAtomic)) {
                    continue;
                }

                foreach (var attribute in complex.Attributes) {
                    if (!string.Equals(attribute.Name, "id", StringComparison.InvariantCultureIgnoreCase)) {
                    }
                }

                return complex;
            }

            return null;
        }
Esempio n. 10
0
        public override SchemaItem GetPropertyTypeSchema(SchemaElementComplex complexProperty, EventAdapterService eventAdapterService)
        {
            foreach (SchemaElementComplex complex in complexProperty.ComplexElements.Where(c => c.Name == PropertyNameAtomic))
            {
                foreach (SchemaItemAttribute attribute in complex.Attributes)
                {
                    if (!String.Equals(attribute.Name, "id", StringComparison.OrdinalIgnoreCase))
                    {
                        continue;
                    }
                }

                return(complex);
            }

            return(null);
        }
Esempio n. 11
0
        public override SchemaItem GetPropertyTypeSchema(SchemaElementComplex complexProperty,
                                                         EventAdapterService eventAdapterService)
        {
            foreach (var simple in complexProperty.SimpleElements)
            {
                if (simple.Name != PropertyNameAtomic)
                {
                    continue;
                }

                if ((simple.IsArray) ||
                    (simple.SimpleType == XmlSchemaSimpleType.GetBuiltInSimpleType(XmlTypeCode.String)))
                {
                    // return the simple as a non-array since an index is provided
                    return(new SchemaElementSimple(
                               simple.Name,
                               simple.Namespace,
                               simple.SimpleType,
                               simple.TypeName,
                               false,
                               simple.FractionDigits));
                }
            }

            foreach (var complex in complexProperty.ComplexElements)
            {
                if (complex.Name != PropertyNameAtomic)
                {
                    continue;
                }
                if (complex.IsArray)
                {
                    // return the complex as a non-array since an index is provided
                    return(new SchemaElementComplex(
                               complex.Name,
                               complex.Namespace,
                               complex.Attributes,
                               complex.ComplexElements,
                               complex.SimpleElements, false,
                               null,
                               null));
                }
            }

            return(null);
        }
Esempio n. 12
0
        public override EventPropertyGetter GetGetterDOM(SchemaElementComplex complexProperty, EventAdapterService eventAdapterService, BaseXMLEventType eventType, String propertyExpression)
        {
            foreach (SchemaElementComplex complex in complexProperty.ComplexElements.Where(c => c.Name == PropertyNameAtomic))
            {
                foreach (SchemaItemAttribute attribute in complex.Attributes)
                {
                    if (!String.Equals(attribute.Name, "id", StringComparison.OrdinalIgnoreCase))
                    {
                        continue;
                    }
                }

                return(new DOMMapGetter(PropertyNameAtomic, _key, null));
            }

            return(null);
        }
Esempio n. 13
0
        public EventPropertyGetter GetGetterDOM(SchemaElementComplex parentComplexProperty, EventAdapterService eventAdapterService, BaseXMLEventType eventType, String propertyExpression)
        {
            List <EventPropertyGetter> getters = new List <EventPropertyGetter>();

            SchemaElementComplex complexElement = parentComplexProperty;

            for (var it = Properties.EnumerateWithLookahead(); it.HasNext();)
            {
                Property            property = it.Next();
                EventPropertyGetter getter   = property.GetGetterDOM(complexElement, eventAdapterService, eventType, propertyExpression);
                if (getter == null)
                {
                    return(null);
                }

                if (it.HasNext())
                {
                    SchemaItem childSchemaItem = property.GetPropertyTypeSchema(complexElement, eventAdapterService);
                    if (childSchemaItem == null)
                    {
                        // if the property is not valid, return null
                        return(null);
                    }

                    if ((childSchemaItem is SchemaItemAttribute) || (childSchemaItem is SchemaElementSimple))
                    {
                        return(null);
                    }

                    complexElement = (SchemaElementComplex)childSchemaItem;

                    if (complexElement.IsArray)
                    {
                        if ((property is SimpleProperty) || (property is DynamicSimpleProperty))
                        {
                            return(null);
                        }
                    }
                }

                getters.Add(getter);
            }

            return(new DOMNestedPropertyGetter(getters, new FragmentFactoryDOMGetter(eventAdapterService, eventType, propertyExpression)));
        }
Esempio n. 14
0
        public override SchemaItem GetPropertyTypeSchema(SchemaElementComplex complexProperty)
        {
            foreach (var simple in complexProperty.SimpleElements) {
                if (!simple.IsArray) {
                    continue;
                }

                if (!simple.Name.Equals(PropertyNameAtomic)) {
                    continue;
                }

                // return the simple as a non-array since an index is provided
                return new SchemaElementSimple(
                    simple.Name,
                    simple.Namespace,
                    simple.SimpleType,
                    simple.TypeName,
                    false,
                    simple.FractionDigits);
            }

            foreach (var complex in complexProperty.ComplexElements) {
                if (!complex.IsArray) {
                    continue;
                }

                if (!complex.Name.Equals(PropertyNameAtomic)) {
                    continue;
                }

                // return the complex as a non-array since an index is provided
                return new SchemaElementComplex(
                    complex.Name,
                    complex.Namespace,
                    complex.Attributes,
                    complex.ComplexElements,
                    complex.SimpleElements,
                    false,
                    complex.OptionalSimpleType,
                    complex.OptionalSimpleTypeName);
            }

            return null;
        }
Esempio n. 15
0
        public override EventPropertyGetterSPI GetGetterDOM(
            SchemaElementComplex complexProperty,
            EventBeanTypedEventFactory eventBeanTypedEventFactory,
            BaseXMLEventType eventType,
            string propertyExpression)
        {
            foreach (SchemaElementComplex complex in complexProperty.ComplexElements) {
                if (!complex.Name.Equals(PropertyNameAtomic)) {
                    continue;
                }

                foreach (var attribute in complex.Attributes) {
                    if (!attribute.Name.Equals("id", StringComparison.InvariantCultureIgnoreCase)) {
                    }
                }

                return new DOMMapGetter(PropertyNameAtomic, Key, null);
            }

            return null;
        }
Esempio n. 16
0
        public override EventPropertyGetter GetGetterDOM(SchemaElementComplex complexProperty, EventAdapterService eventAdapterService, BaseXMLEventType xmlEventType, String propertyExpression)
        {
            if (complexProperty.Attributes.Any(attribute => attribute.Name == PropertyNameAtomic))
            {
                return(new DOMSimpleAttributeGetter(PropertyNameAtomic));
            }

            foreach (var simple in complexProperty.SimpleElements.Where(simple => simple.Name == PropertyNameAtomic))
            {
                return(new DOMComplexElementGetter(PropertyNameAtomic, null, simple.IsArray));
            }

            foreach (SchemaElementComplex complex in complexProperty.ComplexElements)
            {
                var complexFragmentFactory = new FragmentFactoryDOMGetter(eventAdapterService, xmlEventType, propertyExpression);
                if (complex.Name == PropertyNameAtomic)
                {
                    return(new DOMComplexElementGetter(PropertyNameAtomic, complexFragmentFactory, complex.IsArray));
                }
            }

            return(null);
        }
Esempio n. 17
0
 public abstract SchemaItem GetPropertyTypeSchema(SchemaElementComplex complexProperty);
Esempio n. 18
0
 public override SchemaItem GetPropertyTypeSchema(SchemaElementComplex complexProperty)
 {
     return null; // always returns Node
 }
Esempio n. 19
0
 public override SchemaItem GetPropertyTypeSchema(SchemaElementComplex complexProperty, EventAdapterService eventAdapterService)
 {
     return(null);    // always returns Node
 }
Esempio n. 20
0
 public override EventPropertyGetter GetGetterDOM(SchemaElementComplex complexProperty, EventAdapterService eventAdapterService, BaseXMLEventType eventType, string propertyExpression)
 {
     return(new DOMAttributeAndElementGetter(PropertyNameAtomic));
 }
Esempio n. 21
0
 public override SchemaItem GetPropertyTypeSchema(SchemaElementComplex complexProperty, EventAdapterService eventAdapterService)
 {
     return(SchemaUtil.FindPropertyMapping(complexProperty, PropertyNameAtomic));
 }
Esempio n. 22
0
 public override SchemaItem GetPropertyTypeSchema(SchemaElementComplex complexProperty)
 {
     return null; // dynamic properties always return Node
 }
Esempio n. 23
0
 /// <summary>
 /// Returns the getter-method for use with XML DOM event representations.
 /// </summary>
 /// <param name="complexProperty">a element-within-element type definition</param>
 /// <param name="eventAdapterService">for resolving or creating further event types that are property types</param>
 /// <param name="xmlEventType">the event type</param>
 /// <param name="propertyExpression">the full property expression</param>
 /// <returns>
 /// getter
 /// </returns>
 public abstract EventPropertyGetterSPI GetGetterDOM(SchemaElementComplex complexProperty, EventAdapterService eventAdapterService, BaseXMLEventType xmlEventType, string propertyExpression);
Esempio n. 24
0
 /// <summary>
 /// Returns the property type for use with DOM event representations.
 /// </summary>
 /// <param name="complexProperty">a element-within-element type definition</param>
 /// <param name="eventAdapterService">for resolving further element event types if defined</param>
 /// <returns>
 /// property type
 /// </returns>
 public abstract SchemaItem GetPropertyTypeSchema(SchemaElementComplex complexProperty, EventAdapterService eventAdapterService);
Esempio n. 25
0
 public abstract EventPropertyGetterSPI GetGetterDOM(
     SchemaElementComplex complexProperty,
     EventBeanTypedEventFactory eventBeanTypedEventFactory,
     BaseXMLEventType xmlEventType,
     string propertyExpression);
Esempio n. 26
0
 public override SchemaItem GetPropertyTypeSchema(SchemaElementComplex complexProperty)
 {
     return SchemaUtil.FindPropertyMapping(complexProperty, PropertyNameAtomic);
 }