Search in sources :

Example 1 with DataObjectSerializerGenerator

use of org.opendaylight.mdsal.binding.dom.codec.gen.impl.DataObjectSerializerGenerator in project controller by opendaylight.

the class BindingNormalizedCodecTest method setupWithSchema.

@Override
protected void setupWithSchema(final SchemaContext schemaContext) {
    this.context = schemaContext;
    final DataObjectSerializerGenerator streamWriter = StreamWriterGenerator.create(JavassistUtils.forClassPool(ClassPool.getDefault()));
    final BindingNormalizedNodeCodecRegistry registry = new BindingNormalizedNodeCodecRegistry(streamWriter);
    this.codec = new BindingToNormalizedNodeCodec(GeneratedClassLoadingStrategy.getTCCLClassLoadingStrategy(), registry, true);
}
Also used : BindingNormalizedNodeCodecRegistry(org.opendaylight.mdsal.binding.dom.codec.impl.BindingNormalizedNodeCodecRegistry) DataObjectSerializerGenerator(org.opendaylight.mdsal.binding.dom.codec.gen.impl.DataObjectSerializerGenerator)

Example 2 with DataObjectSerializerGenerator

use of org.opendaylight.mdsal.binding.dom.codec.gen.impl.DataObjectSerializerGenerator in project bgpcep by opendaylight.

the class AbstractRIBTestSetup method createCodecFactory.

private static BindingCodecTreeFactory createCodecFactory(final ClassLoadingStrategy str, final SchemaContext ctx) {
    final DataObjectSerializerGenerator generator = StreamWriterGenerator.create(JavassistUtils.forClassPool(ClassPool.getDefault()));
    final BindingNormalizedNodeCodecRegistry codec = new BindingNormalizedNodeCodecRegistry(generator);
    codec.onBindingRuntimeContextUpdated(BindingRuntimeContext.create(str, ctx));
    return codec;
}
Also used : BindingNormalizedNodeCodecRegistry(org.opendaylight.mdsal.binding.dom.codec.impl.BindingNormalizedNodeCodecRegistry) DataObjectSerializerGenerator(org.opendaylight.mdsal.binding.dom.codec.gen.impl.DataObjectSerializerGenerator)

Example 3 with DataObjectSerializerGenerator

use of org.opendaylight.mdsal.binding.dom.codec.gen.impl.DataObjectSerializerGenerator in project controller by opendaylight.

the class BindingTestContext method startBindingToDomMappingService.

public void startBindingToDomMappingService() {
    checkState(this.classPool != null, "ClassPool needs to be present");
    final DataObjectSerializerGenerator generator = StreamWriterGenerator.create(JavassistUtils.forClassPool(this.classPool));
    final BindingNormalizedNodeCodecRegistry codecRegistry = new BindingNormalizedNodeCodecRegistry(generator);
    final GeneratedClassLoadingStrategy loading = GeneratedClassLoadingStrategy.getTCCLClassLoadingStrategy();
    this.codec = new BindingToNormalizedNodeCodec(loading, codecRegistry);
    this.mockSchemaService.registerSchemaContextListener(this.codec);
}
Also used : GeneratedClassLoadingStrategy(org.opendaylight.mdsal.binding.generator.impl.GeneratedClassLoadingStrategy) BindingToNormalizedNodeCodec(org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec) BindingNormalizedNodeCodecRegistry(org.opendaylight.mdsal.binding.dom.codec.impl.BindingNormalizedNodeCodecRegistry) DataObjectSerializerGenerator(org.opendaylight.mdsal.binding.dom.codec.gen.impl.DataObjectSerializerGenerator)

Aggregations

DataObjectSerializerGenerator (org.opendaylight.mdsal.binding.dom.codec.gen.impl.DataObjectSerializerGenerator)3 BindingNormalizedNodeCodecRegistry (org.opendaylight.mdsal.binding.dom.codec.impl.BindingNormalizedNodeCodecRegistry)3 BindingToNormalizedNodeCodec (org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec)1 GeneratedClassLoadingStrategy (org.opendaylight.mdsal.binding.generator.impl.GeneratedClassLoadingStrategy)1