} ;
output(outStream, c, lineNumbers) ;
}
// Attempt to parse it.
UpdateRequest request= null ;
try {
request = UpdateFactory.create(updateString, "http://example/base/", language) ;
} catch (ARQException ex)
{
// Over generous exception (should be QueryException)
// but this makes the code robust.
outStream.println("<p>Syntax error:</p>") ;
startFixed(outStream) ;
outStream.println(ex.getMessage()) ;
finishFixed(outStream) ;
}
catch (RuntimeException ex)
{
outStream.println("<p>Internal error:</p>") ;
startFixed(outStream) ;
outStream.println(ex.getMessage()) ;
finishFixed(outStream) ;
}
// Because we pass into anon inner classes
final UpdateRequest updateRequest = request ;
// OK? Pretty print
if ( updateRequest != null && outputSPARQL )
{
outStream.println("<p>Formatted, parsed update request:</p>") ;
Content c = new Content(){
@Override
public void print(IndentedWriter out)
{
updateRequest.output(out) ;
}
} ;
output(outStream, c, lineNumbers) ;
}