View Javadoc
1   package org.codehaus.mojo.webstart;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import java.util.List;
23  import java.util.Map;
24  
25  /**
26   * This class represents a <jnlpFile> configuration element from the
27   * pom.xml file. It contains the configuration elements that are specific
28   * to a single JNLP that will be generated by the webstart plugin.
29   *
30   * @author Kevin Stembridge
31   * @version $Revision$
32   * @since 1.0-alpha-2
33   */
34  public class JnlpFile
35  {
36  
37      private String inputTemplateResourcePath;
38  
39      private String templateFilename;
40  
41      private String inputTemplate;
42  
43      private String outputFilename;
44  
45      private List<JarResource> jarResources;
46  
47      private List<String> arguments;
48  
49      private String mainClass;
50  
51      private Map<String, String> properties;
52  
53      /**
54       * Creates a new uninitialized {@code JnlpFile}.
55       */
56      public JnlpFile()
57      {
58          // do nothing
59      }
60  
61      public String getTemplateFilename()
62      {
63          return templateFilename;
64      }
65  
66      public void setInputTemplateResourcePath( String inputTemplateResourcePath )
67      {
68          this.inputTemplateResourcePath = inputTemplateResourcePath;
69      }
70  
71      public String getInputTemplateResourcePath()
72      {
73          return inputTemplateResourcePath;
74      }
75  
76      public void setInputTemplate( String inputTemplate )
77      {
78          this.inputTemplate = inputTemplate;
79      }
80  
81      /**
82       * Returns the name of the Velocity template file used to generate the
83       * JNLP file.
84       *
85       * @return the name of the JNLP template file.
86       */
87      public String getInputTemplate()
88      {
89          return inputTemplate;
90      }
91  
92      /**
93       * Returns the name to be used for the generated JNLP file.
94       *
95       * @return the value of the outputFilename field.
96       */
97      protected String getOutputFilename()
98      {
99          return this.outputFilename;
100     }
101 
102     /**
103      * Returns the collection of <code>JarResource</code> elements for this JNLP file.
104      *
105      * @return the value of the jarResources field.
106      */
107     protected List<JarResource> getJarResources()
108     {
109         return this.jarResources;
110     }
111 
112     /**
113      * Returns the fully qualified classname of the class to be specified as
114      * the <code>main-class</code> in the generated JNLP file.
115      *
116      * @return the value of the mainClass field.
117      */
118     protected String getMainClass()
119     {
120         return this.mainClass;
121     }
122 
123     /**
124      * Returns the extrat <code>properties</code> we can inject in the generated JNLP file.
125      *
126      * @return the value of the properties field.
127      */
128     protected Map<String, String> getProperties()
129     {
130         return this.properties;
131     }
132 
133     /**
134      * Sets the collection of <code>JarResource</code> elements for this JNLP file.
135      *
136      * @param jarResources the new value for field {@link #jarResources}
137      */
138     protected void setJarResources( List<JarResource> jarResources )
139     {
140         this.jarResources = jarResources;
141     }
142 
143     /**
144      * Sets the outputFileName.
145      *
146      * @param outputFilename the new value for field {@link #outputFilename}
147      */
148     protected void setOutputFilename( String outputFilename )
149     {
150         this.outputFilename = outputFilename;
151     }
152 
153     /**
154      * Sets the fully qualified classname of the class to be specified as
155      * the <code>main-class</code> in the generated JNLP file.
156      *
157      * @param mainClass the new value for field {@link #mainClass}
158      */
159     protected void setMainClass( String mainClass )
160     {
161         this.mainClass = mainClass;
162     }
163 
164     /**
165      * Sets the extra properties we can inject in the generated JNLP file.
166      *
167      * @param properties the new value for field {@link #properties}
168      */
169 
170     public void setProperties( Map<String, String> properties )
171     {
172         this.properties = properties;
173     }
174 
175     public List<String> getArguments()
176     {
177         return arguments;
178     }
179 
180     public void setArguments(List<String> arguments)
181     {
182         this.arguments = arguments;
183     }
184 
185 }