@Override public boolean isSupported(QName xsdType) { return nameMatchingRule.isSupported(xsdType); }
@Override public boolean isSupported(QName xsdType) { return nameMatchingRule.isSupported(xsdType); }
@Override @NotNull public <T> MatchingRule<T> getMatchingRule(QName ruleName, QName typeQName) throws SchemaException { if (ruleName == null) { return (MatchingRule<T>) defaultMatchingRule; } MatchingRule<T> matchingRule = (MatchingRule<T>) matchingRules.get(ruleName); if (matchingRule == null) { //try match according to the localPart if (QNameUtil.matchAny(ruleName, matchingRules.keySet())){ ruleName = QNameUtil.resolveNs(ruleName, matchingRules.keySet()); matchingRule = (MatchingRule<T>) matchingRules.get(ruleName); } if (matchingRule == null) { throw new SchemaException("Unknown matching rule for name " + ruleName); } } if (typeQName != null && !matchingRule.isSupported(typeQName)) { throw new SchemaException("Matching rule "+ruleName+" does not support type "+typeQName); } return matchingRule; }