public Expression parse()

in src/main/java/com/epam/eco/commons/avro/avpath/PathParser.java [42:62]


    public Expression<?> parse() {
        List<Expression<?>> exps = new ArrayList<>();

        reset();

        int ch;
        while ((ch = read()) != -1) {
            if (PathUtils.isGetRecordFieldBeginCh(ch)) {
                exps.add(parseGetRecordFieldExp());
            } else if (PathUtils.isSelectElementsBeginCh(ch)) {
                exps.add(parseSelectElementsExp());
            } else {
                throw new PathParseException(
                        path,
                        String.format(
                                "unexpected character '%s' at position %d", (char)ch, pos));
            }
        }

        return new ExpressionChain(exps);
    }