df33d4c5919e81070c8947d2d30b01182fd85a3a
[controller.git] / opendaylight / sal / yang-prototype / code-generator / maven-yang / src / main / java / org / opendaylight / controller / yang2sources / spi / CodeGenerator.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.controller.yang2sources.spi;
9
10 import java.io.File;
11 import java.io.IOException;
12 import java.util.Collection;
13 import java.util.Map;
14 import java.util.Set;
15
16 import org.apache.maven.plugin.logging.Log;
17 import org.opendaylight.controller.yang.model.api.Module;
18 import org.opendaylight.controller.yang.model.api.SchemaContext;
19
20 /**
21  * Classes implementing this interface can be submitted to maven-yang-plugin's
22  * generate-sources goal.
23  */
24 public interface CodeGenerator {
25
26     /**
27      * Generate sources from provided {@link SchemaContext}
28      *
29      * @param context
30      *            parsed from yang files
31      * @param outputBaseDir
32      *            expected output directory for generated sources configured by
33      *            user
34      * @param currentModules
35      *            yang modules parsed from yangFilesRootDir
36      * @param log
37      *            maven logger
38      * @return collection of files that were generated from schema context
39      * @throws IOException
40      */
41     Collection<File> generateSources(SchemaContext context, File outputBaseDir,
42             Set<Module> currentModules, File projectBaseDir)
43             throws IOException;
44
45     void setLog(Log log);
46
47     void setAdditionalConfig(Map<String, String> additionalConfiguration);
48 }