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.buildcache.xml.config;
25
26 /**
27 * <p>A file or a directory path to exclude from the checksum
28 * computation. Relative path are relative to each module
29 * basedir.</p>
30 * When referring to a directory, additional properties
31 * help adjust the scope of the exclusion:
32 * <ul>
33 * <li>glob - only entries matching this <a
34 * href="https://docs.oracle.com/javase/tutorial/essential/io/fileOps.html#glob">glob
35 * pattern</a> are excluded</li>
36 * <li>entryType - type of entries excluded from
37 * the scan</li>
38 * <li>matcherType - entry property on which the
39 * glob matching is applied</li>
40 * </ul>
41 * <p>By default, targeting a directory excludes
42 * everything underneath it.</p>
43 * Examples :
44 * <ul>
45 *
46 * <li><code><exclude>src/main/doc</exclude></code> :
47 * excludes everything under : ${project.basedir}/src/main/doc</li>
48 *
49 * <li><code><exclude>src/main/java/package-info.java</exclude></code>
50 * : excludes this file :
51 * ${project.basedir}/src/main/java/package-info.java</li>
52 * <li><code><exclude
53 * glob="package-info.java"></exclude></code> : excludes
54 * all the files named package-info.java</li>
55 * <li><code><exclude
56 * glob="src/main/resources/**.txt" entryType="FILE"
57 * matcherType="PATH" ></exclude></code> : excludes all
58 * the text files located under the "resources" folder</li>
59 * </ul>
60 * <p>
61 * Exclude elements can also be added per project with
62 * the use of <a
63 * href="parameters.html#project-level-properties">maven
64 * properties.</a>
65 * </p>
66 *
67 *
68 * @version $Revision$ $Date$
69 */
70 @SuppressWarnings( "all" )
71 public class Exclude
72 implements java.io.Serializable
73 {
74
75 //--------------------------/
76 //- Class/Member Variables -/
77 //--------------------------/
78
79 /**
80 * An absolute or relative path to a filename or a directory.
81 * In the later case, the exclusion is applied starting from
82 * this directory (can be beneficial in term of performances).
83 * If empty, the glob is applied on every file listed as a
84 * potential part of the checksum.
85 */
86 private String value;
87
88 /**
89 * Entries are filtered by matching this glob (see matcherType
90 * property).
91 */
92 private String glob = "**";
93
94 /**
95 * Type of entries filtered. One of FILE, DIRECTORY, ALL.
96 * Excluding a directory excludes its subfiles and
97 * subdirectories.
98 */
99 private String entryType = "ALL";
100
101 /**
102 * The entry property matched for exclusion. One of FILENAME,
103 * PATH. For a path, if the exclusion value is empty or a
104 * relative path, matching is done relatively to the project
105 * folder.
106 */
107 private String matcherType = "FILENAME";
108
109
110 //-----------/
111 //- Methods -/
112 //-----------/
113
114 /**
115 * Get type of entries filtered. One of FILE, DIRECTORY, ALL.
116 * Excluding a directory excludes its subfiles and
117 * subdirectories.
118 *
119 * @return String
120 */
121 public String getEntryType()
122 {
123 return this.entryType;
124 } //-- String getEntryType()
125
126 /**
127 * Get entries are filtered by matching this glob (see
128 * matcherType property).
129 *
130 * @return String
131 */
132 public String getGlob()
133 {
134 return this.glob;
135 } //-- String getGlob()
136
137 /**
138 * Get the entry property matched for exclusion. One of
139 * FILENAME, PATH. For a path, if the exclusion value is empty
140 * or a relative path, matching is done relatively to the
141 * project folder.
142 *
143 * @return String
144 */
145 public String getMatcherType()
146 {
147 return this.matcherType;
148 } //-- String getMatcherType()
149
150 /**
151 * Get an absolute or relative path to a filename or a
152 * directory. In the later case, the exclusion is applied
153 * starting from this directory (can be beneficial in term of
154 * performances). If empty, the glob is applied on every file
155 * listed as a potential part of the checksum.
156 *
157 * @return String
158 */
159 public String getValue()
160 {
161 return this.value;
162 } //-- String getValue()
163
164 /**
165 * Set type of entries filtered. One of FILE, DIRECTORY, ALL.
166 * Excluding a directory excludes its subfiles and
167 * subdirectories.
168 *
169 * @param entryType a entryType object.
170 */
171 public void setEntryType( String entryType )
172 {
173 this.entryType = entryType;
174 } //-- void setEntryType( String )
175
176 /**
177 * Set entries are filtered by matching this glob (see
178 * matcherType property).
179 *
180 * @param glob a glob object.
181 */
182 public void setGlob( String glob )
183 {
184 this.glob = glob;
185 } //-- void setGlob( String )
186
187 /**
188 * Set the entry property matched for exclusion. One of
189 * FILENAME, PATH. For a path, if the exclusion value is empty
190 * or a relative path, matching is done relatively to the
191 * project folder.
192 *
193 * @param matcherType a matcherType object.
194 */
195 public void setMatcherType( String matcherType )
196 {
197 this.matcherType = matcherType;
198 } //-- void setMatcherType( String )
199
200 /**
201 * Set an absolute or relative path to a filename or a
202 * directory. In the later case, the exclusion is applied
203 * starting from this directory (can be beneficial in term of
204 * performances). If empty, the glob is applied on every file
205 * listed as a potential part of the checksum.
206 *
207 * @param value a value object.
208 */
209 public void setValue( String value )
210 {
211 this.value = value;
212 } //-- void setValue( String )
213
214 }