BUG-2179: split logging out of CodeGenerator
[yangtools.git] / yang / yang-maven-plugin-spi / src / main / java / org / opendaylight / yangtools / yang2sources / spi / BasicCodeGenerator.java
1 /*
2  * Copyright (c) 2015 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.yangtools.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 import org.opendaylight.yangtools.yang.model.api.Module;
16 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
17
18 /**
19  * Maven 3.1.x and newer uses SLF4J internally, which means we do not need to pass
20  * a logger instance around.
21  */
22 public interface BasicCodeGenerator {
23     /**
24      * Generate sources from provided {@link SchemaContext}
25      *
26      * @param context
27      *            parsed from YANG files
28      * @param outputBaseDir
29      *            expected output directory for generated sources configured by
30      *            user
31      * @param currentModules
32      *            YANG modules parsed from yangFilesRootDir
33      * @return collection of files that were generated from schema context
34      * @throws IOException
35      */
36     Collection<File> generateSources(SchemaContext context, File outputBaseDir, Set<Module> currentModules)
37             throws IOException;
38
39     /**
40      * Provided map contains all configuration that was set in pom for code
41      * generator in additionalConfiguration tag
42      *
43      * @param additionalConfiguration
44      */
45     void setAdditionalConfig(Map<String, String> additionalConfiguration);
46
47     /**
48      * Provided folder is marked as resources and its content will be packaged
49      * in resulting jar. Feel free to add necessary resources
50      *
51      * @param resourceBaseDir
52      */
53     void setResourceBaseDir(File resourceBaseDir);
54 }