public final String getAttributeValue() { try { return coreGetTextContent(TextCollectorPolicy.DEFAULT); } catch (CoreModelException ex) { throw AxiomExceptionTranslator.translate(ex); } }
public final void setAttributeValue(String value) { try { coreSetValue(value); } catch (CoreModelException ex) { throw AxiomExceptionTranslator.translate(ex); } }
public final int hashCode() { try { String value = getAttributeValue(); // TODO: using getNamespace is not efficient because it will create a new OMNamespace instance OMNamespace namespace = getNamespace(); return coreGetLocalName().hashCode() ^ (value != null ? value.hashCode() : 0) ^ (namespace != null ? namespace.hashCode() : 0); } catch (CoreModelException ex) { throw AxiomExceptionTranslator.translate(ex); } }
public final boolean equals(Object obj) { if (this == obj) { return true; } else if (obj instanceof OMAttribute) { try { OMAttribute other = (OMAttribute) obj; // TODO: using getNamespace is not efficient because it will create a new OMNamespace // instance return coreGetLocalName().equals(other.getLocalName()) && ObjectUtils.equals(getNamespace(), other.getNamespace()) && getAttributeValue().equals(other.getAttributeValue()); } catch (CoreModelException ex) { throw AxiomExceptionTranslator.translate(ex); } } else { return false; } }