use of org.neo4j.shell.exception.ParameterException in project neo4j by neo4j.
the class ShellParameterMap method setParameter.
@Override
public Object setParameter(@Nonnull String name, @Nonnull String valueString) throws ParameterException {
String parameterName = CypherVariablesFormatter.unescapedCypherVariable(name);
try {
Object value = new Cypher(interpreter, ParameterException.FACTORY, new CypherCharStream(valueString)).Expression();
queryParams.put(parameterName, new ParamValue(valueString, toJavaObject(value)));
return value;
} catch (ParseException | UnsupportedOperationException e) {
try {
Object value = evaluator.evaluate(valueString, Object.class);
queryParams.put(parameterName, new ParamValue(valueString, toJavaObject(value)));
return value;
} catch (EvaluationException e1) {
throw new ParameterException(e1.getMessage());
}
}
}
Aggregations