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.api;
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.Module;
15 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
18 * Transform Schema Context to Generated types.
20 public interface BindingGenerator {
22 * Generate Types from whole Schema Context. The method will return List of All Generated Types that could be
23 * Generated from Schema Context.
25 * @param context Schema Context
26 * @return List of Generated Types
30 default @NonNull List<Type> generateTypes(final SchemaContext context) {
31 return generateTypes(context, context.getModules());
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.
39 * @param context Schema Context
40 * @param modules Sub Set of Modules
41 * @return List of Generated Types restricted by sub set of Modules
46 @NonNull List<Type> generateTypes(SchemaContext context, Collection<? extends Module> modules);