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 */
19 package org.apache.maven.plugin.eclipse;
20
21 /**
22 * Represent an eclipse source dir. Eclipse has no "main", "test" or "resource" concepts, so two source dirs with the
23 * same path are equal.
24 *
25 * @author <a href="mailto:fgiust@users.sourceforge.net">Fabrizio Giustina</a>
26 * @version $Id: EclipseSourceDir.java 595476 2007-11-15 22:21:55Z aheritier $
27 */
28 public class EclipseSourceDir
29 implements Comparable
30 {
31 private String path;
32
33 private String output;
34
35 private String include;
36
37 private String exclude;
38
39 private boolean isResource;
40
41 private boolean test;
42
43 private boolean filtering;
44
45 public EclipseSourceDir( String path, String output, boolean isResource, boolean test, String include,
46 String exclude, boolean filtering )
47 {
48 this.path = path;
49 this.output = output;
50 this.isResource = isResource;
51 this.test = test;
52 this.include = include;
53 this.exclude = exclude;
54 this.filtering = filtering;
55 }
56
57 /**
58 * Getter for <code>exclude</code>.
59 *
60 * @return Returns the exclude.
61 */
62 public String getExclude()
63 {
64 return this.exclude;
65 }
66
67 /**
68 * Setter for <code>exclude</code>.
69 *
70 * @param exclude The exclude to set.
71 */
72 public void setExclude( String exclude )
73 {
74 this.exclude = exclude;
75 }
76
77 /**
78 * Getter for <code>include</code>.
79 *
80 * @return Returns the include.
81 */
82 public String getInclude()
83 {
84 return this.include;
85 }
86
87 /**
88 * Setter for <code>include</code>.
89 *
90 * @param include The include to set.
91 */
92 public void setInclude( String include )
93 {
94 this.include = include;
95 }
96
97 /**
98 * Getter for <code>output</code>.
99 *
100 * @return Returns the output.
101 */
102 public String getOutput()
103 {
104 return this.output;
105 }
106
107 /**
108 * Setter for <code>output</code>.
109 *
110 * @param output The output to set.
111 */
112 public void setOutput( String output )
113 {
114 this.output = output;
115 }
116
117 /**
118 * Getter for <code>path</code>.
119 *
120 * @return Returns the path.
121 */
122 public String getPath()
123 {
124 return this.path;
125 }
126
127 /**
128 * Setter for <code>path</code>.
129 *
130 * @param path The path to set.
131 */
132 public void setPath( String path )
133 {
134 this.path = path;
135 }
136
137 /**
138 * Getter for <code>test</code>.
139 *
140 * @return Returns the test.
141 */
142 public boolean isTest()
143 {
144 return this.test;
145 }
146
147 /**
148 * Setter for <code>test</code>.
149 *
150 * @param test The test to set.
151 */
152 public void setTest( boolean test )
153 {
154 this.test = test;
155 }
156
157 /**
158 * Getter for <code>isResource</code>.
159 *
160 * @return Returns the isResource.
161 */
162 public boolean isResource()
163 {
164 return this.isResource;
165 }
166
167 /**
168 * Wheter this resource should be copied with filtering.
169 */
170 public boolean isFiltering()
171 {
172 return filtering;
173 }
174
175 /**
176 * @see java.lang.Object#equals(java.lang.Object)
177 */
178 public boolean equals( Object obj )
179 {
180 return ( obj != null ) && ( obj instanceof EclipseSourceDir ) &&
181 this.path.equals( ( (EclipseSourceDir) obj ).path );
182 }
183
184 /**
185 * @see java.lang.Object#hashCode()
186 */
187 public int hashCode()
188 {
189 return this.path.hashCode();
190 }
191
192 /**
193 * @see java.lang.Comparable#compareTo(java.lang.Object)
194 */
195 public int compareTo( Object obj )
196 {
197 return this.path.compareTo( ( (EclipseSourceDir) obj ).path );
198 }
199 }