Fix mdsal-dom-spi dependencies
[mdsal.git] / binding / mdsal-binding-generator / src / main / java / org / opendaylight / mdsal / binding / generator / 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;
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.GeneratedType;
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 an entire {@link EffectiveModelContext}. The method will return list of all
23      * {@link GeneratedType}s that could be Generated from EffectiveModelContext.
24      *
25      * @param context EffectiveModelContext
26      * @return List of Generated Types
27      *
28      * @see EffectiveModelContext
29      */
30     default @NonNull List<GeneratedType> generateTypes(final EffectiveModelContext context) {
31         return generateTypes(context, context.getModules());
32     }
33
34     /**
35      * Generate Types from an {@link EffectiveModelContext} restricted by sub set of specified Modules. The effective
36      * model context <em>must</em> contain all of the sub modules otherwise the there is no guarantee that result
37      * List of Generated Types will contain correct Generated Types.
38      *
39      * @param context EffectiveModelContext
40      * @param modules Subset of Modules
41      * @return List of Generated Types restricted by subset of Modules
42      *
43      * @see Module
44      * @see EffectiveModelContext
45      */
46     @NonNull List<GeneratedType> generateTypes(EffectiveModelContext context, Collection<? extends Module> modules);
47 }