*/
package org.opendaylight.controller.blueprint.ext;
-import com.google.common.base.Optional;
import com.google.common.base.Strings;
import com.google.common.io.Resources;
import java.io.IOException;
import java.io.InputStream;
import java.net.URISyntaxException;
import java.net.URL;
+import java.util.Optional;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.stream.XMLStreamException;
import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
SchemaContext schemaContext = schemaService.getGlobalContext();
- Module module = schemaContext.findModuleByNamespaceAndRevision(bindingContext.bindingQName.getNamespace(),
- bindingContext.bindingQName.getRevision());
+ Module module = schemaContext.findModule(bindingContext.bindingQName.getModule()).orElse(null);
checkNotNull(module, "%s: Could not obtain the module schema for namespace %s, revision %s",
logName, bindingContext.bindingQName.getNamespace(), bindingContext.bindingQName.getRevision());
return (T) appConfig;
}
- private static void checkNotNull(Object reference, String errorMessageFormat, Object... formatArgs)
- throws ConfigXMLReaderException {
+ private static void checkNotNull(final Object reference, final String errorMessageFormat,
+ final Object... formatArgs) throws ConfigXMLReaderException {
checkCondition(reference != null, errorMessageFormat, formatArgs);
}
- private static void checkCondition(boolean expression, String errorMessageFormat, Object... formatArgs)
- throws ConfigXMLReaderException {
+ private static void checkCondition(final boolean expression, final String errorMessageFormat,
+ final Object... formatArgs) throws ConfigXMLReaderException {
if (!expression) {
throw new ConfigXMLReaderException(String.format(errorMessageFormat, formatArgs));
}