View Javadoc

1   /*
2    * Copyright 2009 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may	obtain a copy of the License at
7    *
8    * 	http://www.osedu.org/licenses/ECL-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.student.mock.mojo;
17  
18  import org.apache.maven.plugin.MojoExecutionException;
19  import org.apache.maven.plugin.MojoFailureException;
20  import org.kuali.student.common.mojo.AbstractKSMojo;
21  import org.kuali.student.contract.model.ServiceContractModel;
22  import org.kuali.student.contract.writer.service.MockImplWriter;
23  
24  /**
25   *
26   * @author nwright
27   * 
28   *  @goal kscreatemock
29   *  @phase site
30   *  @requiresProject true
31   */
32  public class KSCreateMockImplMojo extends AbstractKSMojo {
33  
34      public KSCreateMockImplMojo() {
35      }
36   
37      
38      @Override
39  	public void execute() throws MojoExecutionException, MojoFailureException {
40          ServiceContractModel model = getModel();
41          validate(model);
42          String targetDir = "target/generated-mock-impls";
43          boolean isR1 = false;
44          MockImplWriter instance =
45                  new MockImplWriter(model,
46                  targetDir,
47                  MockImplWriter.ROOT_PACKAGE,
48                  null,
49                  isR1);
50          instance.write();
51  
52      }
53  }