com.thaiopensource.relaxng.pattern.NsNameClass Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jing Show documentation
Show all versions of jing Show documentation
Jing - tool for validating RelaxNG - (OSGi-compatible version)
package com.thaiopensource.relaxng.pattern;
import com.thaiopensource.xml.util.Name;
class NsNameClass implements NameClass {
private final String namespaceUri;
NsNameClass(String namespaceUri) {
this.namespaceUri = namespaceUri;
}
public boolean contains(Name name) {
return this.namespaceUri.equals(name.getNamespaceUri());
}
public int containsSpecificity(Name name) {
return contains(name) ? SPECIFICITY_NS_NAME : SPECIFICITY_NONE;
}
public int hashCode() {
return namespaceUri.hashCode();
}
public boolean equals(Object obj) {
if (obj == null || !(obj instanceof NsNameClass))
return false;
return namespaceUri.equals(((NsNameClass)obj).namespaceUri);
}
public void accept(NameClassVisitor visitor) {
visitor.visitNsName(namespaceUri);
}
public boolean isOpen() {
return true;
}
public String getNamespaceUri() {
return namespaceUri;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy