protected override void setJSON(JObject obj, BaseClassIfc host, SetJsonOptions options)
        {
            if (mRepresentationContexts.Count > 0)
            {
                JArray array = new JArray()
                {
                };
                foreach (IfcRepresentationContext representationContext in RepresentationContexts)
                {
                    array.Add(representationContext.getJson(this, options));
                }
                obj["RepresentationContexts"] = array;
            }
            IfcUnitAssignment unitsInContext = UnitsInContext;

            if (unitsInContext != null)
            {
                obj["UnitsInContext"] = unitsInContext.getJson(this, options);
            }
            base.setJSON(obj, host, options);
            setAttribute(obj, "ObjectType", ObjectType);
            setAttribute(obj, "LongName", LongName);
            setAttribute(obj, "Phase", Phase);

            if (mIsDefinedBy.Count > 0 && options.Style != SetJsonOptions.JsonStyle.Repository)
            {
                JArray array = new JArray();
                foreach (IfcRelDefinesByProperties rdp in mIsDefinedBy)
                {
                    array.Add(rdp.getJson(this, options));
                }
                obj["IsDefinedBy"] = array;
            }
            if (mDeclares.Count > 0)
            {
                JArray array = new JArray()
                {
                };
                foreach (IfcRelDeclares declare in Declares)
                {
                    if (declare.RelatedDefinitions.Count > 0)
                    {
                        array.Add(declare.getJson(this, options));
                    }
                }
                if (array.Count > 0)
                {
                    obj["Declares"] = array;
                }
            }
        }
        protected override void setJSON(JObject obj, BaseClassIfc host, HashSet <int> processed)
        {
            base.setJSON(obj, host, processed);
            setAttribute(obj, "ObjectType", ObjectType);
            setAttribute(obj, "LongName", LongName);
            setAttribute(obj, "Phase", Phase);

            if (mRepresentationContexts.Count > 0)
            {
                JArray array = new JArray()
                {
                };
                foreach (IfcRepresentationContext representationContext in RepresentationContexts)
                {
                    array.Add(representationContext.getJson(this, processed));
                }
                obj["RepresentationContexts"] = array;
            }
            IfcUnitAssignment unitsInContext = UnitsInContext;

            if (unitsInContext != null)
            {
                obj["UnitsInContext"] = unitsInContext.getJson(this, processed);
            }
            //INVERSE
            //public List<IfcRelDefinesByProperties> IsDefinedBy { get { return mIsDefinedBy; } }
            if (mDeclares.Count > 0)
            {
                JArray array = new JArray()
                {
                };
                foreach (IfcRelDeclares declare in Declares)
                {
                    if (declare.RelatedDefinitions.Count > 0)
                    {
                        array.Add(declare.getJson(this, processed));
                    }
                }
                if (array.Count > 0)
                {
                    obj["Declares"] = array;
                }
            }
        }