/** * Constructs a STAX {@link QName}from a DOM4J {@link org.dom4j.QName}. * * @param qname * The {@link org.dom4j.QName}from which to construct the STAX * {@link QName}. * * @return The constructed {@link QName}. */ public QName createQName(org.dom4j.QName qname) { return new QName(qname.getNamespaceURI(), qname.getName(), qname .getNamespacePrefix()); }
public String toString() { return super.toString() + " [name: " + getName() + " namespace: \"" + getNamespace() + "\"]"; }
/** * DOCUMENT ME! * * @return the hash code based on the qualified name and the URI of the * namespace. */ public int hashCode() { if (hashCode == 0) { hashCode = getName().hashCode() ^ getNamespaceURI().hashCode(); if (hashCode == 0) { hashCode = 0xbabe; } } return hashCode; }
public String getName() { return getQName().getName(); }
public String getLocalName() { return getQName().getName(); }
public boolean equals(Object object) { if (this == object) { return true; } else if (object instanceof QName) { QName that = (QName) object; // we cache hash codes so this should be quick if (hashCode() == that.hashCode()) { return getName().equals(that.getName()) && getNamespaceURI().equals(that.getNamespaceURI()); } } return false; }
/** * DOCUMENT ME! * * @param qname * DOCUMENT ME! * * @return the cached QName instance if there is one or adds the given qname * to the cache if not */ public QName intern(QName qname) { return get(qname.getName(), qname.getNamespace(), qname .getQualifiedName()); }
public String getName() { return getQName().getName(); }
public String getLocalName() { return getQName().getName(); }
protected void removeFromElementIndex(Element element) { QName qName = element.getQName(); String name = qName.getName(); removeFromElementIndex(qName, element); removeFromElementIndex(name, element); }
protected void addToElementIndex(Element element) { QName qName = element.getQName(); String name = qName.getName(); addToElementIndex(qName, element); addToElementIndex(name, element); }
protected void addToAttributeIndex(Attribute attribute) { QName qName = attribute.getQName(); String name = qName.getName(); addToAttributeIndex(qName, attribute); addToAttributeIndex(name, attribute); }
protected void removeFromAttributeIndex(Attribute attribute) { QName qName = attribute.getQName(); String name = qName.getName(); removeFromAttributeIndex(qName, attribute); removeFromAttributeIndex(name, attribute); }
protected void removeFromElementIndex(Element element) { QName qName = element.getQName(); String name = qName.getName(); removeFromElementIndex(qName, element); removeFromElementIndex(name, element); }
protected void removeFromAttributeIndex(Attribute attribute) { QName qName = attribute.getQName(); String name = qName.getName(); removeFromAttributeIndex(qName, attribute); removeFromAttributeIndex(name, attribute); }
protected void removeFromElementIndex(Element element) { QName qName = element.getQName(); String name = qName.getName(); removeFromElementIndex(qName, element); removeFromElementIndex(name, element); }
protected void addToElementIndex(Element element) { QName qName = element.getQName(); String name = qName.getName(); addToElementIndex(qName, element); addToElementIndex(name, element); }
protected void removeFromAttributeIndex(Attribute attribute) { QName qName = attribute.getQName(); String name = qName.getName(); removeFromAttributeIndex(qName, attribute); removeFromAttributeIndex(name, attribute); }
protected void addToAttributeIndex(Attribute attribute) { QName qName = attribute.getQName(); String name = qName.getName(); addToAttributeIndex(qName, attribute); addToAttributeIndex(name, attribute); }
protected void addToAttributeIndex(Attribute attribute) { QName qName = attribute.getQName(); String name = qName.getName(); addToAttributeIndex(qName, attribute); addToAttributeIndex(name, attribute); }