org.apache.tools.ant.util.regexp

Class RegexpMatcherFactory

public class RegexpMatcherFactory extends Object

Simple Factory Class that produces an implementation of RegexpMatcher based on the system property ant.regexp.matcherimpl and the classes available.

In a more general framework this class would be abstract and have a static newInstance method.

Constructor Summary
RegexpMatcherFactory()
Constructor for RegexpMatcherFactory.
Method Summary
protected RegexpMatchercreateInstance(String className)
Create an instance of a matcher from a classname.
RegexpMatchernewRegexpMatcher()
Create a new regular expression instance.
RegexpMatchernewRegexpMatcher(Project p)
Create a new regular expression instance.
protected voidtestAvailability(String className)
Test if a particular class is available to be used.

Constructor Detail

RegexpMatcherFactory

public RegexpMatcherFactory()
Constructor for RegexpMatcherFactory.

Method Detail

createInstance

protected RegexpMatcher createInstance(String className)
Create an instance of a matcher from a classname.

Parameters: className a String value

Returns: a RegexpMatcher value

Throws: BuildException if an error occurs

newRegexpMatcher

public RegexpMatcher newRegexpMatcher()
Create a new regular expression instance.

Returns: the matcher

Throws: BuildException on error

newRegexpMatcher

public RegexpMatcher newRegexpMatcher(Project p)
Create a new regular expression instance.

Parameters: p Project whose ant.regexp.regexpimpl property will be used.

Returns: the matcher

Throws: BuildException on error

testAvailability

protected void testAvailability(String className)
Test if a particular class is available to be used.

Parameters: className a String value

Throws: BuildException if an error occurs

Copyright