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<String>();
43  
44      private List<String> filtereds = new ArrayList<String>();
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      public String getPostPhase()
63      {
64          return postPhase;
65      }
66  
67      public ArchetypeCreationRequest setPostPhase( String postPhase )
68      {
69          this.postPhase = postPhase;
70  
71          return this;
72      }
73  
74      public ArtifactRepository getLocalRepository()
75      {
76          return localRepository;
77      }
78  
79      public ArchetypeCreationRequest setLocalRepository( ArtifactRepository localRepository )
80      {
81          this.localRepository = localRepository;
82  
83          return this;
84      }
85  
86      public ProjectBuildingRequest getProjectBuildingRequest()
87      {
88          return projectBuildingRequest;
89      }
90  
91      public ArchetypeCreationRequest setProjectBuildingRequest( ProjectBuildingRequest projectBuildingRequest )
92      {
93          this.projectBuildingRequest = projectBuildingRequest;
94          
95          return this;
96      }
97  
98      public MavenProject getProject()
99      {
100         return project;
101     }
102 
103     public ArchetypeCreationRequest setProject( MavenProject project )
104     {
105         this.project = project;
106 
107         return this;
108     }
109 
110 //    public File getPropertyFile()
111 //    {
112 //        return propertyFile;
113 //    }
114 //
115 //    public ArchetypeCreationRequest setPropertyFile( File propertyFile )
116 //    {
117 //        this.propertyFile = propertyFile;
118 //
119 //        return this;
120 //    }
121 
122     public List<String> getLanguages()
123     {
124         return languages;
125     }
126 
127     public ArchetypeCreationRequest setLanguages( List<String> languages )
128     {
129         this.languages = languages;
130 
131         return this;
132     }
133 
134     public List<String> getFiltereds()
135     {
136         return filtereds;
137     }
138 
139     public ArchetypeCreationRequest setFiltereds( List<String> filtereds )
140     {
141         this.filtereds = filtereds;
142 
143         return this;
144     }
145 
146     public String getDefaultEncoding()
147     {
148         return defaultEncoding;
149     }
150 
151     public ArchetypeCreationRequest setDefaultEncoding( String defaultEncoding )
152     {
153         this.defaultEncoding = defaultEncoding;
154 
155         return this;
156     }
157 
158     public boolean isPreserveCData()
159     {
160         return preserveCData;
161     }
162 
163     public ArchetypeCreationRequest setPreserveCData( boolean preserveCData )
164     {
165         this.preserveCData = preserveCData;
166 
167         return this;
168     }
169 
170     public boolean isKeepParent()
171     {
172         return keepParent;
173     }
174 
175     public ArchetypeCreationRequest setKeepParent( boolean keepParent )
176     {
177         this.keepParent = keepParent;
178 
179         return this;
180     }
181 
182     public boolean isPartialArchetype()
183     {
184         return partialArchetype;
185     }
186 
187     public ArchetypeCreationRequest setPartialArchetype( boolean partialArchetype )
188     {
189         this.partialArchetype = partialArchetype;
190 
191         return this;
192     }
193 
194     public Properties getProperties()
195     {
196         return properties;
197     }
198 
199     public ArchetypeCreationRequest setProperties( Properties properties )
200     {
201         this.properties = properties;
202 
203         return this;
204     }
205 
206     public String getPackageName()
207     {
208         return packageName;
209     }
210 
211     public ArchetypeCreationRequest setPackageName( String packageName )
212     {
213         this.packageName = packageName;
214 
215         return this;
216     }
217 
218     public File getOutputDirectory()
219     {
220         return outputDirectory;
221     }
222 
223     public ArchetypeCreationRequest setOutputDirectory( File outputDirectory )
224     {
225         this.outputDirectory = outputDirectory;
226 
227         return this;
228     }
229 }