View Javadoc

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