View Javadoc
1   /*
2    Licensed to the Apache Software Foundation (ASF) under one
3    or more contributor license agreements.  See the NOTICE file
4    distributed with this work for additional information
5    regarding copyright ownership.  The ASF licenses this file
6    to you under the Apache License, Version 2.0 (the
7    "License"); you may not use this file except in compliance
8    with the License.  You may obtain a copy of the License at
9    
10       http://www.apache.org/licenses/LICENSE-2.0
11   
12   Unless required by applicable law or agreed to in writing,
13   software distributed under the License is distributed on an
14   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   KIND, either express or implied.  See the License for the
16   specific language governing permissions and limitations
17   under the License.
18   =================== DO NOT EDIT THIS FILE ====================
19   Generated by Modello 2.5.1,
20   any modifications will be overwritten.
21   ==============================================================
22   */
23  
24  package org.apache.maven.plugins.javadoc.options;
25  
26  /**
27   * A Tag parameter.
28   * 
29   * @version $Revision$ $Date$
30   */
31  @SuppressWarnings( "all" )
32  public class Tag
33      implements java.io.Serializable
34  {
35  
36        //--------------------------/
37       //- Class/Member Variables -/
38      //--------------------------/
39  
40      /**
41       * Name of the tag.
42       */
43      private String name;
44  
45      /**
46       * Head of the tag.
47       */
48      private String head;
49  
50      /**
51       * Placement of the tag.
52       */
53      private String placement;
54  
55  
56        //-----------/
57       //- Methods -/
58      //-----------/
59  
60      /**
61       * Method equals.
62       * 
63       * @param other a other object.
64       * @return boolean
65       */
66      public boolean equals( Object other )
67      {
68          if ( this == other )
69          {
70              return true;
71          }
72  
73          if ( !( other instanceof Tag ) )
74          {
75              return false;
76          }
77  
78          Tag that = (Tag) other;
79          boolean result = true;
80  
81          result = result && ( getName() == null ? that.getName() == null : getName().equals( that.getName() ) );
82          result = result && ( getHead() == null ? that.getHead() == null : getHead().equals( that.getHead() ) );
83          result = result && ( getPlacement() == null ? that.getPlacement() == null : getPlacement().equals( that.getPlacement() ) );
84  
85          return result;
86      } //-- boolean equals( Object )
87  
88      /**
89       * Get head of the tag.
90       * 
91       * @return String
92       */
93      public String getHead()
94      {
95          return this.head;
96      } //-- String getHead()
97  
98      /**
99       * Get name of the tag.
100      * 
101      * @return String
102      */
103     public String getName()
104     {
105         return this.name;
106     } //-- String getName()
107 
108     /**
109      * Get placement of the tag.
110      * 
111      * @return String
112      */
113     public String getPlacement()
114     {
115         return this.placement;
116     } //-- String getPlacement()
117 
118     /**
119      * Method hashCode.
120      * 
121      * @return int
122      */
123     public int hashCode()
124     {
125         int result = 17;
126 
127         result = 37 * result + ( name != null ? name.hashCode() : 0 );
128         result = 37 * result + ( head != null ? head.hashCode() : 0 );
129         result = 37 * result + ( placement != null ? placement.hashCode() : 0 );
130 
131         return result;
132     } //-- int hashCode()
133 
134     /**
135      * Set head of the tag.
136      * 
137      * @param head a head object.
138      */
139     public void setHead( String head )
140     {
141         this.head = head;
142     } //-- void setHead( String )
143 
144     /**
145      * Set name of the tag.
146      * 
147      * @param name a name object.
148      */
149     public void setName( String name )
150     {
151         this.name = name;
152     } //-- void setName( String )
153 
154     /**
155      * Method toString.
156      * 
157      * @return String
158      */
159     public java.lang.String toString()
160     {
161         StringBuilder buf = new StringBuilder( 128 );
162 
163         buf.append( "name = '" );
164         buf.append( getName() );
165         buf.append( "'" );
166         buf.append( "\n" ); 
167         buf.append( "head = '" );
168         buf.append( getHead() );
169         buf.append( "'" );
170         buf.append( "\n" ); 
171         buf.append( "placement = '" );
172         buf.append( getPlacement() );
173         buf.append( "'" );
174 
175         return buf.toString();
176     } //-- java.lang.String toString()
177 
178     
179     /**
180      * Set a Placement. Should be a combinaison of the letters:
181      * <ul>
182      * <li> X (disable tag)</li>
183      * <li> a (all)</li>
184      * <li> o (overview)</li>
185      * <li> p (packages)</li>
186      * <li> t (types, that is classes and interfaces)</li>
187      * <li> c (constructors)</li>
188      * <li> m (methods)</li>
189      * <li> f (fields)</li>
190      * </ul>
191      *
192      * @param placement
193      * @throws IllegalArgumentException  if not a valid combinaison of the letters
194      */
195     public void setPlacement(String placement)
196       throws IllegalArgumentException
197     {
198         char[] chars = placement.toCharArray();
199         for ( int i = 0; i < chars.length; i++ )
200         {
201             switch ( chars[i] )
202             {
203                 case 'X':
204                 case 'a':
205                 case 'o':
206                 case 'p':
207                 case 't':
208                 case 'c':
209                 case 'm':
210                 case 'f':
211                     break;
212                 default:
213                     throw new IllegalArgumentException( "Placement should be a combination of the letters 'Xaoptcmf'." );
214             }
215         }
216         this.placement = placement;
217     }
218 
219           
220 }