final FilterExpression filter = uriInfo.getFilter();
if (filter != null) {
String filterString;
try {
filterString = (String) filter.accept(new JsonVisitor());
} catch (final ExceptionVisitExpression e) {
filterString = null;
} catch (final ODataApplicationException e) {
filterString = null;
}
jsonStreamWriter.name("filter").unquotedValue(filterString);
if (uriInfo.getOrderBy() != null
|| !uriInfo.getExpand().isEmpty() || !uriInfo.getSelect().isEmpty()) {
jsonStreamWriter.separator();
}
}
final OrderByExpression orderBy = uriInfo.getOrderBy();
if (orderBy != null) {
String orderByString;
try {
orderByString = (String) orderBy.accept(new JsonVisitor());
} catch (final ExceptionVisitExpression e) {
orderByString = null;
} catch (final ODataApplicationException e) {
orderByString = null;
}