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.controller.yang2sources.spi;
11 import java.io.IOException;
12 import java.util.Collection;
16 import org.apache.maven.plugin.logging.Log;
17 import org.apache.maven.project.MavenProject;
18 import org.opendaylight.controller.yang.model.api.Module;
19 import org.opendaylight.controller.yang.model.api.SchemaContext;
22 * Classes implementing this interface can be submitted to maven-yang-plugin's
23 * generate-sources goal.
25 public interface CodeGenerator {
28 * Generate sources from provided {@link SchemaContext}
31 * parsed from yang files
32 * @param outputBaseDir
33 * expected output directory for generated sources configured by
35 * @param currentModules
36 * yang modules parsed from yangFilesRootDir
37 * @return collection of files that were generated from schema context
40 Collection<File> generateSources(SchemaContext context, File outputBaseDir, Set<Module> currentModules)
44 * Utilize maven logging if necessary
51 * Provided map contains all configuration that was set in pom for code
52 * generator in additionalConfiguration tag
54 * @param additionalConfiguration
56 void setAdditionalConfig(Map<String, String> additionalConfiguration);
59 * Provided folder is marked as resources and its content will be packaged
60 * in resulting jar. Feel free to add necessary resources
62 * @param resourceBaseDir
64 void setResourceBaseDir(File resourceBaseDir);
67 * Provided maven project object. Any additional information about current
68 * maven project can be accessed from it.
72 void setMavenProject(MavenProject project);