package org.opendaylight.controller.md.sal.binding.impl;
import org.opendaylight.controller.sal.binding.codegen.impl.SingletonHolder;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
-import org.opendaylight.yangtools.binding.data.codec.gen.impl.StreamWriterGenerator;
-import org.opendaylight.yangtools.binding.data.codec.impl.BindingNormalizedNodeCodecRegistry;
+import org.opendaylight.mdsal.binding.dom.codec.gen.impl.StreamWriterGenerator;
+import org.opendaylight.mdsal.binding.dom.codec.impl.BindingNormalizedNodeCodecRegistry;
+import org.opendaylight.mdsal.binding.generator.api.ClassLoadingStrategy;
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.sal.binding.generator.api.ClassLoadingStrategy;
import org.opendaylight.yangtools.yang.model.api.SchemaContextListener;
/**
*
* @author Thomas Pantelis
*/
-public class BindingToNormalizedNodeCodecFactory {
- /**
- * This method is deprecated in favor of newInstance/registerInstance.
- *
- * @param classLoadingStrategy
- * @param schemaService
- * @return BindingToNormalizedNodeCodec instance
- */
- @Deprecated
- public static BindingToNormalizedNodeCodec getOrCreateInstance(ClassLoadingStrategy classLoadingStrategy,
- SchemaService schemaService) {
- BindingNormalizedNodeCodecRegistry codecRegistry = new BindingNormalizedNodeCodecRegistry(
- StreamWriterGenerator.create(SingletonHolder.JAVASSIST));
- BindingToNormalizedNodeCodec instance = new BindingToNormalizedNodeCodec(
- classLoadingStrategy, codecRegistry, true);
- schemaService.registerSchemaContextListener(instance);
- return instance;
+public final class BindingToNormalizedNodeCodecFactory {
+ private BindingToNormalizedNodeCodecFactory() {
}
/**
* Creates a new BindingToNormalizedNodeCodec instance.
*
- * @param classLoadingStrategy
+ * @param classLoadingStrategy the ClassLoadingStrategy
* @return the BindingToNormalizedNodeCodec instance
*/
- public static BindingToNormalizedNodeCodec newInstance(ClassLoadingStrategy classLoadingStrategy) {
- BindingNormalizedNodeCodecRegistry codecRegistry = new BindingNormalizedNodeCodecRegistry(
+ public static BindingToNormalizedNodeCodec newInstance(final ClassLoadingStrategy classLoadingStrategy) {
+ final BindingNormalizedNodeCodecRegistry codecRegistry = new BindingNormalizedNodeCodecRegistry(
StreamWriterGenerator.create(SingletonHolder.JAVASSIST));
return new BindingToNormalizedNodeCodec(classLoadingStrategy, codecRegistry, true);
}
* @param schemaService the SchemaService.
* @return the ListenerRegistration
*/
- public static ListenerRegistration<SchemaContextListener> registerInstance(BindingToNormalizedNodeCodec instance,
- SchemaService schemaService) {
+ public static ListenerRegistration<SchemaContextListener> registerInstance(
+ final BindingToNormalizedNodeCodec instance, final DOMSchemaService schemaService) {
return schemaService.registerSchemaContextListener(instance);
}
}