View Javadoc

1   /*
2    =================== DO NOT EDIT THIS FILE ====================
3    Generated by Modello 1.0.1 on 2009-09-09 03:30:24,
4    any modifications will be overwritten.
5    ==============================================================
6    */
7   
8   package org.apache.maven.model;
9   
10  /**
11   * Definition of include or exclude patterns.
12   * 
13   * @version $Revision$ $Date$
14   */
15  public class PatternSet
16      implements java.io.Serializable
17  {
18  
19        //--------------------------/
20       //- Class/Member Variables -/
21      //--------------------------/
22  
23      /**
24       * Field includes.
25       */
26      private java.util.List<String> includes;
27  
28      /**
29       * Field excludes.
30       */
31      private java.util.List<String> excludes;
32  
33  
34        //-----------/
35       //- Methods -/
36      //-----------/
37  
38      /**
39       * Method addExclude.
40       * 
41       * @param string
42       */
43      public void addExclude( String string )
44      {
45          if ( !(string instanceof String) )
46          {
47              throw new ClassCastException( "PatternSet.addExcludes(string) parameter must be instanceof " + String.class.getName() );
48          }
49          getExcludes().add( string );
50      } //-- void addExclude( String )
51  
52      /**
53       * Method addInclude.
54       * 
55       * @param string
56       */
57      public void addInclude( String string )
58      {
59          if ( !(string instanceof String) )
60          {
61              throw new ClassCastException( "PatternSet.addIncludes(string) parameter must be instanceof " + String.class.getName() );
62          }
63          getIncludes().add( string );
64      } //-- void addInclude( String )
65  
66      /**
67       * Method getExcludes.
68       * 
69       * @return List
70       */
71      public java.util.List<String> getExcludes()
72      {
73          if ( this.excludes == null )
74          {
75              this.excludes = new java.util.ArrayList<String>();
76          }
77  
78          return this.excludes;
79      } //-- java.util.List<String> getExcludes()
80  
81      /**
82       * Method getIncludes.
83       * 
84       * @return List
85       */
86      public java.util.List<String> getIncludes()
87      {
88          if ( this.includes == null )
89          {
90              this.includes = new java.util.ArrayList<String>();
91          }
92  
93          return this.includes;
94      } //-- java.util.List<String> getIncludes()
95  
96      /**
97       * Method removeExclude.
98       * 
99       * @param string
100      */
101     public void removeExclude( String string )
102     {
103         if ( !(string instanceof String) )
104         {
105             throw new ClassCastException( "PatternSet.removeExcludes(string) parameter must be instanceof " + String.class.getName() );
106         }
107         getExcludes().remove( string );
108     } //-- void removeExclude( String )
109 
110     /**
111      * Method removeInclude.
112      * 
113      * @param string
114      */
115     public void removeInclude( String string )
116     {
117         if ( !(string instanceof String) )
118         {
119             throw new ClassCastException( "PatternSet.removeIncludes(string) parameter must be instanceof " + String.class.getName() );
120         }
121         getIncludes().remove( string );
122     } //-- void removeInclude( String )
123 
124     /**
125      * Set a list of patterns to exclude, e.g.
126      * <code>**&#47;*.xml</code>
127      * 
128      * @param excludes
129      */
130     public void setExcludes( java.util.List<String> excludes )
131     {
132         this.excludes = excludes;
133     } //-- void setExcludes( java.util.List )
134 
135     /**
136      * Set a list of patterns to include, e.g.
137      * <code>**&#47;*.xml</code>.
138      * 
139      * @param includes
140      */
141     public void setIncludes( java.util.List<String> includes )
142     {
143         this.includes = includes;
144     } //-- void setIncludes( java.util.List )
145 
146 
147             
148     /**
149      * @see java.lang.Object#toString()
150      */
151     public String toString()
152     {
153         StringBuffer sb = new StringBuffer();
154 
155         sb.append("PatternSet [includes: {");
156         for (java.util.Iterator i = getIncludes().iterator(); i.hasNext(); )
157         {
158             String str = (String) i.next();
159             sb.append(str).append(", ");
160         }
161         if (sb.substring(sb.length() - 2).equals(", ")) sb.delete(sb.length() - 2, sb.length());
162 
163         sb.append("}, excludes: {");
164         for (java.util.Iterator i = getExcludes().iterator(); i.hasNext(); )
165         {
166             String str = (String) i.next();
167             sb.append(str).append(", ");
168         }
169         if (sb.substring(sb.length() - 2).equals(", ")) sb.delete(sb.length() - 2, sb.length());
170 
171         sb.append("}]");
172         return sb.toString();
173     }
174             
175           
176 }