Example #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void write(org.codehaus.jackson.JsonGenerator out, Iterable<String> columns, org.neo4j.graphdb.Result_ResultRow row, TransactionStateChecker txStateChecker) throws java.io.IOException
        public override void Write(JsonGenerator @out, IEnumerable <string> columns, Org.Neo4j.Graphdb.Result_ResultRow row, TransactionStateChecker txStateChecker)
        {
            RepresentationFormat format = new StreamingJsonFormat.StreamingRepresentationFormat(@out, null);

            @out.writeArrayFieldStart("rest");
            try
            {
                foreach (string key in columns)
                {
                    write(@out, format, row.Get(key), txStateChecker);
                }
            }
            finally
            {
                @out.writeEndArray();
            }
        }
Example #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void write(org.codehaus.jackson.JsonGenerator out, Iterable<String> columns, org.neo4j.graphdb.Result_ResultRow row, TransactionStateChecker txStateChecker) throws java.io.IOException
        public override void Write(JsonGenerator @out, IEnumerable <string> columns, Org.Neo4j.Graphdb.Result_ResultRow row, TransactionStateChecker txStateChecker)
        {
            ISet <Node>         nodes         = new HashSet <Node>();
            ISet <Relationship> relationships = new HashSet <Relationship>();

            Extract(nodes, relationships, Map(columns, row));

            @out.writeObjectFieldStart("graph");
            try
            {
                WriteNodes(@out, nodes, txStateChecker);
                WriteRelationships(@out, relationships, txStateChecker);
            }
            finally
            {
                @out.writeEndObject();
            }
        }
Example #3
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private void writeMeta(org.codehaus.jackson.JsonGenerator out, Iterable<String> columns, org.neo4j.graphdb.Result_ResultRow row) throws java.io.IOException
        private void WriteMeta(JsonGenerator @out, IEnumerable <string> columns, Org.Neo4j.Graphdb.Result_ResultRow row)
        {
            @out.writeArrayFieldStart("meta");
            try
            {
                /*
                 * The way we've designed this JSON serialization is by injecting a custom codec
                 * to write the entities. Unfortunately, there seems to be no way to control state
                 * inside the JsonGenerator, and so we need to make a second call to write out the
                 * meta information, directly to the injected codec. This is not very pretty,
                 * but time is expensive, and redesigning one of three server serialization
                 * formats is not a priority.
                 */
                Neo4jJsonCodec codec = ( Neo4jJsonCodec )@out.Codec;
                foreach (string key in columns)
                {
                    codec.WriteMeta(@out, row.Get(key));
                }
            }
            finally
            {
                @out.writeEndArray();
            }
        }