2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.mdsal.binding.dom.codec.impl;
10 import org.opendaylight.mdsal.binding.runtime.api.ContainerLikeRuntimeType;
11 import org.opendaylight.yangtools.yang.binding.DataObject;
12 import org.opendaylight.yangtools.yang.binding.NodeStep;
13 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
14 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
16 sealed class ContainerLikeCodecContext<D extends DataObject>
17 extends DataObjectCodecContext<D, ContainerLikeRuntimeType<?, ?>> implements RpcInputCodec<D>
18 permits StructuralContainerCodecContext {
19 ContainerLikeCodecContext(final Class<D> cls, final ContainerLikeRuntimeType<?, ?> type,
20 final CodecContextFactory factory) {
21 this(new ContainerLikeCodecPrototype(new NodeStep<>(cls), type, factory));
24 ContainerLikeCodecContext(final ContainerLikeCodecPrototype prototype) {
29 public final D deserialize(final NormalizedNode data) {
30 return createBindingProxy(checkDataArgument(ContainerNode.class, data));
34 protected final Object deserializeObject(final NormalizedNode normalizedNode) {
35 return deserialize(normalizedNode);