View Javadoc
1   package org.apache.maven.archetype;
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 org.apache.maven.artifact.repository.ArtifactRepository;
23  import org.apache.maven.project.MavenProject;
24  import org.apache.maven.project.ProjectBuildingRequest;
25  
26  import java.io.File;
27  import java.util.ArrayList;
28  import java.util.List;
29  import java.util.Properties;
30  
31  /** @author Jason van Zyl */
32  public class ArchetypeCreationRequest
33  {
34      private ProjectBuildingRequest projectBuildingRequest;
35  
36      private ArtifactRepository localRepository;
37  
38      private MavenProject project;
39  
40  //    private File propertyFile;
41  
42      private List<String> languages = new ArrayList<>();
43  
44      private List<String> filtereds = new ArrayList<>();
45  
46      private String defaultEncoding = "UTF-8";
47  
48      private boolean preserveCData = false;
49  
50      private boolean keepParent = true;
51  
52      private boolean partialArchetype = false;
53  
54      private String packageName;
55  
56      private Properties properties;
57  
58      private String postPhase;
59  
60      private File outputDirectory;
61  
62      private File settingsFile;
63  
64      public String getPostPhase()
65      {
66          return postPhase;
67      }
68  
69      public ArchetypeCreationRequest setPostPhase( String postPhase )
70      {
71          this.postPhase = postPhase;
72  
73          return this;
74      }
75  
76      public ArtifactRepository getLocalRepository()
77      {
78          return localRepository;
79      }
80  
81      public ArchetypeCreationRequest setLocalRepository( ArtifactRepository localRepository )
82      {
83          this.localRepository = localRepository;
84  
85          return this;
86      }
87  
88      public ProjectBuildingRequest getProjectBuildingRequest()
89      {
90          return projectBuildingRequest;
91      }
92  
93      public ArchetypeCreationRequest setProjectBuildingRequest( ProjectBuildingRequest projectBuildingRequest )
94      {
95          this.projectBuildingRequest = projectBuildingRequest;
96          
97          return this;
98      }
99  
100     public MavenProject getProject()
101     {
102         return project;
103     }
104 
105     public ArchetypeCreationRequest setProject( MavenProject project )
106     {
107         this.project = project;
108 
109         return this;
110     }
111 
112 //    public File getPropertyFile()
113 //    {
114 //        return propertyFile;
115 //    }
116 //
117 //    public ArchetypeCreationRequest setPropertyFile( File propertyFile )
118 //    {
119 //        this.propertyFile = propertyFile;
120 //
121 //        return this;
122 //    }
123 
124     public List<String> getLanguages()
125     {
126         return languages;
127     }
128 
129     public ArchetypeCreationRequest setLanguages( List<String> languages )
130     {
131         this.languages = languages;
132 
133         return this;
134     }
135 
136     public List<String> getFiltereds()
137     {
138         return filtereds;
139     }
140 
141     public ArchetypeCreationRequest setFiltereds( List<String> filtereds )
142     {
143         this.filtereds = filtereds;
144 
145         return this;
146     }
147 
148     public String getDefaultEncoding()
149     {
150         return defaultEncoding;
151     }
152 
153     public ArchetypeCreationRequest setDefaultEncoding( String defaultEncoding )
154     {
155         this.defaultEncoding = defaultEncoding;
156 
157         return this;
158     }
159 
160     public boolean isPreserveCData()
161     {
162         return preserveCData;
163     }
164 
165     public ArchetypeCreationRequest setPreserveCData( boolean preserveCData )
166     {
167         this.preserveCData = preserveCData;
168 
169         return this;
170     }
171 
172     public boolean isKeepParent()
173     {
174         return keepParent;
175     }
176 
177     public ArchetypeCreationRequest setKeepParent( boolean keepParent )
178     {
179         this.keepParent = keepParent;
180 
181         return this;
182     }
183 
184     public boolean isPartialArchetype()
185     {
186         return partialArchetype;
187     }
188 
189     public ArchetypeCreationRequest setPartialArchetype( boolean partialArchetype )
190     {
191         this.partialArchetype = partialArchetype;
192 
193         return this;
194     }
195 
196     public Properties getProperties()
197     {
198         return properties;
199     }
200 
201     public ArchetypeCreationRequest setProperties( Properties properties )
202     {
203         this.properties = properties;
204 
205         return this;
206     }
207 
208     public String getPackageName()
209     {
210         return packageName;
211     }
212 
213     public ArchetypeCreationRequest setPackageName( String packageName )
214     {
215         this.packageName = packageName;
216 
217         return this;
218     }
219 
220     public File getOutputDirectory()
221     {
222         return outputDirectory;
223     }
224 
225     public ArchetypeCreationRequest setOutputDirectory( File outputDirectory )
226     {
227         this.outputDirectory = outputDirectory;
228 
229         return this;
230     }
231 
232     public File getSettingsFile()
233     {
234         return settingsFile;
235     }
236 
237     public ArchetypeCreationRequest setSettingsFile( File settingsFile )
238     {
239         this.settingsFile = settingsFile;
240 
241         return this;
242     }
243 }