View Javadoc
1   /*
2    * #%L
3    * EUGene :: Maven plugin
4    * %%
5    * Copyright (C) 2006 - 2010 CodeLutin
6    * %%
7    * This program is free software: you can redistribute it and/or modify
8    * it under the terms of the GNU Lesser General Public License as 
9    * published by the Free Software Foundation, either version 3 of the 
10   * License, or (at your option) any later version.
11   * 
12   * This program is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15   * GNU General Lesser Public License for more details.
16   * 
17   * You should have received a copy of the GNU General Lesser Public 
18   * License along with this program.  If not, see
19   * <http://www.gnu.org/licenses/lgpl-3.0.html>.
20   * #L%
21   */
22  
23  package org.nuiton.eugene.plugin.writer;
24  
25  import org.codehaus.plexus.component.annotations.Component;
26  import org.nuiton.eugene.writer.ChainedFileWriter;
27  
28  /**
29   * To create a memory model from xml model files.
30   *
31   * @author tchemit
32   * @since 2.6.3
33   */
34  @Component(role = ChainedFileWriter.class, hint = "xmlModel2Memory")
35  public class XmlModelChainedFileWriter extends BaseChainedFileWriterToMemoryModel {
36  
37  
38      public XmlModelChainedFileWriter() {
39          super();
40      }
41  
42      @Override
43      protected String getInputType() {
44          return "xml";
45      }
46  
47      @Override
48      public String getInputProtocol() {
49          return "model";
50      }
51  
52      @Override
53      public boolean acceptInclude(String include) {
54          return include.startsWith("model:") ||
55                 include.endsWith(".objectmodel") ||
56                 include.endsWith(".statemodel");
57      }
58  
59      @Override
60      public String getDefaultIncludes() {
61          return "**/*.*model";
62      }
63  
64      @Override
65      public String getDefaultInputDirectory() {
66          return "src/main/models";
67      }
68  
69      @Override
70      public String getDefaultOutputDirectory() {
71          return "java";
72      }
73  
74      @Override
75      public String getDefaultTestInputDirectory() {
76          return "src/test/models";
77      }
78  
79      @Override
80      public String getDefaultTestOutputDirectory() {
81          return "test-java";
82      }
83  }