Update BindingRuntime{Context,Generator,Types}
[mdsal.git] / binding / mdsal-binding-generator-api / src / main / java / org / opendaylight / mdsal / binding / generator / api / BindingGenerator.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. 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.generator.api;
9
10 import java.util.Collection;
11 import java.util.List;
12 import org.eclipse.jdt.annotation.NonNull;
13 import org.opendaylight.mdsal.binding.model.api.Type;
14 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
15 import org.opendaylight.yangtools.yang.model.api.Module;
16
17 /**
18  * Transform Schema Context to Generated types.
19  */
20 public interface BindingGenerator {
21     /**
22      * Generate Types from whole Schema Context. The method will return List of All Generated Types that could be
23      * Generated from EffectiveModelContext.
24      *
25      * @param context EffectiveModelContext
26      * @return List of Generated Types
27      *
28      * @see EffectiveModelContext
29      */
30     default @NonNull List<Type> generateTypes(final EffectiveModelContext context) {
31         return generateTypes(context, context.getModules());
32     }
33
34     /**
35      * Generate Types from Schema Context restricted by sub set of specified Modules. The Schema Context MUST contain
36      * all of the sub modules otherwise the there is no guarantee that result List of Generated Types will contain
37      * correct Generated Types.
38      *
39      * @param context Schema Context
40      * @param modules Sub Set of Modules
41      * @return List of Generated Types restricted by sub set of Modules
42      *
43      * @see Module
44      * @see EffectiveModelContext
45      */
46     @NonNull List<Type> generateTypes(EffectiveModelContext context, Collection<? extends Module> modules);
47 }