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 /**
22 * Holds scanned data from a {@code @After} annotation
23 * ({@code org.apache.maven.api.plugin.annotations.After}).
24 * <p>
25 * The {@code @After} annotation declares that the annotated mojo must run
26 * after another phase has completed. It carries three attributes:
27 * <ul>
28 * <li>{@code phase} – the phase this mojo must run after</li>
29 * <li>{@code type} – the scope type ({@code PROJECT}, {@code DEPENDENCIES}, {@code CHILDREN})</li>
30 * <li>{@code scope} – the dependency scope</li>
31 * </ul>
32 * <p>
33 * Setter method names match the annotation attribute names so that
34 * {@link org.apache.maven.tools.plugin.extractor.annotations.scanner.DefaultMojoAnnotationsScanner#populateAnnotationContent}
35 * can fill them via reflection.
36 *
37 * @since 4.0.0
38 */
39 public class AfterAnnotationContent {
40 private String phase;
41
42 private String type;
43
44 private String scope;
45
46 public String phase() {
47 return this.phase;
48 }
49
50 public void phase(String phase) {
51 this.phase = phase;
52 }
53
54 public String type() {
55 return this.type;
56 }
57
58 public void type(String type) {
59 this.type = type;
60 }
61
62 public String scope() {
63 return this.scope;
64 }
65
66 public void scope(String scope) {
67 this.scope = scope;
68 }
69
70 @Override
71 public String toString() {
72 final StringBuilder sb = new StringBuilder();
73 sb.append("AfterAnnotationContent");
74 sb.append("{phase='").append(phase).append('\'');
75 sb.append(", type='").append(type).append('\'');
76 sb.append(", scope='").append(scope).append('\'');
77 sb.append('}');
78 return sb.toString();
79 }
80 }