2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.mdsal.binding.generator;
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;
18 * Transform Schema Context to Generated types.
20 public interface BindingGenerator {
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.
25 * @param context EffectiveModelContext
26 * @return List of Generated Types
28 * @see EffectiveModelContext
30 default @NonNull List<GeneratedType> generateTypes(final EffectiveModelContext context) {
31 return generateTypes(context, context.getModules());
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.
39 * @param context EffectiveModelContext
40 * @param modules Subset of Modules
41 * @return List of Generated Types restricted by subset of Modules
44 * @see EffectiveModelContext
46 @NonNull List<GeneratedType> generateTypes(EffectiveModelContext context, Collection<? extends Module> modules);