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