Coverage Report - org.apache.maven.tools.plugin.annotations.datamodel.MojoAnnotationContent
 
Classes in this File Line Coverage Branch Coverage Complexity
MojoAnnotationContent
55 %
41/74
N/A
1
 
 1  
 package org.apache.maven.tools.plugin.annotations.datamodel;
 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.plugins.annotations.ResolutionScope;
 23  
 import org.apache.maven.plugins.annotations.InstanciationStrategy;
 24  
 import org.apache.maven.plugins.annotations.LifecyclePhase;
 25  
 import org.apache.maven.plugins.annotations.Mojo;
 26  
 
 27  
 import java.lang.annotation.Annotation;
 28  
 
 29  
 /**
 30  
  * @author Olivier Lamy
 31  
  * @since 3.0
 32  
  */
 33  1
 public class MojoAnnotationContent
 34  
     extends AnnotatedContent
 35  
     implements Mojo
 36  
 {
 37  
     private String name;
 38  
 
 39  1
     private LifecyclePhase defaultPhase = LifecyclePhase.NONE;
 40  
 
 41  1
     private ResolutionScope requiresDependencyResolution = ResolutionScope.RUNTIME;
 42  
 
 43  1
     private ResolutionScope requiresDependencyCollection = ResolutionScope.RUNTIME;
 44  
 
 45  1
     private InstanciationStrategy instantiationStrategy = InstanciationStrategy.PER_LOOKUP;
 46  
 
 47  1
     private String executionStrategy = "once-per-session";
 48  
 
 49  1
     private boolean requiresProject = true;
 50  
 
 51  1
     private boolean requiresReports = false;
 52  
 
 53  1
     private boolean aggregator = false;
 54  
 
 55  1
     private boolean requiresDirectInvocation = false;
 56  
 
 57  1
     private boolean requiresOnline = false;
 58  
 
 59  1
     private boolean inheritByDefault = true;
 60  
 
 61  
     private String configurator;
 62  
 
 63  1
     private boolean threadSafe = false;
 64  
 
 65  
     public Class<? extends Annotation> annotationType()
 66  
     {
 67  0
         return null;
 68  
     }
 69  
 
 70  
     public LifecyclePhase defaultPhase()
 71  
     {
 72  1
         return defaultPhase;
 73  
     }
 74  
 
 75  
     public void defaultPhase( String phase )
 76  
     {
 77  1
         this.defaultPhase = LifecyclePhase.valueOf( phase );
 78  1
     }
 79  
 
 80  
     public ResolutionScope requiresDependencyResolution()
 81  
     {
 82  0
         return requiresDependencyResolution;
 83  
     }
 84  
 
 85  
     public void requiresDependencyResolution( String requiresDependencyResolution )
 86  
     {
 87  0
         this.requiresDependencyResolution = ResolutionScope.valueOf( requiresDependencyResolution );
 88  0
     }
 89  
 
 90  
     public ResolutionScope requiresDependencyCollection()
 91  
     {
 92  0
         return requiresDependencyCollection;
 93  
     }
 94  
 
 95  
     public void requiresDependencyCollection( String requiresDependencyCollection )
 96  
     {
 97  0
         this.requiresDependencyCollection = ResolutionScope.valueOf( requiresDependencyCollection );
 98  0
     }
 99  
 
 100  
     public InstanciationStrategy instantiationStrategy()
 101  
     {
 102  0
         return instantiationStrategy;
 103  
     }
 104  
 
 105  
     public void instantiationStrategy( String instantiationStrategy )
 106  
     {
 107  0
         this.instantiationStrategy = InstanciationStrategy.valueOf( instantiationStrategy );
 108  0
     }
 109  
 
 110  
     public String executionStrategy()
 111  
     {
 112  0
         return executionStrategy;
 113  
     }
 114  
 
 115  
     public void executionStrategy( String executionStrategy )
 116  
     {
 117  0
         this.executionStrategy = executionStrategy;
 118  0
     }
 119  
 
 120  
     public boolean requiresProject()
 121  
     {
 122  0
         return requiresProject;
 123  
     }
 124  
 
 125  
     public void requiresProject( boolean requiresProject )
 126  
     {
 127  0
         this.requiresProject = requiresProject;
 128  0
     }
 129  
 
 130  
     public boolean requiresReports()
 131  
     {
 132  0
         return requiresReports;
 133  
     }
 134  
 
 135  
     public void requiresReports( boolean requiresReports )
 136  
     {
 137  0
         this.requiresReports = requiresReports;
 138  0
     }
 139  
 
 140  
     public boolean aggregator()
 141  
     {
 142  1
         return aggregator;
 143  
     }
 144  
 
 145  
     public void aggregator( boolean aggregator )
 146  
     {
 147  0
         this.aggregator = aggregator;
 148  0
     }
 149  
 
 150  
     public boolean requiresDirectInvocation()
 151  
     {
 152  0
         return requiresDirectInvocation;
 153  
     }
 154  
 
 155  
     public void requiresDirectInvocation( boolean requiresDirectInvocation )
 156  
     {
 157  0
         this.requiresDirectInvocation = requiresDirectInvocation;
 158  0
     }
 159  
 
 160  
     public boolean requiresOnline()
 161  
     {
 162  0
         return requiresOnline;
 163  
     }
 164  
 
 165  
     public void requiresOnline( boolean requiresOnline )
 166  
     {
 167  0
         this.requiresOnline = requiresOnline;
 168  0
     }
 169  
 
 170  
     public boolean inheritByDefault()
 171  
     {
 172  0
         return inheritByDefault;
 173  
     }
 174  
 
 175  
     public void inheritByDefault( boolean inheritByDefault )
 176  
     {
 177  0
         this.inheritByDefault = inheritByDefault;
 178  0
     }
 179  
 
 180  
     public String configurator()
 181  
     {
 182  0
         return configurator;
 183  
     }
 184  
 
 185  
     public void configurator( String configurator )
 186  
     {
 187  0
         this.configurator = configurator;
 188  0
     }
 189  
 
 190  
     public boolean threadSafe()
 191  
     {
 192  1
         return threadSafe;
 193  
     }
 194  
 
 195  
     public void threadSafe( boolean threadSafe )
 196  
     {
 197  1
         this.threadSafe = threadSafe;
 198  1
     }
 199  
 
 200  
     public String name()
 201  
     {
 202  1
         return this.name;
 203  
     }
 204  
 
 205  
     public void name( String name )
 206  
     {
 207  1
         this.name = name;
 208  1
     }
 209  
 
 210  
     @Override
 211  
     public String toString()
 212  
     {
 213  2
         final StringBuilder sb = new StringBuilder();
 214  2
         sb.append( "MojoAnnotationContent" );
 215  2
         sb.append( "{name='" ).append( name ).append( '\'' );
 216  2
         sb.append( ", defaultPhase=" ).append( defaultPhase );
 217  2
         sb.append( ", requiresDependencyResolution='" ).append( requiresDependencyResolution ).append( '\'' );
 218  2
         sb.append( ", requiresDependencyCollection='" ).append( requiresDependencyCollection ).append( '\'' );
 219  2
         sb.append( ", instantiationStrategy='" ).append( instantiationStrategy ).append( '\'' );
 220  2
         sb.append( ", executionStrategy='" ).append( executionStrategy ).append( '\'' );
 221  2
         sb.append( ", requiresProject=" ).append( requiresProject );
 222  2
         sb.append( ", requiresReports=" ).append( requiresReports );
 223  2
         sb.append( ", aggregator=" ).append( aggregator );
 224  2
         sb.append( ", requiresDirectInvocation=" ).append( requiresDirectInvocation );
 225  2
         sb.append( ", requiresOnline=" ).append( requiresOnline );
 226  2
         sb.append( ", inheritByDefault=" ).append( inheritByDefault );
 227  2
         sb.append( ", configurator='" ).append( configurator ).append( '\'' );
 228  2
         sb.append( ", threadSafe=" ).append( threadSafe );
 229  2
         sb.append( '}' );
 230  2
         return sb.toString();
 231  
     }
 232  
 }