View Javadoc
1   /*
2    * (C) Copyright 2006-2014 Nuxeo SA (http://nuxeo.com/) and contributors.
3    *
4    * All rights reserved. This program and the accompanying materials
5    * are made available under the terms of the GNU Lesser General Public License
6    * (LGPL) version 2.1 which accompanies this distribution, and is available at
7    * http://www.gnu.org/licenses/lgpl-2.1.html
8    *
9    * This library is distributed in the hope that it will be useful,
10   * but WITHOUT ANY WARRANTY; without even the implied warranty of
11   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12   * Lesser General Public License for more details.
13   *
14   * Contributors:
15   *     bstefanescu
16   */
17  package org.nuxeo.build.ant.artifact;
18  
19  import org.apache.tools.ant.types.DataType;
20  import org.nuxeo.build.maven.filter.AndFilter;
21  import org.nuxeo.build.maven.filter.NotFilter;
22  
23  /**
24   * TODO NXBT-258
25   */
26  public class FiltersCollection extends DataType {
27  
28      public AndFilter filter;
29  
30      public void addExcludes(Excludes excludes) {
31          if (filter == null) {
32              filter = new AndFilter();
33          }
34          filter.addFilter(new NotFilter(excludes.getFilter()));
35      }
36  
37      public void addIncludes(Includes includes) {
38          if (filter == null) {
39              filter = new AndFilter();
40          }
41          filter.addFilter(includes.getFilter());
42      }
43  
44  }