View Javadoc
1   /*
2    * See the NOTICE file distributed with this work for additional
3    * information regarding copyright ownership.
4    *
5    * This is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU Lesser General Public License as
7    * published by the Free Software Foundation; either version 2.1 of
8    * the License, or (at your option) any later version.
9    *
10   * This software is distributed in the hope that it will be useful,
11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13   * Lesser General Public License for more details.
14   *
15   * You should have received a copy of the GNU Lesser General Public
16   * License along with this software; if not, write to the Free
17   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19   */
20  package com.puppycrawl.tools.checkstyle.grammar.antlr4;
21  
22  import static com.puppycrawl.tools.checkstyle.grammar.antlr4.LifecyclePhase.GENERATE_RESOURCES;
23  import static java.lang.String.format;
24  
25  import java.util.ArrayList;
26  import java.util.Collections;
27  import java.util.List;
28  import java.util.Set;
29  
30  import org.junit.platform.commons.logging.Logger;
31  
32  class Artifact{}
33  class ArtifactRepository{}
34  class License{}
35  class Model{}
36  class Organization{}
37  class ProcessRemoteResourcesMojo{}
38  @interface Component{
39      Class<MavenProjectBuilder> role();
40  }
41  class LifecyclePhase{
42      public static final Object GENERATE_RESOURCES = null;
43  }
44  @interface Mojo{
45      String name();
46  }
47  @interface Parameter{
48      String defaultValue();
49  
50      boolean readonly();
51  }
52  class ResolutionScope{
53      public static final Object RUNTIME = null;
54  }
55  class InvalidProjectModelException{}
56  class MavenProject{}
57  class MavenProjectBuilder{}
58  class ProjectBuildingException{}
59  
60  /**
61   * Extends the Maven Remote Resources plugin to fix memory issue found in it, see
62   * <a href="https://jira.xwiki.org/browse/XCOMMONS-1421">XCOMMONS-1421</a>.
63   * <p>
64   * To be removed when <a href="https://issues.apache.org/jira/browse/MRRESOURCES-106">MRRESOURCES-106</a> is fixed on
65   * the Maven side.
66   *
67   * @version $Id: 45afe6a790dc2b72fec66a9f5b0e95e95105bd43 $
68   * @since 9.11.5
69   * @since 10.5RC1
70   */
71  @Mojo(name = "")
72  public class InputAntlr4AstRegressionCommentsOnAnnotationsAndEnums
73          extends ProcessRemoteResourcesMojo
74  {
75      /**
76       * Control what is injected in the "projects" Velocity binding.
77       *
78       * @version $Id: 45afe6a790dc2b72fec66a9f5b0e95e95105bd43 $
79       */
80      public enum ProjectData
81      {
82          /**
83           * "projects" is empty.
84           */
85          NONE,
86  
87          /**
88           * "projects" only contains licenses.
89           */
90          LICENSES,
91  
92          /**
93           * "projects" contains full MavenProject metadata
94           * (very expensive but standard Maven Resource plugin behavior).
95           */
96          FULL
97      }
98  
99      @Parameter(defaultValue = "NONE", readonly = false)
100     protected ProjectData projectsData;
101 
102     @Parameter(defaultValue = "${localRepository}", readonly = true)
103     private ArtifactRepository localRepositoryThis;
104 
105     @Component(role = MavenProjectBuilder.class)
106     private MavenProjectBuilder mavenProjectBuilderThis;
107 
108     /**
109      * List of Remote Repositories used by the resolver.
110      */
111     @Parameter(defaultValue = "${project.remoteArtifactRepositories}", readonly = true)
112     private List<ArtifactRepository> remoteArtifactRepositoriesThis;
113 
114     private Logger getLog() {
115         return null;
116     }
117 
118     enum InputJavadocVariableTagsEnum
119     {
120         CONSTANT_A, // violation
121 
122         /**
123          *
124          */
125         CONSTANT_B,
126 
127         CONSTANT_C // violation
128         {
129             /**
130              *
131              */
132             public void someMethod()
133             {
134             }
135 
136             public void someOtherMethod()
137             {
138 
139             }
140         }
141     }
142 
143 }