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