예제 #1
0
 /// /// <summary>
 /// Returns a C_COMPLEX_OBJECT class
 /// </summary>
 /// <param name="an_attribute">The attribute that has the C_COMPLEX_OBJECT as a child</param>
 /// <param name="reference_model_class_name">The name of the reference model class as a string</param>
 /// <param name="node_id">The node id of this class</param>
 /// <param name="an_occurrences">The occurrences as an object</param>
 /// <returns>an AOM C_Complex_object that has these features set</returns>
 public C_COMPLEX_OBJECT MakeComplexObject(C_ATTRIBUTE an_attribute, string reference_model_class_name, string node_id, IntervalOfInteger an_occurrences)
 {
     C_COMPLEX_OBJECT result = MakeComplexObject(reference_model_class_name, node_id, an_occurrences);
     add_object(an_attribute, result);
     return result;
 }
예제 #2
0
       public ARCHETYPE_INTERNAL_REF MakeArchetypeRef(C_ATTRIBUTE an_attribute, string reference_model_class, string path)
       {
           ARCHETYPE_INTERNAL_REF result = new ARCHETYPE_INTERNAL_REF();
           result.rm_type_name = reference_model_class;

           //JAR: 30APR2007, AE-42 Support XML Schema 1.0.1
           result.node_id = "";
           result.occurrences = default_occurrences();               

           result.target_path = path;
           add_object(an_attribute, result);
           return result;
       }
예제 #3
0
       public C_PRIMITIVE_OBJECT MakePrimitiveObject(C_ATTRIBUTE an_attribute, C_PRIMITIVE a_primative)
       {
           C_PRIMITIVE_OBJECT result = new C_PRIMITIVE_OBJECT();

           if (a_primative != null)
           {
               result.item = a_primative;
           }

           //JAR: 30APR2007, AE-42 Support XML Schema 1.0.1
           result.node_id = "";
           result.occurrences = default_occurrences();               
           
           //JAR: 30APR2007, AE-42 Support XML Schema 1.0.1
           //else
           //    result.any_allowed = true;           

           add_object(an_attribute, result);

           switch (a_primative.GetType().ToString().ToLower(System.Globalization.CultureInfo.InvariantCulture))
           {
               case "xmlparser.c_boolean":
                   result.rm_type_name = "BOOLEAN";
                   break;
               case "xmlparser.c_integer":
                   result.rm_type_name = "INTEGER";
                   break;
               case "xmlparser.c_code_phrase":
                   result.rm_type_name = "CODE_PHRASE";
                   break;
               case "xmlparser.c_date":
                   result.rm_type_name = "DATE";
                   break;
               case "xmlparser.c_date_time":
                   result.rm_type_name = "DATE_TIME";
                   break;
               case "xmlparser.c_duration":
                   result.rm_type_name = "DURATION";
                   break;
               case "xmlparser.c_ordinal":
                   result.rm_type_name = "ORDINAL";
                   break;
               case "xmlparser.c_quantity":
                   result.rm_type_name = "QUANTITY";
                   break;
               case "xmlparser.c_string":
                   result.rm_type_name = "STRING";
                   break;
               case "xmlparser.c_time":
                   result.rm_type_name = "TIME";
                   break;
               case "xmlparser.c_real":
                   result.rm_type_name = "REAL";
                   break;
               default:
                   System.Diagnostics.Debug.Assert(false, a_primative.GetType().ToString() + " is not handled");
                   break;
           }
           return result;
       }
예제 #4
0
 public void add_object(C_ATTRIBUTE an_attribute, C_OBJECT an_object)
 {
     int i;
     if (an_attribute.children == null)
     {
         an_attribute.children = Array.CreateInstance(typeof(C_OBJECT), 1) as C_OBJECT[];
         i = 0;
     }
     else
     {
         C_OBJECT[] new_objects = an_attribute.children;
         i = new_objects.Length;
         Array.Resize(ref new_objects, i + 1);
         an_attribute.children = new_objects;
     }
     an_attribute.children[i] = an_object;
 }
예제 #5
0
 private void add_attribute(C_COMPLEX_OBJECT an_object, C_ATTRIBUTE an_attribute)
 {
     int i;
     if (an_object.attributes == null)
     {
         an_object.attributes = Array.CreateInstance(typeof(C_ATTRIBUTE), 1) as C_ATTRIBUTE[];
         i = 0;
     }
     else
     {
         C_ATTRIBUTE[] new_attributes = an_object.attributes;
         i = new_attributes.Length;
         Array.Resize(ref new_attributes, i + 1);
         an_object.attributes = new_attributes;
     }
     an_object.attributes[i] = an_attribute;
 }
예제 #6
0
 /// /// <summary>
 /// Returns a C_COMPLEX_OBJECT class
 /// </summary>
 /// <param name="an_attribute">The attribute that has the C_COMPLEX_OBJECT as a child</param>
 /// <param name="reference_model_class_name">The name of the reference model class as a string</param>
 /// <returns>an AOM C_Complex_object that has these features set</returns>
 public C_COMPLEX_OBJECT MakeComplexObject(C_ATTRIBUTE an_attribute, string reference_model_class_name)
 {
     C_COMPLEX_OBJECT result = MakeComplexObject(reference_model_class_name);
     add_object(an_attribute, result);
     return result;
 }
예제 #7
0
 void CloneAttributeConstraint(C_ATTRIBUTE attributeConstraint, C_ATTRIBUTE newAttributeConstraint)
 {
     newAttributeConstraint.rm_attribute_name = attributeConstraint.rm_attribute_name;
     newAttributeConstraint.existence = attributeConstraint.existence;
 }
예제 #8
0
        C_ATTRIBUTE[] VisitAttributes(C_ATTRIBUTE[] attributes)
        {
            C_ATTRIBUTE[] result = null;

            if (attributes != null)
            {
                SortedList<string, C_ATTRIBUTE> attributeConstraintList = new SortedList<string, C_ATTRIBUTE>();

                foreach (C_ATTRIBUTE attributeConstraint in attributes)
                {
                    C_ATTRIBUTE newAttribute;
                    C_MULTIPLE_ATTRIBUTE multipleAttributeConstraint = attributeConstraint as C_MULTIPLE_ATTRIBUTE;

                    if (multipleAttributeConstraint != null)
                        newAttribute = VisitMultipleAttributeConstraint(multipleAttributeConstraint);
                    else
                        newAttribute = VisitSingleAttributeConstraint((C_SINGLE_ATTRIBUTE)attributeConstraint);

                    System.Diagnostics.Debug.Assert(newAttribute != null, "newAttribute must not be null");
                    newAttribute.children = VisitChildren(attributeConstraint.children);

                    attributeConstraintList.Add(newAttribute.rm_attribute_name, newAttribute);
                }

                result = new C_ATTRIBUTE[attributeConstraintList.Count];
                attributeConstraintList.Values.CopyTo(result, 0);
            }

            return result;
        }