Package com.dottydingo.hyperion.exception

Examples of com.dottydingo.hyperion.exception.BadRequestException


        {
            return objectMapper.readValue(inputStream,type);
        }
        catch (Exception e)
        {
            throw new BadRequestException(String.format("Error unmarshalling request: %s",e.getMessage()),e);
        }
    }
View Full Code Here


            return new RequestContext<T>(value,jsonNode.fieldNames());
        }
        catch (Exception e)
        {
            throw new BadRequestException(String.format("Error unmarshalling request: %s",e.getMessage()),e);
        }
    }
View Full Code Here

            if (expression.isComparison())
            {
                return buildPredicate((ComparisonExpression) expression,entityRoot,cb);
            }

            throw new BadRequestException("Invalid expression.");
        }
View Full Code Here

                case OR:
                    return cb.or(
                            buildPredicate(logical.getLeft(),entityRoot,cb),
                            buildPredicate(logical.getRight(),entityRoot,cb));
            }
            throw new BadRequestException("Invalid expression.");
        }
View Full Code Here

        private Predicate buildPredicate(ComparisonExpression comparison,  Root entityRoot, CriteriaBuilder cb)
        {
            QueryBuilder qb = queryBuilders.get(comparison.getSelector());
            if(qb == null)
                throw new BadRequestException(String.format("Can not query by %s",comparison.getSelector()));

            return qb.buildPredicate(entityRoot,cb,comparison.getOperator(),comparison.getArgument());
        }
View Full Code Here

        {
            return objectMapper.readValue(inputStream,type);
        }
        catch (Exception e)
        {
            throw new BadRequestException(String.format("Error unmarshalling request: %s",e.getMessage()),e);
        }
    }
View Full Code Here

        {
            return Long.parseLong(value);
        }
        catch (NumberFormatException e)
        {
            throw new BadRequestException(e.getMessage());
        }
    }
View Full Code Here

        {
            return Integer.parseInt(value);
        }
        catch (NumberFormatException e)
        {
            throw new BadRequestException(e.getMessage());
        }
    }
View Full Code Here

            queryTree = RSQLParser.parse(query);

        }
        catch (ParseException ex)
        {
            throw new BadRequestException("Error parsing query.", ex);
        }
        catch (TokenMgrError er)
        {
            throw new BadRequestException("Invalid query", er);
        }
        return new InternalPredicateBuilder(entityPlugin.getQueryBuilders(),queryTree);


    }
View Full Code Here

                boolean desc = props.length == 2 && props[1].equalsIgnoreCase("desc");

                SortBuilder sortBuilder = sortBuilders.get(name);
                if (sortBuilder == null)
                {
                    throw new BadRequestException(String.format("%s is not a valid sort field.", name));
                }

                orderList.addAll(sortBuilder.buildOrder(desc, cb, root));
            }
View Full Code Here

TOP

Related Classes of com.dottydingo.hyperion.exception.BadRequestException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.