Пример #1
0
 public final String getAttributeValue() {
   try {
     return coreGetTextContent(TextCollectorPolicy.DEFAULT);
   } catch (CoreModelException ex) {
     throw AxiomExceptionTranslator.translate(ex);
   }
 }
Пример #2
0
 public final void setAttributeValue(String value) {
   try {
     coreSetValue(value);
   } catch (CoreModelException ex) {
     throw AxiomExceptionTranslator.translate(ex);
   }
 }
Пример #3
0
 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);
   }
 }
Пример #4
0
 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;
   }
 }