Top Description Fields Constructors Methods
com.sun.msv.verifier.identity

public Class FieldMatcher

extends PathMatcher
Class Inheritance
Imports
org.relaxng.datatype.Datatype, org.xml.sax.Attributes, .SAXException, com.sun.msv.grammar.xmlschema.Field

XPath matcher that tests one field of a key. This object is created by a FieldsMatcher when a SelectorMathcer finds a match to its selector. This object is responsible for finding a match to one field of the constraint. A field XPath may consist of "A|B|C". Each sub case A,B, and C is tested by a child FieldPathMatcher object. This class coordinates the work of those children and collects actual text that matches the given XPath.
Author
Kohsuke KAWAGUCHI

Field Summary

Modifier and TypeField and Description
protected StringBuffer
elementText

this field is set to non-null if it's found that an element is matched to this XPath.

protected Field
protected final FieldsMatcher
parent

parent FieldsMatcher object.

protected Object
value

the matched value.

Constructor Summary

AccessConstructor and Description
pack-priv
FieldMatcher(FieldsMatcher parent, Field field, String namespaceURI, String localName)

Method Summary

Modifier and TypeMethod and Description
protected void
characters(char[] buf, int start, int len)

Overrides com.sun.msv.verifier.identity.MatcherBundle.characters.

private void
doubleMatchError()

this field matches more than once.

protected void
protected void
onAttributeMatched(String namespaceURI, String localName, String value, Datatype type)

Implements abstract com.sun.msv.verifier.identity.PathMatcher.onAttributeMatched.

this method is called when the attribute matches the XPath.
protected void
onElementMatched(String namespaceURI, String localName)

Implements abstract com.sun.msv.verifier.identity.PathMatcher.onElementMatched.

this method is called when the element matches the XPath.
private void
setValue(String lexical, Datatype type)

sets the value field.

protected void
startElement(String namespaceURI, String localName, Attributes attributes)

Inherited from com.sun.msv.verifier.identity.PathMatcher:
onAttributestartstartElement

Field Detail

elementTextback to summary
protected StringBuffer elementText

this field is set to non-null if it's found that an element is matched to this XPath. This field is then used to collect the contents of the matched element until it encounters the endElement method.

fieldback to summary
protected Field field
parentback to summary
protected final FieldsMatcher parent

parent FieldsMatcher object.

valueback to summary
protected Object value

the matched value. If this field is null, then it means nothing is matched yet.

Constructor Detail

FieldMatcherback to summary
pack-priv FieldMatcher(FieldsMatcher parent, Field field, String namespaceURI, String localName) throws SAXException

Method Detail

charactersback to summary
protected void characters(char[] buf, int start, int len) throws SAXException

Overrides com.sun.msv.verifier.identity.MatcherBundle.characters.

doubleMatchErrorback to summary
private void doubleMatchError() throws SAXException

this field matches more than once.

endElementback to summary
protected void endElement(Datatype type) throws SAXException

Overrides com.sun.msv.verifier.identity.MatcherBundle.endElement.

onAttributeMatchedback to summary
protected void onAttributeMatched(String namespaceURI, String localName, String value, Datatype type) throws SAXException

Implements abstract com.sun.msv.verifier.identity.PathMatcher.onAttributeMatched.

this method is called when the attribute matches the XPath.

onElementMatchedback to summary
protected void onElementMatched(String namespaceURI, String localName) throws SAXException

Implements abstract com.sun.msv.verifier.identity.PathMatcher.onElementMatched.

this method is called when the element matches the XPath.

setValueback to summary
private void setValue(String lexical, Datatype type) throws SAXException

sets the value field.

startElementback to summary
protected void startElement(String namespaceURI, String localName, Attributes attributes) throws SAXException