View Javadoc

1   package org.apache.maven.plugin;
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.plugin.descriptor.MojoDescriptor;
23  import org.codehaus.plexus.util.xml.Xpp3Dom;
24  
25  import java.util.ArrayList;
26  import java.util.List;
27  
28  /**
29   * Describes a single mojo invocation.
30   *
31   * @author <a href="mailto:brett@apache.org">Brett Porter</a>
32   * @version $Id: MojoExecution.java 640549 2008-03-24 20:05:11Z bentmann $
33   */
34  public class MojoExecution
35  {
36      private final String executionId;
37  
38      private final MojoDescriptor mojoDescriptor;
39  
40      private Xpp3Dom configuration;
41  
42      private List forkedExecutions = new ArrayList();
43  
44      private List reports;
45  
46      public MojoExecution( MojoDescriptor mojoDescriptor )
47      {
48          this.mojoDescriptor = mojoDescriptor;
49          this.executionId = null;
50          this.configuration = null;
51      }
52  
53      public MojoExecution( MojoDescriptor mojoDescriptor, String executionId )
54      {
55          this.mojoDescriptor = mojoDescriptor;
56          this.executionId = executionId;
57          this.configuration = null;
58      }
59  
60      public MojoExecution( MojoDescriptor mojoDescriptor, Xpp3Dom configuration )
61      {
62          this.mojoDescriptor = mojoDescriptor;
63          this.configuration = configuration;
64          this.executionId = null;
65      }
66  
67      public String getExecutionId()
68      {
69          return executionId;
70      }
71  
72      public MojoDescriptor getMojoDescriptor()
73      {
74          return mojoDescriptor;
75      }
76  
77      public Xpp3Dom getConfiguration()
78      {
79          return configuration;
80      }
81  
82      public void addMojoExecution( MojoExecution execution )
83      {
84          forkedExecutions.add( execution );
85      }
86  
87      public void setReports( List reports )
88      {
89          this.reports = reports;
90      }
91  
92      public List getReports()
93      {
94          return reports;
95      }
96  
97      public List getForkedExecutions()
98      {
99          return forkedExecutions;
100     }
101 
102     public void setConfiguration( Xpp3Dom configuration )
103     {
104         this.configuration = configuration;
105     }
106 }