@Test public void shouldParseOrderByOneAttributeNameClause() { assertThat(parser.parseOrderBy(tokenize("order by @a1")), is(orderBy(asc(nameTest("a1"))))); assertThat(parser.parseOrderBy(tokenize("order by @a1 ascending")), is(orderBy(asc(nameTest("a1"))))); assertThat(parser.parseOrderBy(tokenize("order by @a1 descending")), is(orderBy(desc(nameTest("a1"))))); assertThat(parser.parseOrderBy(tokenize("order by @pre:a1")), is(orderBy(asc(nameTest("pre", "a1"))))); assertThat(parser.parseOrderBy(tokenize("order by @pre:a1 ascending")), is(orderBy(asc(nameTest("pre", "a1"))))); assertThat(parser.parseOrderBy(tokenize("order by @pre:a1 descending")), is(orderBy(desc(nameTest("pre", "a1"))))); }
protected OrderBy parseOrderBy( TokenStream tokens ) { if (tokens.canConsume("order", "by")) { List<OrderBySpec> specs = new ArrayList<OrderBySpec>(); do { OrderBySpec spec = parseOrderBySpec(tokens); specs.add(spec); } while (tokens.canConsume(',')); if (!specs.isEmpty()) return new OrderBy(specs); } return null; }
XPathParser { protected OrderBy parseOrderBy( TokenStream tokens ) { if (tokens.canConsume("order", "by")) { List<OrderBySpec> specs = new ArrayList<OrderBySpec>(); do { OrderBySpec spec = parseOrderBySpec(tokens); specs.add(spec); } while (tokens.canConsume(',')); if (!specs.isEmpty()) return new OrderBy(specs); } return null; } }
XPathParser { protected OrderBy parseOrderBy( TokenStream tokens ) { if (tokens.canConsume("order", "by")) { List<OrderBySpec> specs = new ArrayList<OrderBySpec>(); do { OrderBySpec spec = parseOrderBySpec(tokens); specs.add(spec); } while (tokens.canConsume(',')); if (!specs.isEmpty()) return new OrderBy(specs); } return null; } XPathParser( TypeSystem context ); }
XPathParser { protected OrderBy parseOrderBy( TokenStream tokens ) { if (tokens.canConsume("order", "by")) { List<OrderBySpec> specs = new ArrayList<OrderBySpec>(); do { OrderBySpec spec = parseOrderBySpec(tokens); specs.add(spec); } while (tokens.canConsume(',')); if (!specs.isEmpty()) return new OrderBy(specs); } return null; } XPathParser( TypeSystem context ); Component parseXPath( String xpath ); }
XPathParser { protected OrderBy parseOrderBy( TokenStream tokens ) { if (tokens.canConsume("order", "by")) { List<OrderBySpec> specs = new ArrayList<OrderBySpec>(); do { OrderBySpec spec = parseOrderBySpec(tokens); specs.add(spec); } while (tokens.canConsume(',')); if (!specs.isEmpty()) return new OrderBy(specs); } return null; } XPathParser( TypeSystem context ); Component parseXPath( String xpath );  }