Top Description Constructors Methods
org.apache.tools.ant.util.regexp

public Class RegexpMatcherFactory

extends Object
Class Inheritance
Known Direct Subclasses
org.apache.tools.ant.util.regexp.RegexpFactory
Imports
org.apache.tools.ant.BuildException, .MagicNames, .Project, org.apache.tools.ant.util.ClasspathUtils

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

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

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected RegexpMatcher

Returns:

a RegexpMatcher value
createInstance
(String
a String value
className
)

Create an instance of a matcher from a classname.

public RegexpMatcher

Returns:

the matcher
newRegexpMatcher
()

Create a new regular expression instance.

public RegexpMatcher

Returns:

the matcher
newRegexpMatcher
(Project
Project whose ant.regexp.regexpimpl property will be used.
p
)

Create a new regular expression instance.

public static boolean

Returns:

true if available otherwise false
regexpMatcherPresent
(Project
The project to check for (may be null)
project
)

Checks if a RegExp-Matcher is available.

protected void
testAvailability(String
a String value
className
)

Test if a particular class is available to be used.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

RegexpMatcherFactoryback to summary
public RegexpMatcherFactory()

Method Detail

createInstanceback to summary
protected RegexpMatcher createInstance(String className) throws BuildException

Create an instance of a matcher from a classname.

Parameters
className:String

a String value

Returns:RegexpMatcher

a RegexpMatcher value

Exceptions
BuildException:
if an error occurs
newRegexpMatcherback to summary
public RegexpMatcher newRegexpMatcher() throws BuildException

Create a new regular expression instance.

Returns:RegexpMatcher

the matcher

Exceptions
BuildException:
on error
newRegexpMatcherback to summary
public RegexpMatcher newRegexpMatcher(Project p) throws BuildException

Create a new regular expression instance.

Parameters
p:Project

Project whose ant.regexp.regexpimpl property will be used.

Returns:RegexpMatcher

the matcher

Exceptions
BuildException:
on error
regexpMatcherPresentback to summary
public static boolean regexpMatcherPresent(Project project)

Checks if a RegExp-Matcher is available.

Parameters
project:Project

The project to check for (may be null)

Returns:boolean

true if available otherwise false

testAvailabilityback to summary
protected void testAvailability(String className) throws BuildException

Test if a particular class is available to be used.

Parameters
className:String

a String value

Exceptions
BuildException:
if an error occurs