KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > vladium > emma > ant > FilterTask


1 /* Copyright (C) 2003 Vladimir Roubtsov. All rights reserved.
2  *
3  * This program and the accompanying materials are made available under
4  * the terms of the Common Public License v1.0 which accompanies this distribution,
5  * and is available at http://www.eclipse.org/legal/cpl-v10.html
6  *
7  * $Id: FilterTask.java,v 1.1.1.1.2.1 2004/07/08 10:52:10 vlad_r Exp $
8  */

9 package com.vladium.emma.ant;
10
11 import java.io.File JavaDoc;
12
13 import com.vladium.util.Strings;
14 import com.vladium.emma.instr.FilterCfg;
15 import com.vladium.emma.instr.FilterCfg.filterElement;
16
17 import org.apache.tools.ant.BuildException;
18
19 // ----------------------------------------------------------------------------
20
/**
21  * @author Vlad Roubtsov, (C) 2003
22  */

23 public
24 abstract class FilterTask extends NestedTask
25 {
26     // public: ................................................................
27

28
29     public void init () throws BuildException
30     {
31         super.init ();
32         
33         m_filterCfg = new FilterCfg (this);
34     }
35
36     
37     // filter attribute/element:
38

39     public final void setFilter (final String JavaDoc filter)
40     {
41         m_filterCfg.setFilter (filter);
42     }
43     
44     public final filterElement createFilter ()
45     {
46         return m_filterCfg.createFilter ();
47     }
48     
49     // protected: .............................................................
50

51     
52     protected FilterTask (final SuppressableTask parent)
53     {
54         super (parent);
55     }
56     
57     
58     protected final String JavaDoc [] getFilterSpecs ()
59     {
60         return m_filterCfg.getFilterSpecs ();
61     }
62         
63
64     protected static final String JavaDoc COMMA = ",";
65     protected static final String JavaDoc COMMA_DELIMITERS = COMMA + Strings.WHITE_SPACE;
66     protected static final String JavaDoc PATH_DELIMITERS = COMMA.concat (File.pathSeparator);
67     
68     // package: ...............................................................
69

70     // private: ...............................................................
71

72
73     private /*final*/ FilterCfg m_filterCfg;
74
75 } // end of class
76
// ----------------------------------------------------------------------------
Popular Tags