RegexpFactory (Apache Ant API)
Description: declaration: package: org.apache.tools.ant.util.regexp, class: RegexpFactory

# Class RegexpFactory

java.lang.Object
org.apache.tools.ant.util.regexp.RegexpMatcherFactory
org.apache.tools.ant.util.regexp.RegexpFactory

public class RegexpFactory extends RegexpMatcherFactory
Regular expression factory, which will create Regexp objects. The actual implementation class depends on the System or Ant Property: `ant.regexp.regexpimpl`.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `RegexpFactory()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected Regexp`
  `createRegexpInstance(String classname)`
  Wrapper over RegexpMatcherFactory.createInstance that ensures that we are dealing with a Regexp implementation.
  `Regexp`
  `newRegexp()`
  Create a new regular expression matcher instance.
  `Regexp`
  `newRegexp(Project p)`
  Create a new regular expression matcher instance.

  ### Methods inherited from class RegexpMatcherFactory

  `createInstance, newRegexpMatcher, newRegexpMatcher, regexpMatcherPresent, testAvailability`
  Modifier and Type
  Method
  Description
  `protected RegexpMatcher`
  `createInstance(String className)`
  Create an instance of a matcher from a classname.
  `RegexpMatcher`
  `newRegexpMatcher()`
  Create a new regular expression instance.
  `RegexpMatcher`
  `newRegexpMatcher(Project p)`
  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.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### RegexpFactory

    public RegexpFactory()

- ## Method Details

  - ### newRegexp

    public Regexp newRegexp() throws BuildException
    Create a new regular expression matcher instance.
    Returns:
      the matcher instance
    Throws:
      `BuildException` - on error

  - ### newRegexp

    public Regexp newRegexp(Project p) throws BuildException
    Create a new regular expression matcher instance.
    Parameters:
      `p` - Project whose ant.regexp.regexpimpl property will be used.
    Returns:
      the matcher instance
    Throws:
      `BuildException` - on error

  - ### createRegexpInstance

    protected Regexp createRegexpInstance(String classname) throws BuildException
    Wrapper over RegexpMatcherFactory.createInstance that ensures that we are dealing with a Regexp implementation.
    Parameters:
      `classname` - the name of the class to use.
    Returns:
      the instance.
    Throws:
      `BuildException` - if there is a problem.
    Since:
      1.3
    See Also:
      - `RegexpMatcherFactory.createInstance(String)`