Interface MatchingRule<T>
-
public interface MatchingRule<T>
Interface for generic matching rules. The responsibility of a matching rule is to decide if two objects of the same type match. This may seem a simple thing to do but the details may get quite complex. E.g. comparing string in case sensitive or insensitive manner, comparing PolyStrings, etc.- Author:
- Radovan Semancik
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description QName
getName()
QName that identifies the rule.boolean
isSupported(QName xsdType)
Returns true if the rule can be applied to the specified XSD type.boolean
match(T a, T b)
Matches two objects.boolean
matchRegex(T a, String regex)
Matches value against given regex.T
normalize(T original)
Returns a normalized version of the value.
-
-
-
Method Detail
-
getName
QName getName()
QName that identifies the rule. This QName may be used to refer to this specific matching rule, it is an matching rule identifier.
-
isSupported
boolean isSupported(QName xsdType)
Returns true if the rule can be applied to the specified XSD type.
-
match
boolean match(T a, T b) throws SchemaException
Matches two objects.- Throws:
SchemaException
-
matchRegex
boolean matchRegex(T a, String regex) throws SchemaException
Matches value against given regex.- Throws:
SchemaException
-
normalize
T normalize(T original) throws SchemaException
Returns a normalized version of the value. For normalized version the following holds: if A matches B then normalize(A) == normalize(B)- Throws:
SchemaException
-
-