import java.util.Optional;
import javax.xml.XMLConstants;
import org.opendaylight.netconf.api.DocumentedException;
+import org.opendaylight.yangtools.yang.common.ErrorSeverity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.Attr;
throw new DocumentedException("Attribute doesn't start with :",
DocumentedException.ErrorType.APPLICATION,
DocumentedException.ErrorTag.INVALID_VALUE,
- DocumentedException.ErrorSeverity.ERROR);
+ ErrorSeverity.ERROR);
}
prefix = attribKey.substring(XMLConstants.XMLNS_ATTRIBUTE.length() + 1);
}
getName()),
DocumentedException.ErrorType.APPLICATION,
DocumentedException.ErrorTag.OPERATION_FAILED,
- DocumentedException.ErrorSeverity.ERROR);
+ ErrorSeverity.ERROR);
}
}
expectedNamespace),
DocumentedException.ErrorType.APPLICATION,
DocumentedException.ErrorTag.OPERATION_FAILED,
- DocumentedException.ErrorSeverity.ERROR);
+ ErrorSeverity.ERROR);
}
}
expectedNamespace),
DocumentedException.ErrorType.APPLICATION,
DocumentedException.ErrorTag.OPERATION_FAILED,
- DocumentedException.ErrorSeverity.ERROR);
+ ErrorSeverity.ERROR);
}
}
* @return List of child elements
*/
public List<XmlElement> getChildElements(final String tagName) {
- return getChildElementsInternal(e -> {
- // localName returns pure localName without prefix
- return e.getLocalName().equals(tagName);
- });
+ return getChildElementsInternal(e -> e.getLocalName().equals(tagName));
}
public List<XmlElement> getChildElementsWithinNamespace(final String childName, final String namespace) {
childName, toString(), children.size()),
DocumentedException.ErrorType.APPLICATION,
DocumentedException.ErrorTag.INVALID_VALUE,
- DocumentedException.ErrorSeverity.ERROR);
+ ErrorSeverity.ERROR);
}
return children.get(0);
throw new DocumentedException("One element " + childName + " expected in " + toString(),
DocumentedException.ErrorType.APPLICATION,
DocumentedException.ErrorTag.INVALID_VALUE,
- DocumentedException.ErrorSeverity.ERROR);
+ ErrorSeverity.ERROR);
}
return nameElements.get(0);
}
children.size()),
DocumentedException.ErrorType.APPLICATION,
DocumentedException.ErrorTag.INVALID_VALUE,
- DocumentedException.ErrorSeverity.ERROR);
+ ErrorSeverity.ERROR);
}
return children.get(0);
}
throw new DocumentedException(getName() + " should contain text.",
DocumentedException.ErrorType.APPLICATION,
DocumentedException.ErrorTag.INVALID_VALUE,
- DocumentedException.ErrorSeverity.ERROR
+ ErrorSeverity.ERROR
);
}
toString()),
DocumentedException.ErrorType.APPLICATION,
DocumentedException.ErrorTag.OPERATION_FAILED,
- DocumentedException.ErrorSeverity.ERROR);
+ ErrorSeverity.ERROR);
}
return attribute;
}
throw new MissingNameSpaceException(String.format("No namespace defined for %s", this),
DocumentedException.ErrorType.APPLICATION,
DocumentedException.ErrorTag.OPERATION_FAILED,
- DocumentedException.ErrorSeverity.ERROR);
+ ErrorSeverity.ERROR);
}
return namespaceURI.get();
}
throw new DocumentedException(String.format("Unrecognised elements %s in %s", childElements, this),
DocumentedException.ErrorType.APPLICATION,
DocumentedException.ErrorTag.INVALID_VALUE,
- DocumentedException.ErrorSeverity.ERROR);
+ ErrorSeverity.ERROR);
}
}