View Javadoc

1   /*
2    =================== DO NOT EDIT THIS FILE ====================
3    Generated by Modello 1.4.1 on 2011-05-02 01:00:32,
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$ $Date$
14   */
15  @SuppressWarnings( "all" )
16  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          if ( this == other )
48          {
49              return true;
50          }
51  
52          if ( !( other instanceof Tag ) )
53          {
54              return false;
55          }
56  
57          Tag that = (Tag) other;
58          boolean result = true;
59  
60          result = result && ( getName() == null ? that.getName() == null : getName().equals( that.getName() ) );
61          result = result && ( getHead() == null ? that.getHead() == null : getHead().equals( that.getHead() ) );
62  
63          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          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          return this.name;
84      } //-- String getName()
85  
86      /**
87       * Method hashCode.
88       * 
89       * @return int
90       */
91      public int hashCode()
92      {
93          int result = 17;
94  
95          result = 37 * result + ( name != null ? name.hashCode() : 0 );
96          result = 37 * result + ( head != null ? head.hashCode() : 0 );
97  
98          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         this.head = head;
109     } //-- void setHead( String )
110 
111     /**
112      * Set name of the tag.
113      * 
114      * @param name
115      */
116     public void setName( String name )
117     {
118         this.name = name;
119     } //-- void setName( String )
120 
121     /**
122      * Method toString.
123      * 
124      * @return String
125      */
126     public java.lang.String toString()
127     {
128         StringBuilder buf = new StringBuilder( 128 );
129 
130         buf.append( "name = '" );
131         buf.append( getName() );
132         buf.append( "'" );
133         buf.append( "\n" ); 
134         buf.append( "head = '" );
135         buf.append( getHead() );
136         buf.append( "'" );
137 
138         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         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         char[] chars = placement.toCharArray();
175         for ( int i = 0; i < chars.length; i++ )
176         {
177             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                     break;
188                 default:
189                     throw new IllegalArgumentException( "Placement should be a combinaison of the letters 'Xaoptcmf'." );
190             }
191         }
192         this.placement = placement;
193     }
194 
195           
196 }