@Test public void shouldReturnNullFromParseGeneralCompIfOperatorPatternIsNotFound() { assertThat(parser.parseGeneralComp(tokenize("name")), is(nullValue())); assertThat(parser.parseGeneralComp(tokenize("+")), is(nullValue())); assertThat(parser.parseGeneralComp(tokenize("!+")), is(nullValue())); }
protected Operator parseGeneralComp( TokenStream tokens ) { if (tokens.canConsume("!", "=")) return Operator.NOT_EQUAL_TO; if (tokens.canConsume("=")) return Operator.EQUAL_TO; if (tokens.canConsume("<", "=")) return Operator.LESS_THAN_OR_EQUAL_TO; if (tokens.canConsume(">", "=")) return Operator.GREATER_THAN_OR_EQUAL_TO; if (tokens.canConsume("<")) return Operator.LESS_THAN; if (tokens.canConsume(">")) return Operator.GREATER_THAN; return null; }
XPathParser { protected Operator parseGeneralComp( TokenStream tokens ) { if (tokens.canConsume("!", "=")) return Operator.NOT_EQUAL_TO; if (tokens.canConsume("=")) return Operator.EQUAL_TO; if (tokens.canConsume("<", "=")) return Operator.LESS_THAN_OR_EQUAL_TO; if (tokens.canConsume(">", "=")) return Operator.GREATER_THAN_OR_EQUAL_TO; if (tokens.canConsume("<")) return Operator.LESS_THAN; if (tokens.canConsume(">")) return Operator.GREATER_THAN; return null; } }
XPathParser { protected Operator parseGeneralComp( TokenStream tokens ) { if (tokens.canConsume("!", "=")) return Operator.NOT_EQUAL_TO; if (tokens.canConsume("=")) return Operator.EQUAL_TO; if (tokens.canConsume("<", "=")) return Operator.LESS_THAN_OR_EQUAL_TO; if (tokens.canConsume(">", "=")) return Operator.GREATER_THAN_OR_EQUAL_TO; if (tokens.canConsume("<")) return Operator.LESS_THAN; if (tokens.canConsume(">")) return Operator.GREATER_THAN; return null; } XPathParser( TypeSystem context ); }
XPathParser { protected Operator parseGeneralComp( TokenStream tokens ) { if (tokens.canConsume("!", "=")) return Operator.NOT_EQUAL_TO; if (tokens.canConsume("=")) return Operator.EQUAL_TO; if (tokens.canConsume("<", "=")) return Operator.LESS_THAN_OR_EQUAL_TO; if (tokens.canConsume(">", "=")) return Operator.GREATER_THAN_OR_EQUAL_TO; if (tokens.canConsume("<")) return Operator.LESS_THAN; if (tokens.canConsume(">")) return Operator.GREATER_THAN; return null; } XPathParser( TypeSystem context ); Component parseXPath( String xpath ); }
XPathParser { protected Operator parseGeneralComp( TokenStream tokens ) { if (tokens.canConsume("!", "=")) return Operator.NOT_EQUAL_TO; if (tokens.canConsume("=")) return Operator.EQUAL_TO; if (tokens.canConsume("<", "=")) return Operator.LESS_THAN_OR_EQUAL_TO; if (tokens.canConsume(">", "=")) return Operator.GREATER_THAN_OR_EQUAL_TO; if (tokens.canConsume("<")) return Operator.LESS_THAN; if (tokens.canConsume(">")) return Operator.GREATER_THAN; return null; } XPathParser( TypeSystem context ); Component parseXPath( String xpath );  }