@Override public String toString() { return "CodeWithScope (" + getCode() + ':' + getScope() + ')'; }
@Override public String toString() { return "CodeWithScope (" + getCode() + ':' + getScope() + ')'; }
protected void write( CodeWithScope value, Writer writer ) throws IOException { write(new BasicDocument(CODE, value.getCode(), SCOPE, value.getScope()), writer); }
protected void write( CodeWithScope value, Writer writer ) throws IOException { write(new BasicDocument(CODE, value.getCode(), SCOPE, value.getScope()), writer); }
protected void write( String name, CodeWithScope value, BsonDataOutput output ) { output.writeByte(Type.JAVASCRIPT_WITH_SCOPE); writeCString(name, output); // Write the size for the CodeWithScope; we'll come back to this after we write the object ... int arraySizePosition = output.size(); output.writeInt(0); // Write the code & scope ... writeString(value.getCode(), output); write(null, value.getScope(), output); // Determine the number of bytes written in the array, and overwrite the value we wrote earlier .. int arraySize = output.size() - arraySizePosition; output.writeInt(arraySizePosition, arraySize); }
protected void write( String name, CodeWithScope value, BsonDataOutput output ) { output.writeByte(Type.JAVASCRIPT_WITH_SCOPE); writeCString(name, output); // Write the size for the CodeWithScope; we'll come back to this after we write the object ... int arraySizePosition = output.size(); output.writeInt(0); // Write the code & scope ... writeString(value.getCode(), output); write(null, value.getScope(), output); // Determine the number of bytes written in the array, and overwrite the value we wrote earlier .. int arraySize = output.size() - arraySizePosition; output.writeInt(arraySizePosition, arraySize); }
} else if (value instanceof CodeWithScope) { CodeWithScope code = (CodeWithScope)value; value = new de.undercouch.bson4jackson.types.JavaScript(code.getCode(), createJacksonData(code.getScope())); } else if (value instanceof Code) { Code code = (Code)value;
} else if (value instanceof CodeWithScope) { CodeWithScope code = (CodeWithScope)value; value = new org.bson.types.CodeWScope(code.getCode(), createMongoData(code.getScope())); } else if (value instanceof Code) { Code code = (Code)value;