From ccbf334323310be02f2ba65aa0450a799361a0da Mon Sep 17 00:00:00 2001 From: Peter Donald Date: Thu, 14 Feb 2002 10:34:25 +0000 Subject: [PATCH] Add an abstract task that will eventually take over the role of the original Matching task git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271332 13f79535-47bb-0310-9956-ffa450edef68 --- .../framework/AbstractMatchingTask.java | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 proposal/myrmidon/src/java/org/apache/myrmidon/framework/AbstractMatchingTask.java diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/framework/AbstractMatchingTask.java b/proposal/myrmidon/src/java/org/apache/myrmidon/framework/AbstractMatchingTask.java new file mode 100644 index 000000000..79d7118a0 --- /dev/null +++ b/proposal/myrmidon/src/java/org/apache/myrmidon/framework/AbstractMatchingTask.java @@ -0,0 +1,64 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.framework; + +import org.apache.myrmidon.api.AbstractTask; +import org.apache.tools.ant.types.FileSet; + +/** + * An abstract base class for tasks that wish to operate on + * a set of files. This class is based on the ant1.x MatchingTask and + * should fullfill similar requirements. + * + * @author Peter Donald + * @version $Revision$ $Date$ + */ +public abstract class AbstractMatchingTask + extends AbstractTask +{ + private FileSet m_fileset = new FileSet(); + + /** + * The attribute that contains a list of itesm to be included. + */ + public void setIncludes( final String includes ) + { + m_fileset.setIncludes( includes ); + } + + /** + * The attribute that contains a list of items to be excluded. + */ + public void setExcludes( final String excludes ) + { + m_fileset.setExcludes( excludes ); + } + + /** + * Set this to true to use the defaul exclude patterns. + */ + public void setDefaultexcludes( final boolean useDefaultExcludes ) + { + m_fileset.setDefaultExcludes( useDefaultExcludes ); + } + + public void addInclude( final Pattern pattern ) + { + m_fileset.addInclude( pattern ); + } + + public void addExclude( final Pattern pattern ) + { + m_fileset.addExclude( pattern ); + } + + public void addPatternSet( final PatternSet set ) + { + m_fileset.addPatternSet( set ); + } +}