Coverage Report - org.apache.maven.plugin.eclipse.writers.EclipseWtpComponent15Writer
 
Classes in this File Line Coverage Branch Coverage Complexity
EclipseWtpComponent15Writer
100% 
N/A 
1
 
 1  
 /*
 2  
  * Copyright 2001-2005 The Apache Software Foundation.
 3  
  *
 4  
  * Licensed under the Apache 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.apache.org/licenses/LICENSE-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  
 
 17  
 package org.apache.maven.plugin.eclipse.writers;
 18  
 
 19  
 import org.codehaus.plexus.util.xml.XMLWriter;
 20  
 
 21  
 /**
 22  
  * Component writer for WTP 1.5. File name has changed in WTP 1.5rc2 and the <code>project-version</code> attribute has
 23  
  * been added. These ones are the only differences 
 24  
  * @author Fabrizio Giustina
 25  
  * @version $Id: EclipseWtpComponent15Writer.java 424070 2006-07-20 21:20:34Z fgiust $
 26  
  */
 27  1
 public class EclipseWtpComponent15Writer
 28  
     extends EclipseWtpComponentWriter
 29  
 {
 30  
 
 31  
     /**
 32  
      * File name where the WTP component settings will be stored for our Eclipse Project.
 33  
      * @return <code>org.eclipse.wst.common.component</code>
 34  
      */
 35  
     protected String getComponentFileName()
 36  
     {
 37  1
         return "org.eclipse.wst.common.component"; //$NON-NLS-1$
 38  
     }
 39  
 
 40  
     /**
 41  
      * Version number added to component configuration.
 42  
      * @return <code>1.0</code>
 43  
      */
 44  
     protected String getProjectVersion()
 45  
     {
 46  2
         return "1.5.0"; //$NON-NLS-1$
 47  
     }
 48  
 
 49  
     /**
 50  
      * @param writer
 51  
      */
 52  
     protected void writeContextRoot( XMLWriter writer )
 53  
     {
 54  1
         writer.startElement( ELT_PROPERTY );
 55  1
         writer.addAttribute( ATTR_NAME, ATTR_CONTEXT_ROOT );
 56  1
         writer.addAttribute( ATTR_VALUE, config.getProject().getArtifactId() );
 57  1
         writer.endElement(); // property
 58  1
     }
 59  
 
 60  
 }