Binding v2 DOM Codec - codecs API - Part 1
[mdsal.git] / binding2 / mdsal-binding2-dom-codec / src / main / java / org / opendaylight / mdsal / binding / javav2 / dom / codec / api / codecs / BindingTreeCodec.java
1 /*
2  * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.mdsal.binding.javav2.dom.codec.api.codecs;
9
10 import com.google.common.annotations.Beta;
11 import javax.annotation.Nullable;
12 import org.opendaylight.mdsal.binding.javav2.spec.base.InstanceIdentifier;
13 import org.opendaylight.mdsal.binding.javav2.spec.base.TreeNode;
14 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
15 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
16
17 /**
18  * Navigable tree representing hierarchy of Binding to Normalized Node codecs.
19  *
20  * This navigable tree is associated to concrete set of YANG models, represented
21  * by SchemaContext and provides access to subtree specific serialization
22  * context.
23  */
24 @Beta
25 public interface BindingTreeCodec {
26
27     /**
28      * Get specific subtree serialization context by Binding path.
29      *
30      * @param path
31      *            - {@link InstanceIdentifier} path
32      * @return subtree codec
33      */
34     @Nullable
35     <T extends TreeNode> BindingTreeNodeCodec<T> getSubtreeCodec(InstanceIdentifier<T> path);
36
37     /**
38      * Get specific subtree serialization context by DOM path.
39      *
40      * @param path
41      *            - {@link YangInstanceIdentifier} path
42      * @return subtree codec
43      */
44     @Nullable
45     BindingTreeNodeCodec<?> getSubtreeCodec(YangInstanceIdentifier path);
46
47     /**
48      * Get specific subtree serialization context by {@link SchemaPath} path.
49      *
50      * @param path
51      *            - {@link SchemaPath} path
52      * @return specific subtree codec
53      */
54     @Nullable
55     BindingTreeNodeCodec<?> getSubtreeCodec(SchemaPath path);
56
57 }