Class FieldMatcher
java.lang.Object
com.sun.msv.verifier.identity.Matcher
com.sun.msv.verifier.identity.MatcherBundle
com.sun.msv.verifier.identity.PathMatcher
com.sun.msv.verifier.identity.FieldMatcher
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringBufferthis field is set to non-null if it's found that an element is matched to this XPath.protected Fieldprotected final FieldsMatcherparent FieldsMatcher object.protected Objectthe matched value.Fields inherited from class MatcherBundle
children -
Constructor Summary
ConstructorsConstructorDescriptionFieldMatcher(FieldsMatcher parent, Field field, String namespaceURI, String localName) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcharacters(char[] buf, int start, int len) private voidthis field matches more than once.protected voidendElement(org.relaxng.datatype.Datatype type) protected voidonAttributeMatched(String namespaceURI, String localName, String value, org.relaxng.datatype.Datatype type) this method is called when the attribute matches the XPath.protected voidonElementMatched(String namespaceURI, String localName) this method is called when the element matches the XPath.private voidsets the value field.protected voidstartElement(String namespaceURI, String localName, Attributes attributes) Methods inherited from class PathMatcher
onAttribute, start, startElementMethods inherited from class MatcherBundle
getDepth, onRemoved
-
Field Details
-
field
-
value
the matched value. If this field is null, then it means nothing is matched yet. -
parent
parent FieldsMatcher object. -
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.
-
-
Constructor Details
-
FieldMatcher
FieldMatcher(FieldsMatcher parent, Field field, String namespaceURI, String localName) throws SAXException - Throws:
SAXException
-
-
Method Details
-
onElementMatched
this method is called when the element matches the XPath.- Specified by:
onElementMatchedin classPathMatcher- Throws:
SAXException
-
onAttributeMatched
protected void onAttributeMatched(String namespaceURI, String localName, String value, org.relaxng.datatype.Datatype type) throws SAXException this method is called when the attribute matches the XPath.- Specified by:
onAttributeMatchedin classPathMatcher- Throws:
SAXException
-
startElement
protected void startElement(String namespaceURI, String localName, Attributes attributes) throws SAXException - Throws:
SAXException
-
endElement
- Overrides:
endElementin classMatcherBundle- Throws:
SAXException
-
characters
- Overrides:
charactersin classMatcherBundle- Throws:
SAXException
-
setValue
sets the value field.- Throws:
SAXException
-
doubleMatchError
this field matches more than once.- Throws:
SAXException
-