Пример #1
0
        protected internal override void Serialize(MappingSerializer serializer)
        {
            foreach (object key in _value.Keys)
            {
                object val       = _value[key];
                string keyString = key == null ? "null" : key.ToString();
                if (val is Number)
                {
                    serializer.PutNumber(keyString, ( Number )val);
                }
                else if (val is bool?)
                {
                    serializer.PutBoolean(keyString, ( bool? )val.Value);
                }
                else if (val is string)
                {
                    serializer.PutString(keyString, ( string )val);
                }
                else if (val is Path)
                {
                    PathRepresentation <Path> representation = new PathRepresentation <Path>(( Path )val);
                    serializer.PutMapping(keyString, representation);
                }
                else if (val is System.Collections.IEnumerable)
                {
                    serializer.PutList(keyString, ObjectToRepresentationConverter.GetListRepresentation((System.Collections.IEnumerable)val));
                }
                else if (val is System.Collections.IDictionary)
                {
                    serializer.PutMapping(keyString, ObjectToRepresentationConverter.GetMapRepresentation((System.Collections.IDictionary)val));
                }
                else if (val == null)
                {
                    serializer.PutString(keyString, null);
                }
                else if (val.GetType().IsArray)
                {
                    object[] objects = ToArray(val);

                    serializer.PutList(keyString, ObjectToRepresentationConverter.GetListRepresentation(asList(objects)));
                }
                else if (val is Node || val is Relationship)
                {
                    Representation representation = ObjectToRepresentationConverter.GetSingleRepresentation(val);
                    serializer.PutMapping(keyString, ( MappingRepresentation )representation);
                }
                else
                {
                    throw new System.ArgumentException("Unsupported value type: " + val.GetType());
                }
            }
        }
Пример #2
0
        protected internal override void Serialize(MappingSerializer serializer)
        {
            serializer.PutList("columns", _columns);
            serializer.PutList("data", _resultRepresentation);

            if (_statsRepresentation != null)
            {
                serializer.PutMapping("stats", _statsRepresentation);
            }
            if (_plan != null)
            {
                serializer.PutMapping("plan", _plan);
            }
        }
Пример #3
0
 protected internal override void Serialize(MappingSerializer serializer)
 {
     foreach (ExtensionPointRepresentation extension in Extensions)
     {
         serializer.PutMapping(extension.Name, extension);
     }
 }
Пример #4
0
 protected internal override void Serialize(MappingSerializer serializer)
 {
     foreach (KeyValuePair <string, EntityExtensionRepresentation> entity in _extended.SetOfKeyValuePairs())
     {
         serializer.PutMapping(entity.Key, entity.Value);
     }
 }
Пример #5
0
 protected internal override void Serialize(MappingSerializer serializer)
 {
     foreach (string indexName in _indexManager.relationshipIndexNames())
     {
         RelationshipIndex index = _indexManager.forRelationships(indexName);
         serializer.PutMapping(indexName, new RelationshipIndexRepresentation(indexName, _indexManager.getConfiguration(index)));
     }
 }
Пример #6
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are ignored unless the option to convert to C# 7.2 'in' parameters is selected:
//ORIGINAL LINE: protected void serialize(final MappingSerializer serializer)
        protected internal override void Serialize(MappingSerializer serializer)
        {
            _indexManager.nodeIndexNames();

            foreach (string indexName in _indexManager.nodeIndexNames())
            {
                Index <Node> index = _indexManager.forNodes(indexName);
                serializer.PutMapping(indexName, new NodeIndexRepresentation(indexName, _indexManager.getConfiguration(index)));
            }
        }
Пример #7
0
        protected internal override void Serialize(MappingSerializer mappingSerializer)
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.neo4j.graphdb.ExecutionPlanDescription planDescription = getPlan();
            ExecutionPlanDescription planDescription = Plan;

            mappingSerializer.PutString("name", planDescription.Name);
            IDictionary <string, object> arguments          = planDescription.Arguments;
            MappingRepresentation        argsRepresentation = getMapRepresentation(arguments);

            mappingSerializer.PutMapping("args", argsRepresentation);

            if (planDescription.HasProfilerStatistics())
            {
                Org.Neo4j.Graphdb.ExecutionPlanDescription_ProfilerStatistics stats = planDescription.ProfilerStatistics;
                mappingSerializer.PutNumber("rows", stats.Rows);
                mappingSerializer.PutNumber("dbHits", stats.DbHits);
            }

            mappingSerializer.PutList("children", new ListRepresentation("children", new IterableWrapperAnonymousInnerClass(this, planDescription.Children)));
        }