View Javadoc

1   /*
2    * Copyright 2007-2013 smartics, Kronseder & Reiner GmbH
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package de.smartics.exceptions.report.scan;
17  
18  import java.io.File;
19  
20  import org.apache.tools.ant.DirectoryScanner;
21  
22  /**
23   * Creates directory scanners.
24   */
25  public final class DirectoryScannerFactory extends AbstractScannerFactory
26  {
27    // ********************************* Fields *********************************
28  
29    // --- constants ------------------------------------------------------------
30  
31    // --- members --------------------------------------------------------------
32  
33    // ****************************** Initializer *******************************
34  
35    // ****************************** Constructors ******************************
36  
37    /**
38     * Constructor.
39     *
40     * @param includes the includes for the scanner.
41     * @param excludes the excludes for the scanner.
42     * @see de.smartics.exceptions.report.scan.analysis.javadoc.scan.layout.AbstractScannerFactory#AbstractScannerFactory(String[],
43     *      String[])
44     */
45    public DirectoryScannerFactory(final String[] includes,
46        final String[] excludes)
47    {
48      super(includes, excludes);
49    }
50  
51    // ****************************** Inner Classes *****************************
52  
53    // ********************************* Methods ********************************
54  
55    // --- init -----------------------------------------------------------------
56  
57    // --- get&set --------------------------------------------------------------
58  
59    // --- business -------------------------------------------------------------
60  
61    @Override
62    public DirectoryScanner createScanner(final File root)
63    {
64      final DirectoryScanner scanner = new DirectoryScanner();
65      scanner.setBasedir(root);
66      configureAndScan(scanner);
67      return scanner;
68    }
69    // --- object basics --------------------------------------------------------
70  
71  }