Search in sources :

Example 1 with ODataMessageException

use of org.apache.olingo.odata2.api.exception.ODataMessageException in project cxf by apache.

the class ODataParser method parse.

@Override
@SuppressWarnings("unchecked")
public SearchCondition<T> parse(String searchExpression) throws SearchParseException {
    try {
        final T condition = conditionClass.newInstance();
        final FilterExpression expression = parser.parseFilterString(searchExpression);
        final FilterExpressionVisitor visitor = new FilterExpressionVisitor(condition);
        return (SearchCondition<T>) expression.accept(visitor);
    } catch (ODataMessageException | ODataApplicationException | InstantiationException | IllegalAccessException ex) {
        throw new SearchParseException(ex);
    }
}
Also used : AndSearchCondition(org.apache.cxf.jaxrs.ext.search.AndSearchCondition) PrimitiveSearchCondition(org.apache.cxf.jaxrs.ext.search.PrimitiveSearchCondition) OrSearchCondition(org.apache.cxf.jaxrs.ext.search.OrSearchCondition) SearchCondition(org.apache.cxf.jaxrs.ext.search.SearchCondition) SearchParseException(org.apache.cxf.jaxrs.ext.search.SearchParseException) ODataMessageException(org.apache.olingo.odata2.api.exception.ODataMessageException) FilterExpression(org.apache.olingo.odata2.api.uri.expression.FilterExpression) ODataApplicationException(org.apache.olingo.odata2.api.exception.ODataApplicationException)

Aggregations

AndSearchCondition (org.apache.cxf.jaxrs.ext.search.AndSearchCondition)1 OrSearchCondition (org.apache.cxf.jaxrs.ext.search.OrSearchCondition)1 PrimitiveSearchCondition (org.apache.cxf.jaxrs.ext.search.PrimitiveSearchCondition)1 SearchCondition (org.apache.cxf.jaxrs.ext.search.SearchCondition)1 SearchParseException (org.apache.cxf.jaxrs.ext.search.SearchParseException)1 ODataApplicationException (org.apache.olingo.odata2.api.exception.ODataApplicationException)1 ODataMessageException (org.apache.olingo.odata2.api.exception.ODataMessageException)1 FilterExpression (org.apache.olingo.odata2.api.uri.expression.FilterExpression)1