use of org.bson.json.JsonParseException in project spring-data-mongodb by spring-projects.
the class ParameterBindingJsonReader method visitJavaScriptExtendedJson.
private void visitJavaScriptExtendedJson() {
verifyToken(JsonTokenType.COLON);
String code = readStringFromExtendedJson();
JsonToken nextToken = popToken();
switch(nextToken.getType()) {
case COMMA:
verifyString("$scope");
verifyToken(JsonTokenType.COLON);
setState(State.VALUE);
currentValue = code;
setCurrentBsonType(BsonType.JAVASCRIPT_WITH_SCOPE);
setContext(new Context(getContext(), BsonContextType.SCOPE_DOCUMENT));
break;
case END_OBJECT:
currentValue = code;
setCurrentBsonType(BsonType.JAVASCRIPT);
break;
default:
throw new JsonParseException("JSON reader expected ',' or '}' but found '%s'.", nextToken);
}
}
Aggregations