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 java.util.List;
11 import org.opendaylight.mdsal.binding.runtime.api.CaseRuntimeType;
12 import org.opendaylight.yangtools.yang.binding.DataObject;
13 import org.opendaylight.yangtools.yang.binding.DataObjectStep;
14 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
15 import org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode;
16 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
18 final class CaseCodecContext<D extends DataObject> extends DataObjectCodecContext<D, CaseRuntimeType> {
19 CaseCodecContext(final CaseCodecPrototype prototype) {
20 super(prototype, CodecItemFactory.of(prototype.javaClass()));
24 void addYangPathArgument(final List<PathArgument> builder, final DataObjectStep<?> step) {
29 public D deserialize(final NormalizedNode data) {
30 return createBindingProxy(checkDataArgument(ChoiceNode.class, data));
34 public PathArgument serializePathArgument(final DataObjectStep<?> step) {
36 throw new IllegalArgumentException("Unexpected argument " + step);
42 public DataObjectStep<?> deserializePathArgument(final PathArgument arg) {
44 throw new IllegalArgumentException("Unexpected argument " + arg);