Top Description Fields Constructors Methods
org.apache.tools.ant.types

public Class RegularExpression

extends DataType
Class Inheritance
Imports
org.apache.tools.ant.Project, org.apache.tools.ant.util.regexp.Regexp, .RegexpFactory

A regular expression datatype. Keeps an instance of the compiled expression for speed purposes. This compiled expression is lazily evaluated (it is compiled the first time it is needed). The syntax is the dependent on which regular expression type you are using. The system property "ant.regexp.regexpimpl" will be the classname of the implementation that will be used.
Available implementations:

  org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp (default)
       Based on the JDK's built-in regular expression package

  org.apache.tools.ant.util.regexp.JakartaOroRegexp
       Based on the jakarta-oro package

  org.apache.tools.ant.util.regexp.JakartaRegexpRegexp
       Based on the jakarta-regexp package
  <regexp [ [id="id"] pattern="expression" | refid="id" ]
  />
See Also
org.apache.oro.text.regex.Perl5Compiler, org.apache.regexp.RE, java.util.regex.Pattern, org.apache.tools.ant.util.regexp.Regexp

Field Summary

Modifier and TypeField and Description
private boolean
public static final String
DATA_TYPE_NAME

Name of this data type

private static final RegexpFactory
private String
private Regexp
private boolean
Inherited from org.apache.tools.ant.types.DataType:
checkedref

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

pattern
getPattern
(Project
project
p
)

Gets the pattern string for this RegularExpression in the given project.

public RegularExpression

Returns:

resolved RegularExpression instance
getRef
(Project
project
p
)

Get the RegularExpression this reference refers to in the given project.

public Regexp

Returns:

Regexp instance associated with this RegularExpression instance
getRegexp
(Project
project
p
)

provides a reference to the Regexp contained in this

private void
private void
public void
setPattern(String
regular expression pattern
pattern
)

sets the regular expression pattern

Inherited from org.apache.tools.ant.types.DataType:
checkAttributesAllowedcheckChildrenAllowedcircularReferenceclonedieOnCircularReferencedieOnCircularReferencedieOnCircularReferencegetCheckedRefgetCheckedRefgetCheckedRefgetCheckedRefgetCheckedRefgetDataTypeNamegetRefidinvokeCircularReferenceCheckisCheckedisReferencenoChildrenAllowedpushAndInvokeCircularReferenceChecksetCheckedsetRefidtooManyAttributestoString

Field Detail

alreadyInitback to summary
private boolean alreadyInit
DATA_TYPE_NAMEback to summary
public static final String DATA_TYPE_NAME

Name of this data type

FACTORYback to summary
private static final RegexpFactory FACTORY
myPatternback to summary
private String myPattern
regexpback to summary
private Regexp regexp
setPatternPendingback to summary
private boolean setPatternPending

Constructor Detail

RegularExpressionback to summary
public RegularExpression()

Method Detail

getPatternback to summary
public String getPattern(Project p)

Gets the pattern string for this RegularExpression in the given project.

Parameters
p:Project

project

Returns:String

pattern

getRefback to summary
public RegularExpression getRef(Project p)

Get the RegularExpression this reference refers to in the given project. Check for circular references too

Parameters
p:Project

project

Returns:RegularExpression

resolved RegularExpression instance

getRegexpback to summary
public Regexp getRegexp(Project p)

provides a reference to the Regexp contained in this

Parameters
p:Project

project

Returns:Regexp

Regexp instance associated with this RegularExpression instance

initback to summary
private void init(Project p)
setPatternback to summary
private void setPattern()
setPatternback to summary
public void setPattern(String pattern)

sets the regular expression pattern

Parameters
pattern:String

regular expression pattern