2 * Copyright (c) 2023 PANTHEON.tech, s.r.o. 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.dom.codec.api.CommonDataObjectCodecTreeNode;
11 import org.opendaylight.mdsal.binding.runtime.api.CompositeRuntimeType;
12 import org.opendaylight.yangtools.yang.binding.DataObject;
13 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument;
14 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
15 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
18 * Base implementation of {@link CommonDataObjectCodecTreeNode}.
20 abstract sealed class CommonDataObjectCodecContext<D extends DataObject, T extends CompositeRuntimeType>
21 extends DataContainerCodecContext<D, T, CommonDataObjectCodecPrototype<T>>
22 implements CommonDataObjectCodecTreeNode<D>
23 permits AbstractDataObjectCodecContext, ChoiceCodecContext {
24 CommonDataObjectCodecContext(final CommonDataObjectCodecPrototype<T> prototype) {
28 @SuppressWarnings("unchecked")
30 public final Class<D> getBindingClass() {
31 return Class.class.cast(prototype().javaClass());
35 protected NodeIdentifier getDomPathArgument() {
36 return prototype().getYangArg();
40 * Returns deserialized Binding Path Argument from YANG instance identifier.
42 protected PathArgument getBindingPathArgument(final YangInstanceIdentifier.PathArgument domArg) {
46 protected final PathArgument bindingArg() {
47 return prototype().getBindingArg();