35fac762257ffd7a7de52730f59b3a49f67a482b
[yangtools.git] / code-generator / maven-sal-api-gen-plugin / src / main / java / org / opendaylight / yangtools / yang / wadl / generator / maven / WadlGenerator.java
1 /*
2  * Copyright (c) 2014 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.yang.wadl.generator.maven;
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.apache.maven.project.MavenProject;
18 import org.opendaylight.yangtools.yang.model.api.Module;
19 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
20 import org.opendaylight.yangtools.yang.wadl.generator.WadlRestconfGenerator;
21 import org.opendaylight.yangtools.yang2sources.spi.CodeGenerator;
22
23 public class WadlGenerator implements CodeGenerator {
24     
25     @Override
26     public Collection<File> generateSources(SchemaContext context, File outputDir, Set<Module> currentModules)
27             throws IOException {
28         
29         final File outputBaseDir;
30         if (outputDir == null) {
31             outputBaseDir = new File("target" + File.separator + "generated-sources" + File.separator
32                     + "maven-sal-api-gen" + File.separator + "wadl");
33         } else {
34             outputBaseDir = outputDir;
35         }
36
37         final WadlRestconfGenerator generator = new WadlRestconfGenerator(outputBaseDir);
38         return generator.generate(context, currentModules);
39     }
40
41     @Override
42     public void setLog(Log log) {
43         // TODO Auto-generated method stub
44         
45     }
46
47     @Override
48     public void setAdditionalConfig(Map<String, String> additionalConfiguration) {
49         // TODO Auto-generated method stub
50         
51     }
52
53     @Override
54     public void setResourceBaseDir(File resourceBaseDir) {
55         // TODO Auto-generated method stub
56         
57     }
58
59     @Override
60     public void setMavenProject(MavenProject project) {
61         // TODO Auto-generated method stub
62         
63     }
64
65 }