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