Coverage Report - org.apache.maven.plugin.javadoc.options.Tag
 
Classes in this File Line Coverage Branch Coverage Complexity
Tag
38 %
14/37
5 %
3/56
2,556
 
 1  
 /*
 2  
  =================== DO NOT EDIT THIS FILE ====================
 3  
  Generated by Modello 1.1 on 2009-10-23 09:16:44,
 4  
  any modifications will be overwritten.
 5  
  ==============================================================
 6  
  */
 7  
 
 8  
 package org.apache.maven.plugin.javadoc.options;
 9  
 
 10  
 /**
 11  
  * A Tag parameter.
 12  
  * 
 13  
  * @version $Revision: 829394 $ $Date: 2012-08-19 17:31:42 +0000 (Sun, 19 Aug 2012) $
 14  
  */
 15  6
 public class Tag
 16  
     implements java.io.Serializable
 17  
 {
 18  
 
 19  
       //--------------------------/
 20  
      //- Class/Member Variables -/
 21  
     //--------------------------/
 22  
 
 23  
     /**
 24  
      * Name of the tag.
 25  
      */
 26  
     private String name;
 27  
 
 28  
     /**
 29  
      * Head of the tag.
 30  
      */
 31  
     private String head;
 32  
 
 33  
 
 34  
       //-----------/
 35  
      //- Methods -/
 36  
     //-----------/
 37  
 
 38  
     /**
 39  
      * Method equals.
 40  
      * 
 41  
      * @param other
 42  
      * @return boolean
 43  
      */
 44  
     public boolean equals( Object other )
 45  
     {
 46  0
         if ( this == other )
 47  
         {
 48  0
             return true;
 49  
         }
 50  
 
 51  0
         if ( !( other instanceof Tag ) )
 52  
         {
 53  0
             return false;
 54  
         }
 55  
 
 56  0
         Tag that = (Tag) other;
 57  0
         boolean result = true;
 58  
 
 59  0
         result = result && ( getName() == null ? that.getName() == null : getName().equals( that.getName() ) );
 60  0
         result = result && ( getHead() == null ? that.getHead() == null : getHead().equals( that.getHead() ) );
 61  
 
 62  0
         return result;
 63  
     } //-- boolean equals( Object )
 64  
 
 65  
     /**
 66  
      * Get head of the tag.
 67  
      * 
 68  
      * @return String
 69  
      */
 70  
     public String getHead()
 71  
     {
 72  10
         return this.head;
 73  
     } //-- String getHead()
 74  
 
 75  
     /**
 76  
      * Get name of the tag.
 77  
      * 
 78  
      * @return String
 79  
      */
 80  
     public String getName()
 81  
     {
 82  12
         return this.name;
 83  
     } //-- String getName()
 84  
 
 85  
     /**
 86  
      * Method hashCode.
 87  
      * 
 88  
      * @return int
 89  
      */
 90  
     public int hashCode()
 91  
     {
 92  0
         int result = 17;
 93  
 
 94  0
         result = 37 * result + ( name != null ? name.hashCode() : 0 );
 95  0
         result = 37 * result + ( head != null ? head.hashCode() : 0 );
 96  
 
 97  0
         return result;
 98  
     } //-- int hashCode()
 99  
 
 100  
     /**
 101  
      * Set head of the tag.
 102  
      * 
 103  
      * @param head
 104  
      */
 105  
     public void setHead( String head )
 106  
     {
 107  5
         this.head = head;
 108  5
     } //-- void setHead( String )
 109  
 
 110  
     /**
 111  
      * Set name of the tag.
 112  
      * 
 113  
      * @param name
 114  
      */
 115  
     public void setName( String name )
 116  
     {
 117  6
         this.name = name;
 118  6
     } //-- void setName( String )
 119  
 
 120  
     /**
 121  
      * Method toString.
 122  
      * 
 123  
      * @return String
 124  
      */
 125  
     public java.lang.String toString()
 126  
     {
 127  0
         StringBuffer buf = new StringBuffer( 128 );
 128  
 
 129  0
         buf.append( "name = '" );
 130  0
         buf.append( getName() );
 131  0
         buf.append( "'" );
 132  0
         buf.append( "\n" ); 
 133  0
         buf.append( "head = '" );
 134  0
         buf.append( getHead() );
 135  0
         buf.append( "'" );
 136  
 
 137  0
         return buf.toString();
 138  
     } //-- java.lang.String toString()
 139  
 
 140  
     
 141  
     /**
 142  
      * Field placement
 143  
      */
 144  
     private String placement;
 145  
 
 146  
     /**
 147  
      * Get the placement.
 148  
      */
 149  
     public String getPlacement()
 150  
     {
 151  11
         return this.placement;
 152  
     }
 153  
 
 154  
     /**
 155  
      * Set a Placement. Should be a combinaison of the letters:
 156  
      * <ul>
 157  
      * <li> X (disable tag)</li>
 158  
      * <li> a (all)</li>
 159  
      * <li> o (overview)</li>
 160  
      * <li> p (packages)</li>
 161  
      * <li> t (types, that is classes and interfaces)</li>
 162  
      * <li> c (constructors)</li>
 163  
      * <li> m (methods)</li>
 164  
      * <li> f (fields)</li>
 165  
      * </ul>
 166  
      *
 167  
      * @param placement
 168  
      * @throws IllegalArgumentException  if not a valid combinaison of the letters
 169  
      */
 170  
     public void setPlacement(String placement)
 171  
       throws IllegalArgumentException
 172  
     {
 173  5
         char[] chars = placement.toCharArray();
 174  10
         for ( int i = 0; i < chars.length; i++ )
 175  
         {
 176  5
             switch ( chars[i] )
 177  
             {
 178  
                 case 'X':
 179  
                 case 'a':
 180  
                 case 'o':
 181  
                 case 'p':
 182  
                 case 't':
 183  
                 case 'c':
 184  
                 case 'm':
 185  
                 case 'f':
 186  5
                     break;
 187  
                 default:
 188  0
                     throw new IllegalArgumentException( "Placement should be a combinaison of the letters 'Xaoptcmf'." );
 189  
             }
 190  
         }
 191  5
         this.placement = placement;
 192  5
     }
 193  
 
 194  
           
 195  
 }