/** * Checks if this QName is a match for the other QName. A QName is a match * if it is null and if 1) the local namespace is {@link ANY_NAMESPACE} or * the two namespaces are both null or have a matching uri and 2) the local * name is {@link ANY_LOCALNAME} or the two local names are equal. */ public boolean matches(QName o) { if (o == null) { return false; } if (!matchesAnyNamespace()) { XmlNamespace otherNs = o.getNs(); String idUri = (namespace == null) ? null : namespace.getUri(); String otherUri = (otherNs == null) ? null : otherNs.getUri(); // Check namespace uris. if (idUri == null) { if (otherUri != null) { return false; } } else if (!idUri.equals(otherUri)) { return false; } } // Check the local names. if (matchesAnyLocalName()) { return true; } return localName.equals(o.getLocalName()); }
/** * Checks if this QName is a match for the other QName. A QName is a match * if it is null and if 1) the local namespace is {@link ANY_NAMESPACE} or * the two namespaces are both null or have a matching uri and 2) the local * name is {@link ANY_LOCALNAME} or the two local names are equal. */ public boolean matches(QName o) { if (o == null) { return false; } if (!matchesAnyNamespace()) { XmlNamespace otherNs = o.getNs(); String idUri = (namespace == null) ? null : namespace.getUri(); String otherUri = (otherNs == null) ? null : otherNs.getUri(); // Check namespace uris. if (idUri == null) { if (otherUri != null) { return false; } } else if (!idUri.equals(otherUri)) { return false; } } // Check the local names. if (matchesAnyLocalName()) { return true; } return localName.equals(o.getLocalName()); }
/** * Checks if this QName is a match for the other QName. A QName is a match * if it is null and if 1) the local namespace is {@link ANY_NAMESPACE} or * the two namespaces are both null or have a matching uri and 2) the local * name is {@link ANY_LOCALNAME} or the two local names are equal. */ public boolean matches(QName o) { if (o == null) { return false; } if (!matchesAnyNamespace()) { XmlNamespace otherNs = o.getNs(); String idUri = (namespace == null) ? null : namespace.getUri(); String otherUri = (otherNs == null) ? null : otherNs.getUri(); // Check namespace uris. if (idUri == null) { if (otherUri != null) { return false; } } else if (!idUri.equals(otherUri)) { return false; } } // Check the local names. if (matchesAnyLocalName()) { return true; } return localName.equals(o.getLocalName()); }
if (id.matchesAnyNamespace()) { for (Map.Entry<QName, AttributeKey<?>> attrEntry : attributes.entrySet()) {
if (id.matchesAnyNamespace()) { for (Map.Entry<QName, AttributeKey<?>> attrEntry : attributes.entrySet()) {
if (id.matchesAnyNamespace()) { for (Map.Entry<QName, AttributeKey<?>> attrEntry : attributes.entrySet()) {
if (id.matchesAnyNamespace()) { for (Map.Entry<QName, ElementKey<?, ?>> elemEntry : elements.entrySet()) {
if (id.matchesAnyNamespace()) { for (Map.Entry<QName, ElementKey<?, ?>> elemEntry : elements.entrySet()) {
if (id.matchesAnyNamespace()) { for (Map.Entry<QName, ElementKey<?, ?>> elemEntry : elements.entrySet()) {