Package org.apache.tools.ant.util.regexp
Class RegexpMatcherFactory
java.lang.Object
org.apache.tools.ant.util.regexp.RegexpMatcherFactory
- Direct Known Subclasses:
RegexpFactory
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
-
Method Summary
Modifier and TypeMethodDescriptionprotected RegexpMatcher
createInstance
(String className) Create an instance of a matcher from a classname.Create a new regular expression instance.Create a new regular expression instance.static boolean
regexpMatcherPresent
(Project project) Checks if a RegExp-Matcher is available.protected void
testAvailability
(String className) Test if a particular class is available to be used.
-
Constructor Details
-
RegexpMatcherFactory
public RegexpMatcherFactory()
-
-
Method Details
-
newRegexpMatcher
Create a new regular expression instance.- Returns:
- the matcher
- Throws:
BuildException
- on error
-
newRegexpMatcher
Create a new regular expression instance.- Parameters:
p
- Project whose ant.regexp.regexpimpl property will be used.- Returns:
- the matcher
- Throws:
BuildException
- on error
-
createInstance
Create an instance of a matcher from a classname.- Parameters:
className
- aString
value- Returns:
- a
RegexpMatcher
value - Throws:
BuildException
- if an error occurs
-
testAvailability
Test if a particular class is available to be used.- Parameters:
className
- aString
value- Throws:
BuildException
- if an error occurs
-
regexpMatcherPresent
Checks if a RegExp-Matcher is available.- Parameters:
project
- The project to check for (may benull
)- Returns:
true
if available otherwisefalse
-