Coverage Report - org.apache.tiles.autotag.plugin.GenerateFreemarkerMojo
 
Classes in this File Line Coverage Branch Coverage Complexity
GenerateFreemarkerMojo
75%
3/4
N/A
1
 
 1  
 /*
 2  
  * $Id: GenerateFreemarkerMojo.java 1643653 2014-12-07 06:47:59Z nlebas $
 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  
 package org.apache.tiles.autotag.plugin;
 22  
 
 23  
 import java.util.Map;
 24  
 
 25  
 import org.apache.maven.plugins.annotations.LifecyclePhase;
 26  
 import org.apache.maven.plugins.annotations.Mojo;
 27  
 import org.apache.maven.plugins.annotations.Parameter;
 28  
 import org.apache.maven.plugins.annotations.ResolutionScope;
 29  
 import org.apache.tiles.autotag.freemarker.FMTemplateGeneratorFactory;
 30  
 import org.apache.tiles.autotag.generate.TemplateGeneratorBuilder;
 31  
 import org.apache.tiles.autotag.generate.TemplateGeneratorFactory;
 32  
 import org.apache.velocity.app.VelocityEngine;
 33  
 
 34  
 /**
 35  
  * Generates Freemarker code.
 36  
  */
 37  
 @Mojo(
 38  
         name = "generate-freemarker", 
 39  
         defaultPhase = LifecyclePhase.GENERATE_SOURCES,
 40  
         requiresDependencyResolution = ResolutionScope.COMPILE)
 41  2
 public class GenerateFreemarkerMojo extends AbstractGenerateMojo {
 42  
 
 43  
     /**
 44  
      * Name of the Runtime.
 45  
      */
 46  
         @Parameter(defaultValue = "org.apache.tiles.autotag.freemarker.runtime.Runtime", required = true)
 47  
     String freemarkerRuntime;
 48  
 
 49  
     /** {@inheritDoc} */
 50  
     @Override
 51  
     protected Map<String, String> getParameters() {
 52  1
         return null;
 53  
     }
 54  
 
 55  
     /** {@inheritDoc} */
 56  
     @Override
 57  
     protected String getRuntimeClass() {
 58  0
         return freemarkerRuntime;
 59  
     }
 60  
 
 61  
     @Override
 62  
     protected TemplateGeneratorFactory createTemplateGeneratorFactory(
 63  
             VelocityEngine velocityEngine) {
 64  1
         return new FMTemplateGeneratorFactory(classesOutputLocator,
 65  
                 velocityEngine, TemplateGeneratorBuilder.createNewInstance());
 66  
     }
 67  
 }