@Test public void shouldParseSchemaElementTest() { SchemaElementTest result = parser.parseSchemaElementTest(tokenize("schema-element(foo)")); assertThat(result, is(notNullValue())); assertThat(result.getElementDeclarationName(), is(nameTest("foo"))); result = parser.parseSchemaElementTest(tokenize("schema-element(foo:bar)")); assertThat(result, is(notNullValue())); assertThat(result.getElementDeclarationName(), is(nameTest("foo", "bar"))); result = parser.parseSchemaElementTest(tokenize("schema-element(*)")); assertThat(result, is(notNullValue())); assertThat(result.getElementDeclarationName(), is(wildcard())); }
protected SchemaElementTest parseSchemaElementTest( TokenStream tokens ) { if (tokens.canConsume("schema-element", "(")) { NameTest elementDeclarationName = parseNameTest(tokens); SchemaElementTest result = new SchemaElementTest(elementDeclarationName); tokens.consume(")"); return result; } return null; }
XPathParser { protected SchemaElementTest parseSchemaElementTest( TokenStream tokens ) { if (tokens.canConsume("schema-element", "(")) { NameTest elementDeclarationName = parseNameTest(tokens); SchemaElementTest result = new SchemaElementTest(elementDeclarationName); tokens.consume(")"); return result; } return null; } }
XPathParser { protected SchemaElementTest parseSchemaElementTest( TokenStream tokens ) { if (tokens.canConsume("schema-element", "(")) { NameTest elementDeclarationName = parseNameTest(tokens); SchemaElementTest result = new SchemaElementTest(elementDeclarationName); tokens.consume(")"); return result; } return null; } XPathParser( TypeSystem context ); }
XPathParser { protected SchemaElementTest parseSchemaElementTest( TokenStream tokens ) { if (tokens.canConsume("schema-element", "(")) { NameTest elementDeclarationName = parseNameTest(tokens); SchemaElementTest result = new SchemaElementTest(elementDeclarationName); tokens.consume(")"); return result; } return null; } XPathParser( TypeSystem context ); Component parseXPath( String xpath ); }
XPathParser { protected SchemaElementTest parseSchemaElementTest( TokenStream tokens ) { if (tokens.canConsume("schema-element", "(")) { NameTest elementDeclarationName = parseNameTest(tokens); SchemaElementTest result = new SchemaElementTest(elementDeclarationName); tokens.consume(")"); return result; } return null; } XPathParser( TypeSystem context ); Component parseXPath( String xpath );  }