Java 类org.bson.BsonJavaScriptWithScope 实例源码

项目:BsonMapper    文件:BsonCodeWithScopeConverter.java   
@Override
public CodeWithScope decode(BsonValue bsonValue) {
    BsonJavaScriptWithScope bsonJavaScriptWithScope = bsonValue.asJavaScriptWithScope();
    return new CodeWithScope(bsonJavaScriptWithScope.getCode(), Document.parse(bsonJavaScriptWithScope.getScope().toJson()));
}
项目:BsonMapper    文件:BsonCodeWithScopeConverter.java   
@Override
public BsonJavaScriptWithScope encode(CodeWithScope object) {
    return new BsonJavaScriptWithScope(object.getCode(), BsonDocument.parse(object.getScope().toJson()));
}