View Javadoc

1   /*
2    * Copyright 2006-2012 smartics, Kronseder & Reiner GmbH
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 de.smartics.maven.plugin.buildmetadata;
17  
18  import java.io.File;
19  
20  /**
21   * Maps an properties output file location to a packaging.
22   *
23   * @author <a href="mailto:robert.reiner@smartics.de">Robert Reiner</a>
24   * @version $Revision:591 $
25   */
26  public final class FileMapping
27  {
28    // ********************************* Fields *********************************
29  
30    // --- constants ------------------------------------------------------------
31  
32    // --- members --------------------------------------------------------------
33  
34    /**
35     * The project's packaging as specified in the <code>packaging</code> element
36     * of a POM to be mapped to a location to write the
37     * <code>build.properties</code>.
38     */
39    private String packaging;
40  
41    /**
42     * The name of the properties file to write.
43     */
44    private File outputFile;
45  
46    // ****************************** Initializer *******************************
47  
48    // ****************************** Constructors ******************************
49  
50    /**
51     * Default constructor for Maven.
52     */
53    public FileMapping()
54    {
55    }
56  
57    /**
58     * Default constructor for Maven.
59     *
60     * @param packaging the project's packaging as specified in the
61     *          <code>packaging</code> element of a POM to be mapped to a location
62     *          to write the <code>build</code>.
63     * @param outputFile the name of the properties file to write.
64     */
65    public FileMapping(final String packaging, final File outputFile)
66    {
67      this.packaging = packaging;
68      this.outputFile = outputFile;
69    }
70  
71    // ****************************** Inner Classes *****************************
72  
73    // ********************************* Methods ********************************
74  
75    // --- init -----------------------------------------------------------------
76  
77    // --- get&set --------------------------------------------------------------
78  
79    /**
80     * Returns the project's packaging as specified in the <code>packaging</code>
81     * element of a POM to be mapped to a location to write the
82     * <code>build. properties</code>.
83     *
84     * @return the project's packaging as specified in the <code>packaging</code>
85     *         element of a POM to be mapped to a location to write the
86     *         <code>build</code>.
87     */
88    public String getPackaging()
89    {
90      return packaging;
91    }
92  
93    /**
94     * Returns the name of the properties file to write.
95     *
96     * @return the name of the properties file to write.
97     */
98    public File getOutputFile()
99    {
100     return outputFile;
101   }
102 
103   // --- business -------------------------------------------------------------
104 
105   // --- object basics --------------------------------------------------------
106 
107 }