1 package org.apache.maven.plugins.ear;
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.io.File;
23 import java.util.List;
24
25 /**
26 * A context for the {@link ApplicationXmlWriter}.
27 *
28 * @author <a href="snicoll@apache.org">Stephane Nicoll</a>
29 */
30 class ApplicationXmlWriterContext
31 {
32
33 private String applicationId;
34
35 private final File destinationFile;
36
37 private final List<EarModule> earModules;
38
39 private final List<SecurityRole> securityRoles;
40
41 private final List<EnvEntry> envEntries;
42
43 private final List<EjbRef> ejbEntries;
44
45 private final List<ResourceRef> resourceRefs;
46
47 private final String displayName;
48
49 private final String description;
50
51 private final String libraryDirectory;
52
53 private final String applicationName;
54
55 private final Boolean initializeInOrder;
56
57 ApplicationXmlWriterContext( File destinationFile, List<EarModule> earModules,
58 List<SecurityRole> securityRoles, List<EnvEntry> envEntries,
59 List<EjbRef> ejbEntries, List<ResourceRef> resourceRefs, String displayName,
60 String description, String libraryDirectory, String applicationName,
61 Boolean initializeInOrder )
62 {
63 this.destinationFile = destinationFile;
64 this.earModules = earModules;
65 this.securityRoles = securityRoles;
66 this.envEntries = envEntries;
67 this.ejbEntries = ejbEntries;
68 this.resourceRefs = resourceRefs;
69 this.displayName = displayName;
70 this.description = description;
71 this.libraryDirectory = libraryDirectory;
72 this.applicationName = applicationName;
73 this.initializeInOrder = initializeInOrder;
74 }
75
76 public final ApplicationXmlWriterContext setApplicationId( String applicationId )
77 {
78 this.applicationId = applicationId;
79 return this;
80 }
81
82 public final String getApplicationId()
83 {
84 return applicationId;
85 }
86
87 /**
88 * Returns the name of the file to use to write application.xml to.
89 *
90 * @return the output file
91 */
92 public File getDestinationFile()
93 {
94 return destinationFile;
95 }
96
97 /**
98 * Returns the list of {@link EarModule} instances.
99 *
100 * @return the ear modules
101 */
102 public List<EarModule> getEarModules()
103 {
104 return earModules;
105 }
106
107 /**
108 * Returns the list of {@link SecurityRole} instances.
109 *
110 * @return the security roles
111 */
112 public List<SecurityRole> getSecurityRoles()
113 {
114 return securityRoles;
115 }
116
117 /**
118 * Returns the list of {@link EnvEntry} instances (as per JavaEE 6).
119 *
120 * @return the env-entry elements
121 */
122 public List<EnvEntry> getEnvEntries()
123 {
124 return envEntries;
125 }
126
127 /**
128 * Returns the list of {@link EjbRef}.
129 *
130 * @return the env-ref elements
131 */
132 public List<EjbRef> getEjbEntries()
133 {
134 return ejbEntries;
135 }
136
137 /**
138 * Returns the list of {@link ResourceRef}.
139 *
140 * @return the resource-ref elements.
141 */
142 public List<ResourceRef> getResourceRefs()
143 {
144 return resourceRefs;
145 }
146
147 /**
148 * Returns the display name.
149 *
150 * @return the display name
151 */
152 public String getDisplayName()
153 {
154 return displayName;
155 }
156
157 /**
158 * Returns the description.
159 *
160 * @return the description
161 */
162 public String getDescription()
163 {
164 return description;
165 }
166
167 /**
168 * Returns the library directory (as per JavaEE 5).
169 *
170 * @return the library directory
171 */
172 public String getLibraryDirectory()
173 {
174 return libraryDirectory;
175 }
176
177 /**
178 * Returns the application name (as per JavaEE 6).
179 *
180 * @return the application name
181 */
182 public String getApplicationName()
183 {
184 return applicationName;
185 }
186
187 /**
188 * Returns the value of the initialize in order parameter (as per JavaEE 6).
189 *
190 * @return the initialize in order value
191 */
192 public Boolean getInitializeInOrder()
193 {
194 return initializeInOrder;
195 }
196 }