@Test public void shouldParseSchemaAttributeTest() { SchemaAttributeTest result = parser.parseSchemaAttributeTest(tokenize("schema-attribute(foo)")); assertThat(result, is(notNullValue())); assertThat(result.getAttributeDeclarationName(), is(nameTest("foo"))); result = parser.parseSchemaAttributeTest(tokenize("schema-attribute(foo:bar)")); assertThat(result, is(notNullValue())); assertThat(result.getAttributeDeclarationName(), is(nameTest("foo", "bar"))); result = parser.parseSchemaAttributeTest(tokenize("schema-attribute(*)")); assertThat(result, is(notNullValue())); assertThat(result.getAttributeDeclarationName(), is(wildcard())); }
protected SchemaAttributeTest parseSchemaAttributeTest( TokenStream tokens ) { if (tokens.canConsume("schema-attribute", "(")) { NameTest attributeDeclarationName = parseNameTest(tokens); SchemaAttributeTest result = new SchemaAttributeTest(attributeDeclarationName); tokens.consume(")"); return result; } return null; }
XPathParser { protected SchemaAttributeTest parseSchemaAttributeTest( TokenStream tokens ) { if (tokens.canConsume("schema-attribute", "(")) { NameTest attributeDeclarationName = parseNameTest(tokens); SchemaAttributeTest result = new SchemaAttributeTest(attributeDeclarationName); tokens.consume(")"); return result; } return null; } }
XPathParser { protected SchemaAttributeTest parseSchemaAttributeTest( TokenStream tokens ) { if (tokens.canConsume("schema-attribute", "(")) { NameTest attributeDeclarationName = parseNameTest(tokens); SchemaAttributeTest result = new SchemaAttributeTest(attributeDeclarationName); tokens.consume(")"); return result; } return null; } XPathParser( TypeSystem context ); }
XPathParser { protected SchemaAttributeTest parseSchemaAttributeTest( TokenStream tokens ) { if (tokens.canConsume("schema-attribute", "(")) { NameTest attributeDeclarationName = parseNameTest(tokens); SchemaAttributeTest result = new SchemaAttributeTest(attributeDeclarationName); tokens.consume(")"); return result; } return null; } XPathParser( TypeSystem context ); Component parseXPath( String xpath ); }
XPathParser { protected SchemaAttributeTest parseSchemaAttributeTest( TokenStream tokens ) { if (tokens.canConsume("schema-attribute", "(")) { NameTest attributeDeclarationName = parseNameTest(tokens); SchemaAttributeTest result = new SchemaAttributeTest(attributeDeclarationName); tokens.consume(")"); return result; } return null; } XPathParser( TypeSystem context ); Component parseXPath( String xpath );  }