View Javadoc

1   /*
2    * Copyright 2005 The Codehaus.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.codehaus.mojo.castor;
17  
18  import org.apache.maven.plugins.annotations.Parameter;
19  
20  /**
21   * A mojo that uses Castor MappingTool to generate mapping files from a single Class. <a
22   * href="http://castor.codehaus.org/javadoc/org/exolab/castor/tools/MappingTool.html"> MappingTool</a>.
23   * 
24   * @goal mapping
25   * @phase process-classes
26   * @author nicolas <nicolas@apache.org>
27   */
28  public class MappingMojo
29      extends AbstractMappingMojo
30  {
31      /**
32       * The name of the Java class from which a mapping file should be generated.
33       */
34      @Parameter(property = "className", required = true)
35      private String className;
36  
37      /**
38       * Name of the mapping file to be generated.
39       * 
40       */
41      @Parameter(property = "mappingName", required = true)
42      private String mappingName;
43  
44      /**
45       * {@inheritDoc}
46       * 
47       * @see org.codehaus.mojo.castor.AbstractMappingMojo#getClassName()
48       */
49      protected String getClassName()
50      {
51          return className;
52      }
53  
54      /**
55       * {@inheritDoc}
56       * 
57       * @see org.codehaus.mojo.castor.AbstractMappingMojo#getMappingName()
58       */
59      protected String getMappingName()
60      {
61          return mappingName;
62      }
63  }