View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.maven.tools.plugin.extractor.annotations.datamodel;
20  
21  import java.lang.annotation.Annotation;
22  
23  import org.apache.maven.plugins.annotations.Execute;
24  import org.apache.maven.plugins.annotations.LifecyclePhase;
25  
26  /**
27   * @author Olivier Lamy
28   * @since 3.0
29   */
30  public class ExecuteAnnotationContent implements Execute {
31      private String goal;
32  
33      private String lifecycle;
34  
35      private LifecyclePhase phase;
36  
37      private String customPhase;
38  
39      @Override
40      public LifecyclePhase phase() {
41          return this.phase;
42      }
43  
44      @Override
45      public String customPhase() {
46          return customPhase;
47      }
48  
49      @Override
50      public String goal() {
51          return this.goal;
52      }
53  
54      @Override
55      public String lifecycle() {
56          return this.lifecycle;
57      }
58  
59      public void phase(String phase) {
60          this.phase = LifecyclePhase.valueOf(phase);
61      }
62  
63      public void customPhase(String customPhase) {
64          this.customPhase = customPhase;
65      }
66  
67      public void goal(String goal) {
68          this.goal = goal;
69      }
70  
71      public void lifecycle(String lifecycle) {
72          this.lifecycle = lifecycle;
73      }
74  
75      @Override
76      public Class<? extends Annotation> annotationType() {
77          return null;
78      }
79  
80      @Override
81      public String toString() {
82          final StringBuilder sb = new StringBuilder();
83          sb.append("ExecuteAnnotationContent");
84          sb.append("{goal='").append(goal).append('\'');
85          sb.append(", lifecycle='").append(lifecycle).append('\'');
86          sb.append(", phase=").append(phase);
87          sb.append(", customPhase=").append(customPhase);
88          sb.append('}');
89          return sb.toString();
90      }
91  }