c2eba4f722e4a2e993296e46c8f992ebabb99f26
[hc2vpp.git] /
1 /*
2  * Copyright (c) 2016 Cisco and/or its affiliates.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at:
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package io.fd.honeycomb.v3po.translate.read.registry;
18
19 import com.google.common.annotations.Beta;
20 import io.fd.honeycomb.v3po.translate.ModifiableSubtreeManagerRegistryBuilder;
21 import io.fd.honeycomb.v3po.translate.read.Reader;
22 import javax.annotation.Nonnull;
23 import org.opendaylight.yangtools.concepts.Builder;
24 import org.opendaylight.yangtools.yang.binding.DataObject;
25 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
26
27 /**
28  * Mutable registry that allows adding new readers.
29  */
30 @Beta
31 public interface ModifiableReaderRegistryBuilder
32         extends ModifiableSubtreeManagerRegistryBuilder<Reader<? extends DataObject, ? extends Builder<?>>> {
33
34     // TODO we should be able to add structural/reflexive readers automatically in the registry builder, we just need builder class
35     // We would need generated class loading strategy instance and then load builder classes relying on naming + package conventions of Binding spec
36     /**
37      * Add a structural reader that performs no read operation on its own, just fills in the hierarchy.
38      */
39     <D extends DataObject> void addStructuralReader(@Nonnull InstanceIdentifier<D> id,
40                                                     @Nonnull Class<? extends Builder<D>> builderType);
41 }