/* * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ package org.opendaylight.mdsal.binding.dom.codec.impl; import com.google.common.collect.ImmutableMap; import java.lang.reflect.Method; import java.util.List; import org.eclipse.jdt.annotation.NonNull; import org.eclipse.jdt.annotation.Nullable; import org.opendaylight.mdsal.binding.dom.codec.api.BindingCodecTreeNode; import org.opendaylight.mdsal.binding.dom.codec.loader.CodecClassLoader; import org.opendaylight.mdsal.binding.runtime.api.BindingRuntimeContext; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; import org.opendaylight.yangtools.yang.model.api.DataNodeContainer; import org.opendaylight.yangtools.yang.model.api.ListSchemaNode; /** * Location specific context for schema nodes, which contains codec specific information to properly serialize * and deserialize from Java YANG Binding data to NormalizedNode data. * *
* Two core subtypes of codec context are available: *
* During lifetime of factory all calls for same arguments to method must return equal result (not necessary same
* instance of result).
*/
protected interface CodecContextFactory {
/**
* Returns immutable runtime context associated with this factory.
*
* @return runtime context
*/
BindingRuntimeContext getRuntimeContext();
/**
* Returns leaf nodes for supplied data container and parent class.
*
* @param type Binding type for which leaves should be loaded.
* @param schema Instantiated schema of binding type.
* @return Map of local name to leaf node context.
*/
ImmutableMap